Re: [PATCH v2] wifi: nl80211: fix bounds checker error in nl80211_parse_sched_scan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/29/2024 6:22 AM, Aleksei Vetrov wrote:
> The channels array in the cfg80211_scan_request has a __counted_by
> attribute attached to it, which points to the n_channels variable. This
> attribute is used in bounds checking, and if it is not set before the
> array is filled, then the bounds sanitizer will issue a warning or a
> kernel panic if CONFIG_UBSAN_TRAP is set.
> 
> This patch sets the size of allocated memory as the initial value for
> n_channels. It is updated with the actual number of added elements after
> the array is filled.
> 
> Fixes: aa4ec06c455d ("wifi: cfg80211: use __counted_by where appropriate")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Aleksei Vetrov <vvvvvv@xxxxxxxxxx>
Reviewed-by: Jeff Johnson <quic_jjohnson@xxxxxxxxxxx>

And it is exactly this kind of issue why I'm not accepting any __counted_by()
changes in ath.git without actually testing the code that is modified.

/jeff





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux