From: Baolu Lu <baolu.lu@linux.intel.com>
To: Dan Carpenter <error27@gmail.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: baolu.lu@linux.intel.com, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Kevin Tian <kevin.tian@intel.com>, Jason Gunthorpe <jgg@ziepe.ca>,
iommu@lists.linux.dev, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iommu/sva: fix signedness bug in iommu_sva_alloc_pasid()
Date: Thu, 6 Apr 2023 20:48:00 +0800 [thread overview]
Message-ID: <ac9ad124-8cfc-e0af-bf7c-5cbbee48a695@linux.intel.com> (raw)
In-Reply-To: <6b32095d-7491-4ebb-a850-12e96209eaaf@kili.mountain>
On 2023/4/6 16:55, Dan Carpenter wrote:
> The ida_alloc_range() function returns negative error codes on error.
> On success it returns values in the min to max range (inclusive). It
> never returns more then INT_MAX even if "max" is higher. It never
> returns values in the 0 to (min - 1) range.
>
> The bug is that "min" is an unsigned int so negative error codes will
> be promoted to high positive values errors treated as success.
>
> Fixes: 1a14bf0fc7ed ("iommu/sva: Use GFP_KERNEL for pasid allocation")
> Signed-off-by: Dan Carpenter<error27@gmail.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Best regards,
baolu
next prev parent reply other threads:[~2023-04-06 13:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 8:55 [PATCH] iommu/sva: fix signedness bug in iommu_sva_alloc_pasid() Dan Carpenter
2023-04-06 12:48 ` Baolu Lu [this message]
2023-07-07 7:17 ` Dan Carpenter
2023-07-10 9:27 ` Will Deacon
2023-07-10 9:34 ` Dan Carpenter
2023-07-14 12:53 ` 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=ac9ad124-8cfc-e0af-bf7c-5cbbee48a695@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=error27@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jgg@ziepe.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=kevin.tian@intel.com \
--cc=robin.murphy@arm.com \
--cc=will@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