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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 12 Nov 2019 14:23:11 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     David Miller <davem@...hat.com>
Cc:     olof@...om.net, f.fainelli@...il.com, hkallweit1@...il.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: mdio-octeon: Fix pointer/integer casts

On Mon, Nov 11, 2019 at 09:46:58PM -0800, David Miller wrote:
> From: Olof Johansson <olof@...om.net>
> Date: Sun, 10 Nov 2019 16:42:11 -0800
> 
> > -static inline void oct_mdio_writeq(u64 val, u64 addr)
> > +static inline void oct_mdio_writeq(u64 val, void __iomem *addr)
> >  {
> > -	cvmx_write_csr(addr, val);
> > +	cvmx_write_csr((u64)addr, val);
> >  }
> 
> I hate stuff like this, I think you really need to fix this from the bottom
> up or similar.  MMIO and such addresses are __iomem pointers, period.

Yes, i agree, but did not want to push the work to Olof. The point of
COMPILE_TEST is to find issues like this, code which should be
architecture independent, but is not. The cast just papers over the
cracks.

At a minimum, could we fix the stub cvmx_write_csr() used for
everything !MIPS. That should hopefully fix everything !MIPS, but
cause MIPS to start issuing warning. The MIPS folks can then cleanup
their code, which is really what is broken here.

      Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ