]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: Fix debugfs union misuse and pointer corruption
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 28 Aug 2008 12:12:06 +0000 (15:12 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 2 Sep 2008 21:39:50 +0000 (17:39 -0400)
commit344dd147a4c819d997c2e4b93169a5604c347ee3
tree25f04fc9b6efa005666fff54f0ccecc38fa32b83
parente39fa7ba5fd8c7a63df4f0c8e6e6249fd2896ea4
mac80211: Fix debugfs union misuse and pointer corruption

debugfs union in struct ieee80211_sub_if_data is misused by including a
common default_key dentry as a union member. This ends occupying the same
memory area with the first dentry in other union members (structures;
usually drop_unencrypted). Consequently, debugfs operations on
default_key symlinks and drop_unencrypted entry are using the same
dentry pointer even though they are supposed to be separate ones. This
can lead to removing entries incorrectly or potentially leaving
something behind since one of the dentry pointers gets lost.

Fix this by moving the default_key dentry to a new struct
(common_debugfs) that contains dentries (more to be added in future)
that are shared by all vif types. The debugfs union must only be used
for vif type-specific entries to avoid this type of pointer corruption.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/debugfs_key.c
net/mac80211/ieee80211_i.h