netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Martin Faltesek <mfaltesek@chromium.org>
Cc: netdev@vger.kernel.org, krzk@kernel.org,
	christophe.ricard@gmail.com, jordy@pwning.systems,
	sameo@linux.intel.com, wklin@google.com, groeck@google.com,
	surenb@google.com, mfaltesek@google.com,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH] nfc: st21nfca: Refactor EVT_TRANSACTION
Date: Tue, 29 Mar 2022 18:25:29 -0700	[thread overview]
Message-ID: <20220329182529.0e482ade@kernel.org> (raw)
In-Reply-To: <20220329175431.3175472-1-mfaltesek@google.com>

On Tue, 29 Mar 2022 12:54:31 -0500 Martin Faltesek wrote:
> EVT_TRANSACTION has four different bugs:
> 
> 1. First conditional has logical AND but should be OR. It should
>    always check if it isn't NFC_EVT_TRANSACTION_AID_TAG, then
>    bail.
> 
> 2. Potential under allocating memory:devm_kzalloc (skb->len - 2)
>    when the aid_len specified in the packet is less than the fixed
>    NFC_MAX_AID_LENGTH in struct nfc_evt_transaction. In addition,
>    aid_len is u32 in the data structure, and u8 in the packet,
>    under counting 3 more bytes.
> 
> 3. Memory leaks after kzalloc when returning error.
> 
> 4. The final conditional check is also incorrect, for the same reasons
>    explained in #2.

Any time you're tempted to write a list in your commit message the
chances are you should split the change into multiple patches.

      parent reply	other threads:[~2022-03-30  1:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 17:54 [PATCH] nfc: st21nfca: Refactor EVT_TRANSACTION Martin Faltesek
2022-03-29 18:04 ` Guenter Roeck
2022-03-30  1:25 ` 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=20220329182529.0e482ade@kernel.org \
    --to=kuba@kernel.org \
    --cc=christophe.ricard@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@google.com \
    --cc=jordy@pwning.systems \
    --cc=krzk@kernel.org \
    --cc=mfaltesek@chromium.org \
    --cc=mfaltesek@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=surenb@google.com \
    --cc=wklin@google.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;
as well as URLs for NNTP newsgroup(s).