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: <CACRpkdYGMToSn1XR0Zrvv3yKeOX7_tw0=y0NKhOXN7O8KL-Ntg@mail.gmail.com>
Date:   Sun, 18 Sep 2022 16:33:33 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     kernel test robot <lkp@...el.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Leon Romanovsky <leon@...nel.org>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [linux-stable-rc:linux-5.4.y 5364/5387] drivers/infiniband/sw/siw/siw_qp_tx.c:32:37:
 warning: cast to pointer from integer of different size

On Fri, Sep 16, 2022 at 8:19 PM kernel test robot <lkp@...el.com> wrote:

> commit: e7f78835d551bb2deb5aa3346d84c8f03ade313d [5364/5387] RDMA/siw: Pass a pointer to virt_to_page()
> config: riscv-randconfig-r013-20220916 (https://download.01.org/0day-ci/archive/20220917/202209170232.grVMomkJ-lkp@intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 12.1.0

So if RISCV32 ...

>     31          if (paddr)
>   > 32                  return virt_to_page((void *)paddr);

Think that passing a (void *) to virt_to_page() is a problem:

> warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>       32 |                 return virt_to_page((void *)paddr);

I would think this is a problem with RISCV32.

What has this arch done?

This is a few lines up:

> dma_addr_t paddr = siw_pbl_get_buffer(pbl, offset, NULL, idx);

dma_addr_t is a different size than (void *)?

Given that the patch raising this problem looked like this:

-               return virt_to_page(paddr);
+               return virt_to_page((void *)paddr);

I doubt that it has created a bug that wasn't there before. Passing
a dma_addr_t to virt_to_page() might be wrong, but that is what the
driver has been doing all the time.

siw_pbl_get_buffer() claims to
"Gets physical address backed by PBL element."
Why is that even passed to virt_to_page() if it's no virtual address
but a dma_addr_t to begin with?

I certainly don't understand SIW, but this bug, if it is a bug (or a type and
documentation bug) is clearly not new.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ