Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Juraj Šarinay" <juraj@sarinay.com>
Cc: netdev@vger.kernel.org, krzk@kernel.org
Subject: Re: [PATCH net-next] net: nfc: Propagate ISO14443 type A target ATS to userspace via netlink
Date: Wed, 30 Oct 2024 18:37:53 -0700	[thread overview]
Message-ID: <20241030183747.0a042cb9@kicinski-fedora-PC1C0HJN> (raw)
In-Reply-To: <20241027143710.5345-1-juraj@sarinay.com>

On Sun, 27 Oct 2024 15:37:10 +0100 Juraj Šarinay wrote:
> diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
> index 3a3781838c67..72be94e5ecb1 100644
> --- a/include/net/nfc/nfc.h
> +++ b/include/net/nfc/nfc.h
> @@ -105,6 +105,8 @@ struct nfc_target {
>  	u8 is_iso15693;
>  	u8 iso15693_dsfid;
>  	u8 iso15693_uid[NFC_ISO15693_UID_MAXSIZE];
> +	u8 ats_len;
> +	u8 ats[NFC_ATS_MAXSIZE];

New fields need kdoc:

include/net/nfc/nfc.h:111: warning: Function parameter or struct member 'ats_len' not described in 'nfc_target'
include/net/nfc/nfc.h:111: warning: Function parameter or struct member 'ats' not described in 'nfc_target'

> +	if (ntf->activation_params.nfca_poll_iso_dep.rats_res_len > 0) {
> +		ndev->target_ats_len = ntf->activation_params.nfca_poll_iso_dep.rats_res_len;
> +		memcpy(ndev->target_ats, ntf->activation_params.nfca_poll_iso_dep.rats_res,
> +		       ndev->target_ats_len);

somewhat tangential but does something validate the buffer vs this
length? I see handling in nci_extract_activation_params_iso_dep()
does a min(*data, 20) but there is no buffer length passed in.
Is there a generic length validation somewhere vs the bounds of @data?
-- 
pw-bot: cr

  parent reply	other threads:[~2024-10-31  1:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-27 14:37 [PATCH net-next] net: nfc: Propagate ISO14443 type A target ATS to userspace via netlink Juraj Šarinay
2024-10-29 10:47 ` Krzysztof Kozlowski
2024-10-31  1:37 ` Jakub Kicinski [this message]
2024-11-03 11:31   ` Juraj Šarinay

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=20241030183747.0a042cb9@kicinski-fedora-PC1C0HJN \
    --to=kuba@kernel.org \
    --cc=juraj@sarinay.com \
    --cc=krzk@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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