Re: [kmemcheck] WARNING: kmemcheck: Caught 32-bit read from uninitialized memory, in sock_init_data()

From: Vegard Nossum
Date: Wed Aug 26 2009 - 03:13:39 EST


2009/8/26 Ingo Molnar <mingo@xxxxxxx>:
>
> -tip testing found another kmemcheck warning:
>
> calling Ânetlink_proto_init+0x0/0x1b0 @ 1
> NET: Registered protocol family 16
> initcall netlink_proto_init+0x0/0x1b0 returned 0 after 39062 usecs
> calling Âolpc_init+0x0/0x110 @ 1
> WARNING: kmemcheck: Caught 32-bit read from uninitialized memory (f5c38304)
> 0100000002000000000000000000000000000000ad4eaddeffffffffffffffff
> Âi i i i i i u u i i i i i i i i i i i i i i i i i i i i i i i i
> Â Â Â Â ^
>
> Pid: 1, comm: swapper Not tainted (2.6.31-rc7-tip-01170-gaaea9cf-dirty #24) P4DC6
> EIP: 0060:[<c15c8ab1>] EFLAGS: 00010286 CPU: 0
> EIP is at sock_init_data+0xe1/0x220
> EAX: 0001b000 EBX: f606196c ECX: 00000000 EDX: c1a148d2
> ESI: f6061800 EDI: f5c38300 EBP: f606ef0c ESP: c1ceb9ac
> ÂDS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
> CR0: 8005003b CR2: f60a8108 CR3: 01a61000 CR4: 000006f0
> DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
> DR6: ffff4ff0 DR7: 00000400
> Â[<c15fac15>] __netlink_create+0x35/0xa0
> Â[<c15fd01a>] netlink_kernel_create+0x5a/0x180
> Â[<c15df55e>] rtnetlink_net_init+0x1e/0x50
> Â[<c15d130a>] register_pernet_operations+0x6a/0xf0
> Â[<c15d14fe>] register_pernet_subsys+0x1e/0x30
> Â[<c1b3d84c>] rtnetlink_init+0x4c/0x100
> Â[<c1b3e105>] netlink_proto_init+0x105/0x1b0
> Â[<c1001037>] do_one_initcall+0x27/0x170
> Â[<c1afea97>] kernel_init+0x157/0x210
> Â[<c10039a7>] kernel_thread_helper+0x7/0x10
> Â[<ffffffff>] 0xffffffff
> initcall olpc_init+0x0/0x110 returned 0 after 0 usecs
> calling Âbdi_class_init+0x0/0x40 @ 1
>
> config attached.

Thanks. AFAICT, it's this one:

1816 void sock_init_data(struct socket *sock, struct sock *sk)
1817 {
...
1835 sock_set_flag(sk, SOCK_ZAPPED);

Which sort of makes sense, given all the trouble we've had with bitfields/flags.

Is it possible that struct sock's sk_flags is (partially)
uninitialized at this point?

I'll investigate more later, lecture of statistics is about to begin.


Vegard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/