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>] [day] [month] [year] [list]
Message-ID: <9cb1a877-f62b-c70b-d537-6552323de8ae@gmail.com>
Date:   Sat, 15 Sep 2018 16:30:04 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     ath9k-devel@....qualcomm.com, Kalle Valo <kvalo@...eaurora.org>
Cc:     linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [BUG] net: wireless: ath9k: Possible sleep-in-atomic-context bugs

My static analysis tool DSAC reports some bugs caused by mutex_lock() in 
ath9k_regwrite_buffer() and ath9k_reg_rmw_buffer().

Here are the related function call paths (from bottom to top) in Linux-4.17:

[FUNC] mutex_lock_nested
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 329:
     mutex_lock_nested in ath9k_regwrite_buffer
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 353:
     ath9k_regwrite_buffer in ath9k_regwrite
drivers/net/wireless/ath/ath9k/mac.c, 146:
     [FUNC_PTR]ath9k_regwrite in ath9k_hw_abort_tx_dma
drivers/net/wireless/ath/ath9k/xmit.c, 1911:
     ath9k_hw_abort_tx_dma in ath_drain_all_txq
drivers/net/wireless/ath/ath9k/main.c, 225:
     ath_drain_all_txq in ath_prepare_reset
drivers/net/wireless/ath/ath9k/main.c, 307:
     ath_prepare_reset in ath_reset_internal
drivers/net/wireless/ath/ath9k/main.c, 295:
     spin_lock_bh in ath_reset_internal

[FUNC] mutex_lock_nested
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 392:
     mutex_lock_nested in ath9k_reg_rmw_buffer
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 509:
     ath9k_reg_rmw_buffer in ath9k_reg_rmw
drivers/net/wireless/ath/ath9k/mac.c, 148:
     [FUNC_PTR]ath9k_reg_rmw in ath9k_hw_abort_tx_dma
drivers/net/wireless/ath/ath9k/xmit.c, 1911:
     ath9k_hw_abort_tx_dma in ath_drain_all_txq
drivers/net/wireless/ath/ath9k/main.c, 225:
     ath_drain_all_txq in ath_prepare_reset
drivers/net/wireless/ath/ath9k/main.c, 307:
     ath_prepare_reset in ath_reset_internal
drivers/net/wireless/ath/ath9k/main.c, 295:
     spin_lock_bh in ath_reset_internal

[FUNC] mutex_lock_nested
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 392:
     mutex_lock_nested in ath9k_reg_rmw_buffer
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 509:
     ath9k_reg_rmw_buffer in ath9k_reg_rmw
drivers/net/wireless/ath/ath9k/hw.c, 2188:
     [FUNC_PTR]ath9k_reg_rmw in ath9k_hw_set_power_awake
drivers/net/wireless/ath/ath9k/hw.c, 2237:
     ath9k_hw_set_power_awake in ath9k_hw_setpower
drivers/net/wireless/ath/ath9k/main.c, 125:
     ath9k_hw_setpower in ath9k_ps_wakeup
drivers/net/wireless/ath/ath9k/main.c, 386:
     ath9k_ps_wakeup in ath9k_tasklet (tasklet handler)

[FUNC] mutex_lock_nested
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 329:
     mutex_lock_nested in ath9k_regwrite_buffer
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 353:
     ath9k_regwrite_buffer in ath9k_regwrite
drivers/net/wireless/ath/ath9k/htc_drv_init.c, 503:
     [FUNC_PTR]ath9k_regwrite in ath9k_reg_rmw
drivers/net/wireless/ath/ath9k/hw.c, 2188:
     [FUNC_PTR]ath9k_reg_rmw in ath9k_hw_set_power_awake
drivers/net/wireless/ath/ath9k/hw.c, 2237:
     ath9k_hw_set_power_awake in ath9k_hw_setpower
drivers/net/wireless/ath/ath9k/main.c, 125:
     ath9k_hw_setpower in ath9k_ps_wakeup
drivers/net/wireless/ath/ath9k/main.c, 386:
     ath9k_ps_wakeup in ath9k_tasklet (tasklet handler)

Note that [FUNC_PTR] means a function pointer call is used.

I am not sure how to well fix these bugs if they are real.


Best wishes,
Jia-Ju Bai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ