[lvc-project] [PATCH] wifi: ath10k: add extra output check in ath10k_wmi_event_debug_print()

Fedor Pchelkin pchelkin at ispras.ru
Fri Jan 10 15:08:27 MSK 2025


On Fri, 10. Jan 14:50, Dmitry Antipov wrote:
> In 'ath10k_wmi_event_debug_print()', passing skb of the very weird
> layout may produce debug output of the zero length. In such a case,
> 'if (skb->data[i - 1] == '\n')' will trigger an access beyond skb data
> boundaries. So fix this by adding an extra check whether at least one
> byte of the debug output was really emitted. Compile tested only.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Suggested-by: Fedor Pchelkin <pchelkin at ispras.ru>

Дмитрий, я не предлагал идеи для патча, а лишь предлагал Вам более
основательно подойти к исследованию предупреждения. На себя я готов взять
какую-либо ответственность за идею патча или что-то подобное, если бы патч
и сама проблема были бы со мной в списке рассылки lvc-patches at linuxtesting.org
или в переписке Свейса хотя бы предварительно обсуждены. А так это выглядит
как перенос ответственности и потенциальных упрёков мэйнтейнеров в мой
адрес. Надеюсь, Вы не это имели ввиду. Но предлагаю всё же ознакомиться с
пунктом из документации ядра [1]:

  A Suggested-by: tag indicates that the patch idea is suggested by the
  person named and ensures credit to the person for the idea. Please note
  that this tag should not be added without the reporter’s permission,
  especially if the idea was not posted in a public forum. That said, if
  we diligently credit our idea reporters, they will, hopefully, be
  inspired to help us again in the future.

Suggested-by обычно ставится, если идея патча была явно предложена человеком
в списках рассылки.

[1]: https://docs.kernel.org/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes

> Signed-off-by: Dmitry Antipov <dmantipov at yandex.ru>
> ---
>  drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> index 5e061f7525a6..ca3237c7d5b0 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -4618,7 +4618,7 @@ void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb)
>  		ath10k_warn(ar, "wmi debug print truncated: %d\n", skb->len);
>  
>  	/* for some reason the debug prints end with \n, remove that */
> -	if (skb->data[i - 1] == '\n')
> +	if (i && skb->data[i - 1] == '\n')
>  		i--;
>  
>  	/* the last byte is always reserved for the null character */
> -- 
> 2.47.1
> 



More information about the lvc-project mailing list