public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
* [ath:ath12k-mlo-qcn9274 64/81] drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15
@ 2024-10-09 11:14 Dan Carpenter
  2024-11-04 20:19 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-10-09 11:14 UTC (permalink / raw)
  To: oe-kbuild, Sriram R
  Cc: lkp, oe-kbuild-all, Jeff Johnson, Kalle Valo, ath12k, Kalle Valo,
	Rameshkumar Sundaram

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git ath12k-mlo-qcn9274
head:   7435d14d41d5d479a5e6a8a2cd4efdac9d928823
commit: 8e3d460d4c16e52a70ebfa7e1dd0bd20bf739888 [64/81] wifi: ath12k: Use mac80211 vif's link conf instead of bss_conf
config: csky-randconfig-r072-20241008 (https://download.01.org/0day-ci/archive/20241009/202410090633.yjfmlMkr-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.1.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202410090633.yjfmlMkr-lkp@intel.com/

New smatch warnings:
drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15
drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15
drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15
drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15
drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15

vim +517 drivers/net/wireless/ath/ath12k/mac.c

8e3d460d4c16e5 Sriram R   2024-08-16  507  struct ieee80211_bss_conf *ath12k_get_link_bss_conf(struct ath12k_link_vif *arvif)
8e3d460d4c16e5 Sriram R   2024-08-16  508  {
8e3d460d4c16e5 Sriram R   2024-08-16  509  	struct ieee80211_vif *vif = arvif->ahvif->vif;
8e3d460d4c16e5 Sriram R   2024-08-16  510  	struct ieee80211_bss_conf *link_conf;
8e3d460d4c16e5 Sriram R   2024-08-16  511  	/* ieee80211_vif->link_conf[]s are rcu objects which requires rcu_read_lock()
8e3d460d4c16e5 Sriram R   2024-08-16  512  	 * to be held for safe access.
8e3d460d4c16e5 Sriram R   2024-08-16  513  	 */
8e3d460d4c16e5 Sriram R   2024-08-16  514  	if (arvif->link_id > IEEE80211_MLD_MAX_NUM_LINKS)

Seems like this is an off by one.

8e3d460d4c16e5 Sriram R   2024-08-16  515  		return NULL;
8e3d460d4c16e5 Sriram R   2024-08-16  516  	rcu_read_lock();
8e3d460d4c16e5 Sriram R   2024-08-16 @517  	link_conf = rcu_dereference(vif->link_conf[arvif->link_id]);
8e3d460d4c16e5 Sriram R   2024-08-16  518  	rcu_read_unlock();
8e3d460d4c16e5 Sriram R   2024-08-16  519  	return link_conf;
8e3d460d4c16e5 Sriram R   2024-08-16  520  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ath:ath12k-mlo-qcn9274 64/81] drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15
  2024-10-09 11:14 [ath:ath12k-mlo-qcn9274 64/81] drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15 Dan Carpenter
@ 2024-11-04 20:19 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2024-11-04 20:19 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: oe-kbuild, Sriram R, lkp, oe-kbuild-all, Jeff Johnson, ath12k,
	Rameshkumar Sundaram

Dan Carpenter <dan.carpenter@linaro.org> writes:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git ath12k-mlo-qcn9274
> head:   7435d14d41d5d479a5e6a8a2cd4efdac9d928823
> commit: 8e3d460d4c16e52a70ebfa7e1dd0bd20bf739888 [64/81] wifi: ath12k:
> Use mac80211 vif's link conf instead of bss_conf
> config: csky-randconfig-r072-20241008
> (https://download.01.org/0day-ci/archive/20241009/202410090633.yjfmlMkr-lkp@intel.com/config)
> compiler: csky-linux-gcc (GCC) 14.1.0
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202410090633.yjfmlMkr-lkp@intel.com/
>
> New smatch warnings:
> drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf()
> error: buffer overflow 'vif->link_conf' 15 <= 15
> drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf()
> error: buffer overflow 'vif->link_conf' 15 <= 15
> drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf()
> error: buffer overflow 'vif->link_conf' 15 <= 15
> drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf()
> error: buffer overflow 'vif->link_conf' 15 <= 15
> drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf()
> error: buffer overflow 'vif->link_conf' 15 <= 15
>
> vim +517 drivers/net/wireless/ath/ath12k/mac.c
>
> 8e3d460d4c16e5 Sriram R 2024-08-16 507 struct ieee80211_bss_conf
> *ath12k_get_link_bss_conf(struct ath12k_link_vif *arvif)
> 8e3d460d4c16e5 Sriram R   2024-08-16  508  {
> 8e3d460d4c16e5 Sriram R   2024-08-16  509  	struct ieee80211_vif *vif = arvif->ahvif->vif;
> 8e3d460d4c16e5 Sriram R   2024-08-16  510  	struct ieee80211_bss_conf *link_conf;
> 8e3d460d4c16e5 Sriram R 2024-08-16 511 /* ieee80211_vif->link_conf[]s
> are rcu objects which requires rcu_read_lock()
> 8e3d460d4c16e5 Sriram R   2024-08-16  512  	 * to be held for safe access.
> 8e3d460d4c16e5 Sriram R   2024-08-16  513  	 */
> 8e3d460d4c16e5 Sriram R   2024-08-16  514  	if (arvif->link_id > IEEE80211_MLD_MAX_NUM_LINKS)
>
> Seems like this is an off by one.

Yup, fixed version of the patch (not yet submitted for review):

https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=ath12k-mlo&id=51a7ce0fc98b4fc70200cc113ec77a8159c40ca4

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-04 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 11:14 [ath:ath12k-mlo-qcn9274 64/81] drivers/net/wireless/ath/ath12k/mac.c:517 ath12k_get_link_bss_conf() error: buffer overflow 'vif->link_conf' 15 <= 15 Dan Carpenter
2024-11-04 20:19 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox