Codebase list kwallet-kf5 / ubuntu/5.15.0-0ubuntu2
Add upstream_initialize-socket-size-with-correct-value.patch to resolve a rather impactful error where kwalletd5, when started through the PAM, would fail to communicate with its environment socket and thus end up with a night empty environment rendering the daemon broken. https://bugs.kde.org/show_bug.cgi?id=351805 Harald Sitter 8 years ago
3 changed file(s) with 57 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 kwallet-kf5 (5.15.0-0ubuntu2) wily; urgency=medium
1
2 * Add upstream_initialize-socket-size-with-correct-value.patch to resolve a
3 rather impactful error where kwalletd5, when started through the PAM,
4 would fail to communicate with its environment socket and thus end up with
5 a night empty environment rendering the daemon broken.
6 The patch has been refreshed on top of 5.15 as git master has additional
7 changes.
8 https://bugs.kde.org/show_bug.cgi?id=351805
9
10 -- Harald Sitter <sitter@kde.org> Wed, 21 Oct 2015 07:41:12 +0200
11
012 kwallet-kf5 (5.15.0-0ubuntu1) wily; urgency=medium
113
214 [ Scarlett Clark ]
0 upstream_initialize-socket-size-with-correct-value.patch
0 From f1e6b9d168281196010c44af2eae4587c1d2d088 Mon Sep 17 00:00:00 2001
1 From: Harald Sitter <sitter@kde.org>
2 Date: Wed, 21 Oct 2015 07:38:48 +0200
3 Subject: [PATCH] initialize socket size with correct value
4
5 to quote man 2 accept:
6 > The addrlen argument is a value-result argument: the caller must
7 > initialize it to contain the size (in bytes) of the structure pointed
8 > to by addr; on return it will contain the actual size of the peer
9 > address.
10
11 If addrlen is not correct we may get EINVAL on trying to connect to the
12 environment socket which in turn results in a broken environment of the
13 daemon when started through pam as it will inherit the DM environment.
14 This doesn't have to happen, it does however reproducibly with nvidia-352
15 on Kubuntu 15.10. Why or how nvidia plays into this is not entirely clear,
16 best bet is that it simply is a coincidence where nvidia would have
17 something allocated in the memory beforehand and since the addrlen
18 stack variable was not explicitly initialized to anything it would could
19 potentially be negative (EINVAL condition) or wrong such that it meets
20 an internal error check within accept().
21
22 CHANGELOG: Fixed KWallet configuration file warnings on login
23 FIXED-IN: 5.16
24 BUG: 351805
25 REVIEW: 125717
26 ---
27 src/runtime/kwalletd/main.cpp | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30 Index: kwallet-kf5-5.15.0/src/runtime/kwalletd/main.cpp
31 ===================================================================
32 --- kwallet-kf5-5.15.0.orig/src/runtime/kwalletd/main.cpp
33 +++ kwallet-kf5-5.15.0/src/runtime/kwalletd/main.cpp
34 @@ -82,8 +82,8 @@ static int waitForEnvironment()
35 printf("kwalletd: waitingForEnvironment on: %d\n", socketfd);
36
37 int s2;
38 - socklen_t t;
39 struct sockaddr_un remote;
40 + socklen_t t = sizeof(remote);
41 if ((s2 = accept(socketfd, (struct sockaddr *)&remote, &t)) == -1) {
42 fprintf(stdout, "kwalletd: Couldn't accept incoming connection\n");
43 return -1;