From: sashiko-bot@kernel.org
To: "Val Packett" <val@invisiblethingslab.com>
Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org
Subject: Re: [PATCH v2 2/2] udmabuf: Increase the default list length limit
Date: Wed, 21 Oct 2026 08:49:58 +0000 [thread overview]
Message-ID: <sashiko-outbox-179989@kernel.org> (raw)
In-Reply-To: <20261021083933.1983894-3-val@invisiblethingslab.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] udmabuf: order-10 contiguous allocation in udmabuf_ioctl_create_list()
- [Low] udmabuf: missing kernel-parameters.txt update for list_limit parameter
--
commit 70d859f4b270b1a12dc2cb5cc01faf794efe4700
Author: Val Packett <val@invisiblethingslab.com>
udmabuf: Increase the default list length limit
This commit increases the default list_limit module parameter in
drivers/dma-buf/udmabuf.c from 1024 to 131072 to support larger page lists
for fragmented guest memory buffers.
> diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
> index 6fb69d8399c18..9aec0e3a1e49b 100644
> --- a/drivers/dma-buf/udmabuf.c
> +++ b/drivers/dma-buf/udmabuf.c
> @@ -16,9 +16,9 @@
> #include <linux/vmalloc.h>
> #include <linux/iosys-map.h>
>
> -static int list_limit = 1024;
> +static int list_limit = 131072;
[Severity: Medium]
With list_limit raised to 131072, udmabuf_ioctl_create_list() in
drivers/dma-buf/udmabuf.c copies the user item array using
memdup_array_user():
if (head.count > list_limit)
return -EINVAL;
list = memdup_array_user((void __user *)(arg + sizeof(head)),
head.count, sizeof(struct udmabuf_create_item));
if (IS_ERR(list))
return PTR_ERR(list);
ret = udmabuf_create(filp->private_data, &head, list);
kfree(list);
which calls memdup_user() in mm/util.c:
p = kmem_buckets_alloc_track_caller(user_buckets, len, GFP_USER | __GFP_NOWARN);
if (!p)
return ERR_PTR(-ENOMEM);
Each struct udmabuf_create_item is 24 bytes, so a head.count of 80,000 to
131,072 entries requests roughly 1.83 MiB to 3 MiB (order 9 to order 10 on
4 KiB page systems).
Because memdup_array_user() -> memdup_user() ->
kmem_buckets_alloc_track_caller() allocates physically contiguous memory
without a vmalloc fallback, could this fail with -ENOMEM or stall in direct
compaction on hosts with fragmented physical memory (or fail unconditionally
when the maximum page allocation order is less than 10)?
Should udmabuf_ioctl_create_list() use vmemdup_array_user() and kvfree() for
list instead?
> module_param(list_limit, int, 0644);
> -MODULE_PARM_DESC(list_limit, "udmabuf_create_list->count limit. Default is 1024.");
> +MODULE_PARM_DESC(list_limit, "udmabuf_create_list->count limit. Default is 131072.");
[Severity: Low]
Since list_limit in drivers/dma-buf/udmabuf.c is exposed as a kernel
command-line parameter via module_param(list_limit, int, 0644) (as
udmabuf.list_limit), should Documentation/admin-guide/kernel-parameters.txt
also be updated to document this parameter and its new default?
>
> static int size_limit_mb = INT_MAX;
> module_param(size_limit_mb, int, 0644);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261021083933.1983894-1-val@invisiblethingslab.com?part=2
prev parent reply other threads:[~2026-10-21 8:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 8:39 [PATCH v2 0/2] udmabuf: Improve list length limit handling Val Packett
2026-10-21 8:39 ` [PATCH v2 1/2] udmabuf: Fix list length overflow check Val Packett
2026-10-21 8:39 ` [PATCH v2 2/2] udmabuf: Increase the default list length limit Val Packett
2026-10-21 8:49 ` 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-179989@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=media-ci@linuxtv.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=val@invisiblethingslab.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.