Skip to contentSkip to conversation

bluetooth: l2cap: fix 1 byte infoleak to userspace

PATCH In review Vasiliy Kulikov 2 participants 2 messages Feb 10, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bluetooth: l2cap: fix 1 byte infoleak to userspace

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

---
Compile tested only.

 net/bluetooth/l2cap_sock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/bluetooth/l2cap_sock.c +1 -0
index adf4169..21f5385 100644
@@ -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;
Signature · 1 line
1.7.0.4
#1 lore raw

Hi Vasiliy,

Quoted 10 lines · Vasiliy Kulikov

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

---
Compile tested only.

 net/bluetooth/l2cap_sock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch has been applied, thanks.

Signature · 2 lines
Gustavo F. Padovan
http://profusion.mobi