lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5b4d6d49-8d11-9026-ffe2-3f18615d1ffc@roeck-us.net>
Date:   Tue, 1 Sep 2020 09:58:50 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     kernel test robot <lkp@...el.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:     kbuild-all@...ts.01.org,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-media@...r.kernel.org, Sakari Ailus <sakari.ailus@....fi>,
        linux-uvc-devel@...ts.sourceforge.net, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Alan Stern <stern@...land.harvard.edu>,
        Hans Verkuil <hverkuil@...all.nl>
Subject: Re: [PATCH 4/5] media: uvcvideo: Protect uvc queue file operations
 against disconnect

On 9/1/20 9:51 AM, kernel test robot wrote:
> Hi Guenter,
> 
> I love your patch! Perhaps something to improve:
> 
> [auto build test WARNING on linuxtv-media/master]
> [also build test WARNING on v5.9-rc3 next-20200828]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/Guenter-Roeck/media-uvcvideo-Fix-race-conditions/20200830-230715
> base:   git://linuxtv.org/media_tree.git master
> config: x86_64-randconfig-s031-20200901 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce:
>         # apt-get install sparse
>         # sparse version: v0.6.2-191-g10164920-dirty
>         # save the attached .config to linux build tree
>         make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
>>> drivers/media/usb/uvc/uvc_queue.c:402:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __poll_t [usertype] ret @@     got int @@
>>> drivers/media/usb/uvc/uvc_queue.c:402:21: sparse:     expected restricted __poll_t [usertype] ret
>>> drivers/media/usb/uvc/uvc_queue.c:402:21: sparse:     got int
> 
> # https://github.com/0day-ci/linux/commit/9128827e77bc077a6fefd3ca886a8466e84f7154
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review Guenter-Roeck/media-uvcvideo-Fix-race-conditions/20200830-230715
> git checkout 9128827e77bc077a6fefd3ca886a8466e84f7154
> vim +402 drivers/media/usb/uvc/uvc_queue.c
> 
>    393	
>    394	__poll_t uvc_queue_poll(struct uvc_video_queue *queue, struct file *file,
>    395				    poll_table *wait)
>    396	{
>    397		struct uvc_streaming *stream = uvc_queue_to_stream(queue);
>    398		__poll_t ret;
>    399	
>    400		mutex_lock(&queue->mutex);
>    401		if (!video_is_registered(&stream->vdev)) {
>  > 402			ret = -ENODEV;

Looks like this has to return EPOLLERR. I'll make that change in v2.

Guenter

>    403			goto unlock;
>    404		}
>    405		ret = vb2_poll(&queue->queue, file, wait);
>    406	unlock:
>    407		mutex_unlock(&queue->mutex);
>    408	
>    409		return ret;
>    410	}
>    411	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ