lkml.org 
[lkml]   [2021]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] drivers/misc/vmw_vmci: restrict too big queue size in
On Tue, Feb 09, 2021 at 03:45:25PM +0600, Sabyrzhan Tasbolatov wrote:
> > syzbot found WARNING in qp_broker_alloc[1] in qp_host_alloc_queue()
> > when num_pages is 0x100001, giving queue_size + queue_page_size
> > bigger than KMALLOC_MAX_SIZE for kzalloc(), resulting order >= MAX_ORDER
> > condition.
> >
> > queue_size + queue_page_size=0x8000d8, where KMALLOC_MAX_SIZE=0x400000.
> >

Why is this "quoted"?

> Reported-by: syzbot+15ec7391f3d6a1a7cc7d@syzkaller.appspotmail.com
> Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
> > ---
> >>> As this is controllable by userspace, you just provided a way to flood
> >>> the kernel logs.
> >>>
> >>> Please make this a dev_dbg() call instead, if you really want to see it.
> >>> Otherwise just return NULL, no need to report anything, right?
> >> Thanks, removed pr_warn().
>
> >Looks like you forgot to take out the opening brace.
>
> Cringe moment. Sorry, should've checked it properly first.
>
> v3: Removed opening brace.
> ---
> drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c
> index ea16df73cde0..024dcdbd9d01 100644
> --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c
> +++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c
> @@ -537,7 +537,7 @@ static struct vmci_queue *qp_host_alloc_queue(u64 size)
>
> queue_page_size = num_pages * sizeof(*queue->kernel_if->u.h.page);
>
> - if (queue_size + queue_page_size > KMALLOC_MAX_SIZE) {
> + if (queue_size + queue_page_size > KMALLOC_MAX_SIZE)
> return NULL;

This patch does not apply to the tree...

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-02-09 11:00    [W:0.092 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site