Re: [PATCH] vduse: Fix a possible warning in vduse_create_dev()

2022-11-27 Thread Dan Carpenter
Btw, after you add the check to vduse_validate_config() you can test that it silences the Smatch warning by doing: kchecker --info drivers/vdpa/vdpa_user/vduse_dev.c | tee out ~/smatch/smatch_data/db/reload_partial.sh out kchecker drivers/vdpa/vdpa_user/vduse_dev.c You might need to do a second -

Re: [PATCH] vduse: Fix a possible warning in vduse_create_dev()

2022-11-27 Thread Michael S. Tsirkin
On Sun, Nov 27, 2022 at 08:16:24AM +0530, Harshit Mogalapalli wrote: > Hi Micheal, > > On 27/11/22 4:52 am, Michael S. Tsirkin wrote: > > On Fri, Nov 25, 2022 at 07:59:58PM -0800, Harshit Mogalapalli wrote: > > > As 'dev->vq_num' is user-controlled data, if user tries to allocate > > > memory larg

Re: [PATCH] vduse: Fix a possible warning in vduse_create_dev()

2022-11-26 Thread Michael S. Tsirkin
On Fri, Nov 25, 2022 at 07:59:58PM -0800, Harshit Mogalapalli wrote: > As 'dev->vq_num' is user-controlled data, if user tries to allocate > memory larger than(>=) MAX_ORDER, then kcalloc() will fail, it > creates a stack trace and messes up dmesg with a warning. > > Call trace: > -> vduse_ioctl >