]> git.baikalelectronics.ru Git - kernel.git/commit
net: dont leave active on stack LIST_HEAD
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Feb 2011 22:54:38 +0000 (22:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Feb 2011 19:49:35 +0000 (11:49 -0800)
commit2ea878f37cea6cf7c9ae4b8f2670fbeb0e517718
treec664fa9d09f0d946270c5a3cfb821a0bc95f3d8f
parentc969a412d4d81dcfe6f953693543706cf88600ac
net: dont leave active on stack LIST_HEAD

Eric W. Biderman and Michal Hocko reported various memory corruptions
that we suspected to be related to a LIST head located on stack, that
was manipulated after thread left function frame (and eventually exited,
so its stack was freed and reused).

Eric Dumazet suggested the problem was probably coming from commit
6d4f0823e18b (net: factorize
sync-rcu call in unregister_netdevice_many)

This patch fixes __dev_close() and dev_close() to properly deinit their
respective LIST_HEAD(single) before exiting.

References: https://lkml.org/lkml/2011/2/16/304
References: https://lkml.org/lkml/2011/2/14/223

Reported-by: Michal Hocko <mhocko@suse.cz>
Tested-by: Michal Hocko <mhocko@suse.cz>
Reported-by: Eric W. Biderman <ebiderman@xmission.com>
Tested-by: Eric W. Biderman <ebiderman@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c