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]
Date:   Thu, 5 May 2022 20:24:50 +0800
From:   Kent Gibson <warthog618@...il.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Yihao Han <hanyihao@...o.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        kernel@...o.com
Subject: Re: [PATCH] gpiolib: cdev: fix stream_open.cocci warnings

On Thu, May 05, 2022 at 02:18:48PM +0200, Bartosz Golaszewski wrote:
> On Thu, May 5, 2022 at 1:50 PM Yihao Han <hanyihao@...o.com> wrote:
> >
> > ./drivers/gpio/gpiolib-cdev.c:2498:7-23: WARNING:
> > gpio_fileops: .read() has stream semantic;
> > safe to change nonseekable_open -> stream_open.
> >
> > Generated by: scripts/coccinelle/api/stream_open.cocci
> >
> > Signed-off-by: Yihao Han <hanyihao@...o.com>
> > ---
> >  drivers/gpio/gpiolib-cdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
> > index f5aa5f93342a..d03c8e012c8c 100644
> > --- a/drivers/gpio/gpiolib-cdev.c
> > +++ b/drivers/gpio/gpiolib-cdev.c
> > @@ -2495,7 +2495,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
> >         get_device(&gdev->dev);
> >         file->private_data = cdev;
> >
> > -       ret = nonseekable_open(inode, file);
> > +       ret = stream_open(inode, file);
> >         if (ret)
> >                 goto out_unregister_notifier;
> >
> > --
> > 2.17.1
> >
> 
> Cc'ing Kent.
> 
> This patch doesn't seem to target current master or rc1.
> 
> It also can't be right - we specifically mark all filesystem objects
> exposed by the GPIO character device as non-seekable.
> 

Agreed.  I took the coccinelle warning as being a false positive.
If I recall correctly I had a quick look to see if it could be disabled,
but didn't find anything, and so just ignored it.

Cheers,
Kent.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ