From: Greg KH <gregkh@linuxfoundation.org>
To: "Yang, Chenyuan" <cy54@illinois.edu>
Cc: "security@kernel.org" <security@kernel.org>,
"dm-devel@lists.linux.dev" <dm-devel@lists.linux.dev>,
"agk@redhat.com" <agk@redhat.com>,
"snitzer@kernel.org" <snitzer@kernel.org>,
"mpatocka@redhat.com" <mpatocka@redhat.com>,
"syzkaller@googlegroups.com" <syzkaller@googlegroups.com>,
"Zhang, Lingming" <lingming@illinois.edu>,
"Marinov, Darko" <marinov@illinois.edu>,
"Zhao, Zijie" <zijie4@illinois.edu>
Subject: Re: [LInux Kernel Crash] "WARNING: kmalloc bug in ctl_ioctl"
Date: Sat, 16 Dec 2023 08:36:22 +0100 [thread overview]
Message-ID: <2023121655-exporter-deed-6fcb@gregkh> (raw)
In-Reply-To: <PH7PR11MB576877FF72A9B2D43EAA1AEBA093A@PH7PR11MB5768.namprd11.prod.outlook.com>
On Fri, Dec 15, 2023 at 09:47:17PM +0000, Yang, Chenyuan wrote:
> Hello Linux Kernel community,
>
> We encountered a crash bug when testing the driver implemented in `drivers/md/dm-ioctl.c` by using Syzkaller. Notably, we generate the spec for this driver by ourselves and Syzkaller doesn’t have specification for it.
>
> Based on our understanding, this bug is caused by `dmi = kvmalloc(param_kernel->data_size, GFP_NOIO | __GFP_HIGH);` in ` drivers/md/dm-ioctl.c` (https://github.com/torvalds/linux/blob/3bd7d748816927202268cb335921f7f68b3ca723/drivers/md/dm-ioctl.c#L1966), which `kvmalloc` a size more than INT_MAX.
>
> A possible patch is to have a more strict check for the `param_kernel->data_size` in `copy_params` before calling `kvmalloc` while currently it only checks minimal size (https://github.com/torvalds/linux/blob/3bd7d748816927202268cb335921f7f68b3ca723/drivers/md/dm-ioctl.c#L1944).
Great, submit a patch based on this and see if it solves the issue you
reported!
thanks,
greg k-h
next prev parent reply other threads:[~2023-12-16 7:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 21:47 [LInux Kernel Crash] "WARNING: kmalloc bug in ctl_ioctl" Yang, Chenyuan
2023-12-16 7:36 ` Greg KH [this message]
2024-01-03 19:15 ` Mikulas Patocka
2024-01-03 19:21 ` Linus Torvalds
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=2023121655-exporter-deed-6fcb@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=agk@redhat.com \
--cc=cy54@illinois.edu \
--cc=dm-devel@lists.linux.dev \
--cc=lingming@illinois.edu \
--cc=marinov@illinois.edu \
--cc=mpatocka@redhat.com \
--cc=security@kernel.org \
--cc=snitzer@kernel.org \
--cc=syzkaller@googlegroups.com \
--cc=zijie4@illinois.edu \
/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.