lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220411154210.1870008-1-linux@roeck-us.net>
Date:   Mon, 11 Apr 2022 08:42:10 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     linux-wireless@...r.kernel.org
Cc:     Luca Coelho <luciano.coelho@...el.com>,
        Kalle Valo <kvalo@...nel.org>, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
        Johannes Berg <johannes.berg@...el.com>,
        Guenter Roeck <linux@...ck-us.net>,
        Gregory Greenman <gregory.greenman@...el.com>
Subject: [PATCH] iwlwifi: iwl-dbg: Use del_timer_sync() before freeing

In Chrome OS, a large number of crashes is observed due to corrupted timer
lists. Steven Rostedt pointed out that this usually happens when a timer
is freed while still active, and that the problem is often triggered
by code calling del_timer() instead of del_timer_sync() just before
freeing.

Steven also identified the iwlwifi driver as one of the possible culprits
since it does exactly that.

Reported-by: Steven Rostedt <rostedt@...dmis.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Johannes Berg <johannes.berg@...el.com>
Cc: Gregory Greenman <gregory.greenman@...el.com>
Fixes: 60e8abd9d3e91 ("iwlwifi: dbg_ini: add periodic trigger new API support")
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
---
v1 (from RFC):
    Removed Shahar S Matityahu from Cc: and added Gregory Greenman.
    No functional change.

I thought about the need to add a mutex to protect the timer list, but
I convinced myself that it is not necessary because the code adding
the timer list and the code removing it should never be never executed
in parallel.

 drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
index 866a33f49915..3237d4b528b5 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
@@ -371,7 +371,7 @@ void iwl_dbg_tlv_del_timers(struct iwl_trans *trans)
 	struct iwl_dbg_tlv_timer_node *node, *tmp;
 
 	list_for_each_entry_safe(node, tmp, timer_list, list) {
-		del_timer(&node->timer);
+		del_timer_sync(&node->timer);
 		list_del(&node->list);
 		kfree(node);
 	}
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ