From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: error27@gmail.com, Alexander Aring <alex.aring@gmail.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Marcel Holtmann <marcel@holtmann.org>,
Harry Morris <harrymorris12@gmail.com>,
linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH next] ca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx()
Date: Thu, 16 Mar 2023 17:31:59 +0100 [thread overview]
Message-ID: <daee2ba3-effc-67d6-71f7-e99797f93aeb@datenfreihafen.org> (raw)
In-Reply-To: <20230306191824.4115839-1-harshit.m.mogalapalli@oracle.com>
Hello Harshit.
On 06.03.23 20:18, Harshit Mogalapalli wrote:
> mac_len is of type unsigned, which can never be less than zero.
>
> mac_len = ieee802154_hdr_peek_addrs(skb, &header);
> if (mac_len < 0)
> return mac_len;
>
> Change this to type int as ieee802154_hdr_peek_addrs() can return negative
> integers, this is found by static analysis with smatch.
>
> Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> Only compile tested.
> ---
> drivers/net/ieee802154/ca8210.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
> index 0b0c6c0764fe..d0b5129439ed 100644
> --- a/drivers/net/ieee802154/ca8210.c
> +++ b/drivers/net/ieee802154/ca8210.c
> @@ -1902,10 +1902,9 @@ static int ca8210_skb_tx(
> struct ca8210_priv *priv
> )
> {
> - int status;
> struct ieee802154_hdr header = { };
> struct secspec secspec;
> - unsigned int mac_len;
> + int mac_len, status;
>
> dev_dbg(&priv->spi->dev, "%s called\n", __func__);
>
This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!
I took the liberty and changed the fixes tag to the change that
introduced the resaon for the mismatch recently. As suggested by Simon.
regards
Stefan Schmidt
next prev parent reply other threads:[~2023-03-16 16:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 19:18 Harshit Mogalapalli
2023-03-07 0:06 ` Alexander Aring
2023-03-07 8:42 ` Simon Horman
2023-03-07 23:29 ` Alexander Aring
2023-03-16 16:33 ` Stefan Schmidt
2023-03-16 16:31 ` Stefan Schmidt [this message]
2023-03-16 19:02 ` Harshit Mogalapalli
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=daee2ba3-effc-67d6-71f7-e99797f93aeb@datenfreihafen.org \
--to=stefan@datenfreihafen.org \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=error27@gmail.com \
--cc=harrymorris12@gmail.com \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=miquel.raynal@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®