linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	Zhou Qingyang <zhou1615@umn.edu>
Cc: <kjlu@umn.edu>, Alexander Shiyan <shc_work@mail.ru>,
	"Bartlomiej Zolnierkiewicz" <b.zolnierkie@samsung.com>,
	Jens Axboe <axboe@kernel.dk>, <linux-ide@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe()
Date: Thu, 27 Jan 2022 12:37:21 +0300	[thread overview]
Message-ID: <90db4107-18a3-6324-1425-b7c24c399154@omp.ru> (raw)
In-Reply-To: <f7262bda-8669-3910-9e8c-e72a68eb3325@opensource.wdc.com>

Hello!

On 1/27/22 5:15 AM, Damien Le Moal wrote:

>>> In __pata_platform_probe(), devm_kzalloc() is assigned to ap->ops and
>>> there is a dereference of it right after that, which could introduce a
>>> NULL pointer dereference bug.
>>>
>>> Fix this by adding a NULL check of ap->ops.
>>>
>>> This bug was found by a static analyzer.
>>>
>>> Builds with 'make allyesconfig' show no new warnings,
>>> and our static analyzer no longer warns about this code.
>>>
>>> Fixes: f3d5e4f18dba ("ata: pata_of_platform: Allow to use 16-bit wide data transfer")
>>> Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
>>
>> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> 
> Please see my note about the typo in the fix. I kept you RB tag. Let me

   Oops, didn't expect such a stupid bug, so my brain did add the missing ! prolly... :-)
Not clear how he managed to shut up his static analyzer with this patch...

> know if that is OK.

   Of course, sorry for the messy review! :-)

>> [...]

MBR, Sergey

  reply	other threads:[~2022-01-27  9:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24 16:45 [PATCH] ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe() Zhou Qingyang
2022-01-25  9:46 ` Sergey Shtylyov
2022-01-27  2:15   ` Damien Le Moal
2022-01-27  9:37     ` Sergey Shtylyov [this message]
2022-01-27  1:54 ` Damien Le Moal
2022-01-28 10:11 ` Greg KH
2022-01-28 11:50   ` Damien Le Moal
2022-01-28 15:57     ` Greg KH
2022-01-29  0:12       ` Damien Le Moal
2022-01-29  7:06         ` Greg KH
2022-01-31  0:11           ` Damien Le Moal

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=90db4107-18a3-6324-1425-b7c24c399154@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=axboe@kernel.dk \
    --cc=b.zolnierkie@samsung.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=kjlu@umn.edu \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shc_work@mail.ru \
    --cc=zhou1615@umn.edu \
    /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).