[PATCH] bluetooth: l2cap: fix 1 byte infoleak to userspace

Subsystems: bluetooth subsystem, the rest

STALE5666d

2 messages, 2 authors, 2011-02-10 · open the first message on its own page

[PATCH] bluetooth: l2cap: fix 1 byte infoleak to userspace

From: Vasiliy Kulikov <hidden>
Date: 2011-02-10 17:59:52

Structure l2cap_options has one padding byte between max_tx and
txwin_size fields.  This byte in "opts" is copied to userspace
uninitialized.

Signed-off-by: Vasiliy Kulikov <segoon-cxoSlKxDwOJWk0Htik3J/w@public.gmane.org>
---
 Compile tested only.

 net/bluetooth/l2cap_sock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index adf4169..21f5385 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -392,6 +392,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us
 
 	switch (optname) {
 	case L2CAP_OPTIONS:
+		memset(&opts, 0, sizeof(opts));
 		opts.imtu     = l2cap_pi(sk)->imtu;
 		opts.omtu     = l2cap_pi(sk)->omtu;
 		opts.flush_to = l2cap_pi(sk)->flush_to;
-- 
1.7.0.4

Re: [PATCH] bluetooth: l2cap: fix 1 byte infoleak to userspace

From: Gustavo F. Padovan <hidden>
Date: 2011-02-10 18:11:30

Hi Vasiliy,

* Vasiliy Kulikov [off-list ref] [2011-02-10 20:59:42 +0300]:
Structure l2cap_options has one padding byte between max_tx and
txwin_size fields.  This byte in "opts" is copied to userspace
uninitialized.

Signed-off-by: Vasiliy Kulikov <segoon-cxoSlKxDwOJWk0Htik3J/w@public.gmane.org>
---
 Compile tested only.

 net/bluetooth/l2cap_sock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Patch has been applied, thanks.

-- 
Gustavo F. Padovan
http://profusion.mobi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help