[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220329182529.0e482ade@kernel.org>
Date: Tue, 29 Mar 2022 18:25:29 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Martin Faltesek <mfaltesek@...omium.org>
Cc: netdev@...r.kernel.org, krzk@...nel.org,
christophe.ricard@...il.com, jordy@...ing.systems,
sameo@...ux.intel.com, wklin@...gle.com, groeck@...gle.com,
surenb@...gle.com, mfaltesek@...gle.com, gregkh@...uxfoundation.org
Subject: Re: [PATCH] nfc: st21nfca: Refactor EVT_TRANSACTION
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.
Powered by blists - more mailing lists