All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Francesco Magliocca <franciman12@gmail.com>
Cc: ath10k@lists.infradead.org, dan.carpenter@oracle.com,
	rmanohar@qti.qualcomm.com,
	 "linux-wireless\@vger.kernel.org"
	<linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] ath10k: fix pointer arithmetic error in trace call
Date: Mon, 21 Feb 2022 12:38:33 +0200	[thread overview]
Message-ID: <87r17wwlli.fsf@kernel.org> (raw)
In-Reply-To: <20220219113257.5459-1-franciman12@gmail.com> (Francesco Magliocca's message of "Sat, 19 Feb 2022 12:32:57 +0100")

+ linux-wireless

Francesco Magliocca <franciman12@gmail.com> writes:

> Reading through the commit history, it looks like
> there is no special need why we must skip the first 4 bytes
> in this trace call:
>
> trace_ath10k_htt_rx_desc(ar, (void*)rx_desc + sizeof(u32),
> 			 hw->rx_desc_ops->rx_desc_size - sizeof(u32));
>
> found in the function ath10k_htt_rx_amsdu_pop in the file htt_rx.c
>
> i think the original author
> (who is also the one who added rx_desc tracing capabilities
> in a0883cf7e75a) just wanted to trace the rx_desc contents,
> ignoring the fw_rx_desc_base info field
> (which is the part being skipped over).
> But the trace_ath10k_htt_rx_desc later added
> don't care about skipping it, so it may be good
> to uniform this call to the others in the file.
> But this would change the output of the trace and
> thus it may be a problem for tools that rely on it.
> Therefore I propose until further discussion
> to just keep it as it is and just fix the pointer arithmetic bug.
>
> Add missing void* cast to rx descriptor pointer in order to
> properly skip the initial 4 bytes of the rx descriptor
> when passing it to trace_ath10k_htt_rx_desc trace function.
>
> This fixes the pointer arithmetic error detected
> by Dan Carpenter's static analysis tool.
>
> Fixes: 6bae9de622d3 ("ath10k: abstract htt_rx_desc structure")
>
> Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00157-QCARMSWPZ-1
>
> Signed-off-by: Francesco Magliocca <franciman12@gmail.com>
> Link: https://lore.kernel.org/ath10k/20220201130900.GD22458@kili/

Please submit v2 and CC also linux-wireless, otherwise patchwork won't
see the patch.

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

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

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@kernel.org>
To: Francesco Magliocca <franciman12@gmail.com>
Cc: ath10k@lists.infradead.org, dan.carpenter@oracle.com,
	rmanohar@qti.qualcomm.com,
	"linux-wireless\@vger.kernel.org"
	<linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] ath10k: fix pointer arithmetic error in trace call
Date: Mon, 21 Feb 2022 12:38:33 +0200	[thread overview]
Message-ID: <87r17wwlli.fsf@kernel.org> (raw)
In-Reply-To: <20220219113257.5459-1-franciman12@gmail.com> (Francesco Magliocca's message of "Sat, 19 Feb 2022 12:32:57 +0100")

+ linux-wireless

Francesco Magliocca <franciman12@gmail.com> writes:

> Reading through the commit history, it looks like
> there is no special need why we must skip the first 4 bytes
> in this trace call:
>
> trace_ath10k_htt_rx_desc(ar, (void*)rx_desc + sizeof(u32),
> 			 hw->rx_desc_ops->rx_desc_size - sizeof(u32));
>
> found in the function ath10k_htt_rx_amsdu_pop in the file htt_rx.c
>
> i think the original author
> (who is also the one who added rx_desc tracing capabilities
> in a0883cf7e75a) just wanted to trace the rx_desc contents,
> ignoring the fw_rx_desc_base info field
> (which is the part being skipped over).
> But the trace_ath10k_htt_rx_desc later added
> don't care about skipping it, so it may be good
> to uniform this call to the others in the file.
> But this would change the output of the trace and
> thus it may be a problem for tools that rely on it.
> Therefore I propose until further discussion
> to just keep it as it is and just fix the pointer arithmetic bug.
>
> Add missing void* cast to rx descriptor pointer in order to
> properly skip the initial 4 bytes of the rx descriptor
> when passing it to trace_ath10k_htt_rx_desc trace function.
>
> This fixes the pointer arithmetic error detected
> by Dan Carpenter's static analysis tool.
>
> Fixes: 6bae9de622d3 ("ath10k: abstract htt_rx_desc structure")
>
> Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00157-QCARMSWPZ-1
>
> Signed-off-by: Francesco Magliocca <franciman12@gmail.com>
> Link: https://lore.kernel.org/ath10k/20220201130900.GD22458@kili/

Please submit v2 and CC also linux-wireless, otherwise patchwork won't
see the patch.

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

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

  reply	other threads:[~2022-02-21 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19 11:32 [PATCH] ath10k: fix pointer arithmetic error in trace call Francesco Magliocca
2022-02-21 10:38 ` Kalle Valo [this message]
2022-02-21 10:38   ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r17wwlli.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath10k@lists.infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=franciman12@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rmanohar@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.