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: <CAMpxmJU568mCzEo1MShA7rgp1bWh_3j44hQw3oMWggczj31f8w@mail.gmail.com>
Date:   Mon, 8 Feb 2021 06:58:50 +0100
From:   Bartosz Golaszewski <bgolaszewski@...libre.com>
To:     Yang Li <yang.lee@...ux.alibaba.com>,
        Kent Gibson <warthog618@...il.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        linux-gpio <linux-gpio@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpiolib: cdev: convert stream-like files from

On Sun, Feb 7, 2021 at 10:00 AM Yang Li <yang.lee@...ux.alibaba.com> wrote:
>
> Eliminate the following coccicheck warning:
> ./drivers/gpio/gpiolib-cdev.c:2307:7-23: WARNING: gpio_fileops: .read()
> has stream semantic; safe to change nonseekable_open -> stream_open.
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@...ux.alibaba.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 1631727..bad68ef 100644
> --- a/drivers/gpio/gpiolib-cdev.c
> +++ b/drivers/gpio/gpiolib-cdev.c
> @@ -2304,7 +2304,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;
>
> --
> 1.8.3.1
>

I think you have a false positive here - we don't even take the offset
argument into account so I don't see how the line_watch_read callback
could be interpreted as seekable.

Bart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ