[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2165e4a3-a717-f715-f7c3-e520d45ec21c@intel.com>
Date: Mon, 2 Oct 2023 15:52:44 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Andrew Kanner <andrew.kanner@...il.com>
CC: <bjorn@...nel.org>, <magnus.karlsson@...el.com>,
<maciej.fijalkowski@...el.com>, <jonathan.lemon@...il.com>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <xuanzhuo@...ux.alibaba.com>,
<linux-kernel-mentees@...ts.linuxfoundation.org>, <netdev@...r.kernel.org>,
<bpf@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<syzbot+fae676d3cf469331fc89@...kaller.appspotmail.com>
Subject: Re: [PATCH net-next v1] net/xdp: fix zero-size allocation warning in
xskq_create()
From: Andrew Kanner <andrew.kanner@...il.com>
Date: Thu, 28 Sep 2023 23:44:40 +0300
> Syzkaller reported the following issue:
[...]
> PS: the initial number of entries is 0x20000000 in syzkaller repro:
> syscall(__NR_setsockopt, (intptr_t)r[0], 0x11b, 3, 0x20000040, 0x20);
>
> Link: https://syzkaller.appspot.com/text?tag=ReproC&x=10910f18280000
>
> net/xdp/xsk_queue.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/xdp/xsk_queue.c b/net/xdp/xsk_queue.c
> index f8905400ee07..1bc7fb1f14ae 100644
> --- a/net/xdp/xsk_queue.c
> +++ b/net/xdp/xsk_queue.c
> @@ -34,6 +34,9 @@ struct xsk_queue *xskq_create(u32 nentries, bool umem_queue)
> q->ring_mask = nentries - 1;
>
> size = xskq_get_ring_size(q, umem_queue);
> + if (size == SIZE_MAX)
unlikely().
> + return NULL;
> +
> size = PAGE_ALIGN(size);
>
> q->ring = vmalloc_user(size);
Thanks,
Olek
Powered by blists - more mailing lists