Bluetooth: bnep: fix information leak to userland
authorVasiliy Kulikov <[email protected]>
Sat, 30 Oct 2010 14:26:21 +0000 (18:26 +0400)
committerGustavo F. Padovan <[email protected]>
Wed, 1 Dec 2010 23:04:35 +0000 (21:04 -0200)
Structure bnep_conninfo is copied to userland with the field "device"
that has the last elements unitialized.  It leads to leaking of
contents of kernel stack memory.

Signed-off-by: Vasiliy Kulikov <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Gustavo F. Padovan <[email protected]>
net/bluetooth/bnep/core.c

index f10b41fb05a0e1cd51ebae02320f755c249ef0a3..5868597534e529b4c33d1e603cbe38bed740a4ad 100644 (file)
@@ -648,6 +648,7 @@ int bnep_del_connection(struct bnep_conndel_req *req)
 
 static void __bnep_copy_ci(struct bnep_conninfo *ci, struct bnep_session *s)
 {
+       memset(ci, 0, sizeof(*ci));
        memcpy(ci->dst, s->eh.h_source, ETH_ALEN);
        strcpy(ci->device, s->dev->name);
        ci->flags = s->flags;