All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sven Peter" <sven@svenpeter.dev>
To: "Yang Yingliang" <yangyingliang@huawei.com>
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	will@kernel.org, joro@8bytes.org, alyssa@rosenzweig.io
Subject: Re: [PATCH] iommu/dart: check return value after calling platform_get_resource()
Date: Tue, 26 Apr 2022 22:22:05 +0200	[thread overview]
Message-ID: <FCB9C443-0A57-4E8D-AF13-A61F80861A4F@svenpeter.dev> (raw)
In-Reply-To: <20220425090826.2532165-1-yangyingliang@huawei.com>

> On 25. Apr 2022, at 10:56, Yang Yingliang <yangyingliang@huawei.com> wrote:
> 
> It will cause null-ptr-deref in resource_size(), if platform_get_resource()
> returns NULL, move calling resource_size() after devm_ioremap_resource() that
> will check 'res' to avoid null-ptr-deref.
> And use devm_platform_get_and_ioremap_resource() to simplify code.
> 
> Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Sven Peter <sven@svenpeter.dev>


Thanks,

Sven


WARNING: multiple messages have this Message-ID (diff)
From: Sven Peter via iommu <iommu@lists.linux-foundation.org>
To: "Yang Yingliang" <yangyingliang@huawei.com>
Cc: iommu@lists.linux-foundation.org, will@kernel.org,
	linux-kernel@vger.kernel.org, alyssa@rosenzweig.io
Subject: Re: [PATCH] iommu/dart: check return value after calling platform_get_resource()
Date: Tue, 26 Apr 2022 22:22:05 +0200	[thread overview]
Message-ID: <FCB9C443-0A57-4E8D-AF13-A61F80861A4F@svenpeter.dev> (raw)
In-Reply-To: <20220425090826.2532165-1-yangyingliang@huawei.com>

> On 25. Apr 2022, at 10:56, Yang Yingliang <yangyingliang@huawei.com> wrote:
> 
> It will cause null-ptr-deref in resource_size(), if platform_get_resource()
> returns NULL, move calling resource_size() after devm_ioremap_resource() that
> will check 'res' to avoid null-ptr-deref.
> And use devm_platform_get_and_ioremap_resource() to simplify code.
> 
> Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Sven Peter <sven@svenpeter.dev>


Thanks,

Sven

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2022-04-26 20:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  9:08 [PATCH] iommu/dart: check return value after calling platform_get_resource() Yang Yingliang
2022-04-25  9:08 ` Yang Yingliang via iommu
2022-04-26 20:22 ` Sven Peter [this message]
2022-04-26 20:22   ` Sven Peter via iommu
2022-04-28  9:39 ` Joerg Roedel
2022-04-28  9:39   ` Joerg Roedel

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=FCB9C443-0A57-4E8D-AF13-A61F80861A4F@svenpeter.dev \
    --to=sven@svenpeter.dev \
    --cc=alyssa@rosenzweig.io \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=yangyingliang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.