From: sashiko-bot@kernel.org
To: "Hu Xinyao" <huxinyao@kylinsec.com.cn>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] accel/rocket: Reject zero-sized BOs in rocket_ioctl_create_bo()
Date: Mon, 30 Nov 2026 03:09:17 +0000 [thread overview]
Message-ID: <sashiko-outbox-240289@kernel.org> (raw)
In-Reply-To: <89ABE9BE453F2F3D+1796007386.199131-1-huxinyao@kylinsec.com.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] accel/rocket: inaccurate commit message on zero-size BO
failure path
--
commit 16a770184fb1378b86d900df5443b48c32c09ac4
Author: Hu Xinyao <huxinyao@kylinsec.com.cn>
accel/rocket: Reject zero-sized BOs in rocket_ioctl_create_bo()
This commit rejects zero-sized buffer objects in rocket_ioctl_create_bo()
with -EINVAL before calling drm_gem_shmem_create().
> rocket_ioctl_create_bo() passes args->size directly to
> drm_gem_shmem_create() and drm_gem_shmem_get_pages_sgt(). When
> args->size is zero, drm_gem_get_pages() allocates a zero-element page
> array (ZERO_SIZE_PTR), and drm_gem_shmem_get_sg_table() calls
> sg_alloc_append_table_from_pages() with n_pages == 0, which initializes
> chunks = 1 and dereferences pages[0].
[Severity: Medium]
Is the commit message accurate about how a zero-sized request fails?
When args->size is 0, drm_gem_shmem_create() calls __drm_gem_shmem_init()
-> drm_gem_create_mmap_offset() -> drm_vma_offset_add() ->
drm_mm_insert_node_in_range() with size == 0, which rejects the 0-page
VMA offset allocation and returns -ENOSPC. rocket_ioctl_create_bo()
returns ERR_PTR(-ENOSPC) from drm_gem_shmem_create() without reaching
drm_gem_shmem_get_pages_sgt(). The patch changes the return value from
-ENOSPC to -EINVAL and avoids allocating and releasing a zero-length
shmem object.
--
Sashiko AI review · https://sashiko.dev/#/patchset/89ABE9BE453F2F3D+1796007386.199131-1-huxinyao@kylinsec.com.cn?part=1
prev parent reply other threads:[~2026-11-30 3:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 2:56 [PATCH] accel/rocket: Reject zero-sized BOs in rocket_ioctl_create_bo() Hu Xinyao
2026-11-30 3:09 ` sashiko-bot [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=sashiko-outbox-240289@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=huxinyao@kylinsec.com.cn \
--cc=sashiko-reviews@lists.linux.dev \
/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.