mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Yousef Alhouseen <alhouseenyousef@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] xen/gntalloc: validate grant count before allocation
Date: Wed, 1 Jul 2026 09:53:24 +0200	[thread overview]
Message-ID: <ea52ef38-8ad2-4b1f-af34-203f167242e5@suse.com> (raw)
In-Reply-To: <20260626223805.43781-3-alhouseenyousef@gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 665 bytes --]

On 27.06.26 00:38, Yousef Alhouseen wrote:
> gntalloc_ioctl_alloc() allocates the grant-id array before checking
> whether the requested count fits within the global grant limit. Counts
> above that limit cannot succeed, so reject them before the
> user-controlled allocation reaches kcalloc().
> 
> Use a subtraction-based check while holding gref_mutex so adding the
> requested count cannot wrap. Also cast the count before advancing the
> per-file index so the page-size multiplication is performed in 64-bit
> arithmetic.
> 
> Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

      reply	other threads:[~2026-07-01  7:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 12:47 [PATCH] " Yousef Alhouseen
2026-06-26 12:14 ` Juergen Gross
2026-06-26 22:38 ` [PATCH v2 0/2] " Yousef Alhouseen
2026-06-26 22:38   ` [PATCH v2 1/2] xen/gntalloc: make grant counters unsigned Yousef Alhouseen
2026-07-01  7:52     ` Jürgen Groß
2026-06-26 22:38   ` [PATCH v2 2/2] xen/gntalloc: validate grant count before allocation Yousef Alhouseen
2026-07-01  7:53     ` Jürgen Groß [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=ea52ef38-8ad2-4b1f-af34-203f167242e5@suse.com \
    --to=jgross@suse.com \
    --cc=alhouseenyousef@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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

all inboxes | Powered by JetHome®