From: Jakub Kicinski <kuba@kernel.org>
To: "Lukas K." <kernel@0x83.eu>
Cc: Thorsten Leemhuis <regressions@leemhuis.info>,
linux-kernel@vger.kernel.org, krzk@kernel.org,
regressions@lists.linux.dev, netdev@vger.kernel.org,
Michael Thalmeier <michael.thalmeier@hale.at>
Subject: Re: [REGRESSION] NFC broken on Thinkpad T14 Gen since 9c328f5
Date: Tue, 17 Feb 2026 16:21:13 -0800 [thread overview]
Message-ID: <20260217162113.12ea590c@kernel.org> (raw)
In-Reply-To: <d73ccfcf-507c-4c22-beeb-efc24f671626@0x83.eu>
On Sat, 7 Feb 2026 01:25:29 +0100 Lukas K. wrote:
> > static const __u8 *
> > nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
> > struct rf_tech_specific_params_nfca_poll *nfca_poll,
> >- const __u8 *data)
> >+ const __u8 *data, size_t data_len)
> > {
> >+ /* Check if we have enough data for sens_res (2 bytes) */
> >+ if (data_len < 2)
> >+ return ERR_PTR(-EINVAL);
> >+
> > nfca_poll->sens_res = __le16_to_cpu(*((__le16 *)data));
> > data += 2;
> >+ data_len -= 2;
> >+
> >+ /* Check if we have enough data for nfcid1_len (1 byte) */
> >+ if (data_len < 1)
> >+ return ERR_PTR(-EINVAL);
>
> If data_len underflows at any point it'll wrap to some large value and
> the less than comparisons will yield an incorrect result. Using ssize_t
> should fix that.
Could you make this modification and repost the patch?
Keep the original author, since Michael wrote most of the code,
just add your Signed-off-by at the end.
prev parent reply other threads:[~2026-02-18 0:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 15:15 [REGRESSION] NFC broken on Thinkpad T14 Gen since 9c328f5 Lukas K.
2026-02-06 16:24 ` Thorsten Leemhuis
2026-02-07 0:25 ` Lukas K.
2026-02-07 0:38 ` Andrew Lunn
2026-02-18 0:21 ` Jakub Kicinski [this message]
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=20260217162113.12ea590c@kernel.org \
--to=kuba@kernel.org \
--cc=kernel@0x83.eu \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.thalmeier@hale.at \
--cc=netdev@vger.kernel.org \
--cc=regressions@leemhuis.info \
--cc=regressions@lists.linux.dev \
/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