diff options
author | Clément Lecigne <clement.lecigne@netasq.com> | 2009-02-12 16:59:09 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-17 09:46:21 -0800 |
commit | bb450c36212e670fdb0cf58fd453557c243f515f (patch) | |
tree | 9ab3cdef0562fe32dfe6f8b7d11decd8f0559a38 /net/core/net-sysfs.c | |
parent | 78ba9033969ce046f54dee30b16aeb04d6a40aed (diff) |
net: 4 bytes kernel memory disclosure in SO_BSDCOMPAT gsopt try #2
[ Upstream commit df0bca049d01c0ee94afb7cd5dfd959541e6c8da ]
In function sock_getsockopt() located in net/core/sock.c, optval v.val
is not correctly initialized and directly returned in userland in case
we have SO_BSDCOMPAT option set.
This dummy code should trigger the bug:
int main(void)
{
unsigned char buf[4] = { 0, 0, 0, 0 };
int len;
int sock;
sock = socket(33, 2, 2);
getsockopt(sock, 1, SO_BSDCOMPAT, &buf, &len);
printf("%x%x%x%x\n", buf[0], buf[1], buf[2], buf[3]);
close(sock);
}
Here is a patch that fix this bug by initalizing v.val just after its
declaration.
Signed-off-by: Clément Lecigne <clement.lecigne@netasq.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/core/net-sysfs.c')
0 files changed, 0 insertions, 0 deletions