From 3a245766901a9dfdc3f53457a7954b369b50f281 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 9 Apr 2008 16:45:37 +0200 Subject: mac80211: fix key hwaccel race The previous key locking patch left a small race: it would be possible to add a key and take the interface down before the key todo is run so that hwaccel for that key is enabled on an interface that is down. Avoid this by running the todo list when an interface is brought up or down. This patch also fixes a small bug: before this change, a few functions used the key list without the lock that protects it. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- net/mac80211/key.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'net/mac80211/key.h') diff --git a/net/mac80211/key.h b/net/mac80211/key.h index 5d48518985b3..f52c3df1fe9a 100644 --- a/net/mac80211/key.h +++ b/net/mac80211/key.h @@ -54,16 +54,19 @@ struct sta_info; * @KEY_FLAG_TODO_DELETE: Key is marked for deletion and will, after an * RCU grace period, no longer be reachable other than from the * todo list. - * @KEY_FLAG_TODO_HWACCEL: Key needs to be added to hardware acceleration. + * @KEY_FLAG_TODO_HWACCEL_ADD: Key needs to be added to hardware acceleration. + * @KEY_FLAG_TODO_HWACCEL_REMOVE: Key needs to be removed from hardware + * acceleration. * @KEY_FLAG_TODO_DEFKEY: Key is default key and debugfs needs to be updated. * @KEY_FLAG_TODO_ADD_DEBUGFS: Key needs to be added to debugfs. */ enum ieee80211_internal_key_flags { KEY_FLAG_UPLOADED_TO_HARDWARE = BIT(0), KEY_FLAG_TODO_DELETE = BIT(1), - KEY_FLAG_TODO_HWACCEL = BIT(2), - KEY_FLAG_TODO_DEFKEY = BIT(3), - KEY_FLAG_TODO_ADD_DEBUGFS = BIT(4), + KEY_FLAG_TODO_HWACCEL_ADD = BIT(2), + KEY_FLAG_TODO_HWACCEL_REMOVE = BIT(3), + KEY_FLAG_TODO_DEFKEY = BIT(4), + KEY_FLAG_TODO_ADD_DEBUGFS = BIT(5), }; struct ieee80211_key { -- cgit v1.2.3