Comment 36 for bug 1504626

Revision history for this message
In , Harald Sitter (apachelogger) wrote :

Git commit f1e6b9d168281196010c44af2eae4587c1d2d088 by Harald Sitter.
Committed on 21/10/2015 at 05:38.
Pushed by sitter into branch 'master'.

initialize socket size with correct value

to quote man 2 accept:
> The addrlen argument is a value-result argument: the caller must
> initialize it to contain the size (in bytes) of the structure pointed
> to by addr; on return it will contain the actual size of the peer
> address.

If addrlen is not correct we may get EINVAL on trying to connect to the
environment socket which in turn results in a broken environment of the
daemon when started through pam as it will inherit the DM environment.
This doesn't have to happen, it does however reproducibly with nvidia-352
on Kubuntu 15.10. Why or how nvidia plays into this is not entirely clear,
best bet is that it simply is a coincidence where nvidia would have
something allocated in the memory beforehand and since the addrlen
stack variable was not explicitly initialized to anything it would could
potentially be negative (EINVAL condition) or wrong such that it meets
an internal error check within accept().

CHANGELOG: Fixed KWallet configuration file warnings on login
FIXED-IN: 5.16
REVIEW: 125717

M +1 -1 src/runtime/kwalletd/main.cpp

http://commits.kde.org/kwallet-framework/f1e6b9d168281196010c44af2eae4587c1d2d088