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] [day] [month] [year] [list]
Message-ID: <CAK8P3a3dL3AJ31c7znroXH+hZaEJvxdqszxTU6D6Q2BgcV0Mog@mail.gmail.com>
Date:   Wed, 23 Feb 2022 13:59:29 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     kernel test robot <lkp@...el.com>
Cc:     Arnd Bergmann <arnd@...db.de>, kbuild-all@...ts.01.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
        linux-riscv <linux-riscv@...ts.infradead.org>
Subject: Re: include/linux/eventpoll.h:81:13: sparse: sparse: restricted
 __poll_t degrades to integer

On Wed, Feb 23, 2022 at 1:47 PM kernel test robot <lkp@...el.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   5c1ee569660d4a205dced9cb4d0306b907fb7599
> commit: 249dbe74d3c4b568a623fb55c56cddf19fdf0b89 ARM: 9108/1: oabi-compat: rework epoll_wait/epoll_pwait emulation
> date:   6 months ago
> config: riscv-randconfig-s031-20220221 (https://download.01.org/0day-ci/archive/20220223/202202231910.H30peLyl-lkp@intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 11.2.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.4-dirty
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=249dbe74d3c4b568a623fb55c56cddf19fdf0b89
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 249dbe74d3c4b568a623fb55c56cddf19fdf0b89
>         # save the config file to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash
>
> 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 >>)
>    fs/eventpoll.c: note: in included file:
> >> include/linux/eventpoll.h:81:13: sparse: sparse: restricted __poll_t degrades to integer
> >> include/linux/eventpoll.h:81:13: sparse: sparse: restricted __poll_t degrades to integer
>    include/linux/eventpoll.h:81:13: sparse: sparse: cast from restricted __poll_t

The code is only moved from one file to another, so I don't think this
adds a new sparse
warning but only changes the build log contents.

>     77  static inline struct epoll_event __user *
>     78  epoll_put_uevent(__poll_t revents, __u64 data,
>     79                   struct epoll_event __user *uevent)
>     80  {
>   > 81          if (__put_user(revents, &uevent->events) ||
>     82              __put_user(data, &uevent->data))
>     83                  return NULL;
>     84

I think the problem is the riscv __put_user() macro, this should not
warn when storing a __poll_t into a __user*__poll_t pointer.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ