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:   Wed, 19 Oct 2022 05:20:50 +0000
From:   Madalin Bucur <madalin.bucur@....com>
To:     Sean Anderson <sean.anderson@...o.com>,
        Andrew Lunn <andrew@...n.ch>, Andrew Davis <afd@...com>
CC:     "David S . Miller" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Camelia Alexandra Groza <camelia.groza@....com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: RE: [PATCH net] net: fman: Use physical address for userspace
 interfaces

> -----Original Message-----
> From: Sean Anderson <sean.anderson@...o.com>
> Sent: 19 October 2022 00:47
> To: Andrew Lunn <andrew@...n.ch>; Andrew Davis <afd@...com>
> Cc: David S . Miller <davem@...emloft.net>; netdev@...r.kernel.org;
> linux-kernel@...r.kernel.org; Madalin Bucur <madalin.bucur@....com>;
> Jakub Kicinski <kuba@...nel.org>; Eric Dumazet <edumazet@...gle.com>;
> Paolo Abeni <pabeni@...hat.com>; Camelia Alexandra Groza
> <camelia.groza@....com>; Geert Uytterhoeven <geert@...ux-m68k.org>
> Subject: Re: [PATCH net] net: fman: Use physical address for userspace
> interfaces
> 
> 
> 
> On 10/18/22 5:39 PM, Andrew Lunn wrote:
> > On Tue, Oct 18, 2022 at 01:33:55PM -0500, Andrew Davis wrote:
> >> On 10/18/22 12:37 PM, Sean Anderson wrote:
> >> > Hi Andrew,
> >> >
> >> > On 10/18/22 1:22 PM, Andrew Lunn wrote:
> >> > > On Mon, Oct 17, 2022 at 12:28:06PM -0400, Sean Anderson wrote:
> >> > > > For whatever reason, the address of the MAC is exposed to
> userspace in
> >> > > > several places. We need to use the physical address for this
> purpose to
> >> > > > avoid leaking information about the kernel's memory layout, and
> to keep
> >> > > > backwards compatibility.
> >> > >
> >> > > How does this keep backwards compatibility? Whatever is in user
> space
> >> > > using this virtual address expects a virtual address. If it now
> gets a
> >> > > physical address it will probably do the wrong thing. Unless there
> is
> >> > > a one to one mapping, and you are exposing virtual addresses
> anyway.
> >> > >
> >> > > If you are going to break backwards compatibility Maybe it would
> be
> >> > > better to return 0xdeadbeef? Or 0?
> >> > >
> >> > >         Andrew
> >> > >
> >> >
> >> > The fixed commit was added in v6.1-rc1 and switched from physical to
> >> > virtual. So this is effectively a partial revert to the previous
> >> > behavior (but keeping the other changes). See [1] for discussion.
> >
> > Please don't assume a reviewer has seen the previous
> > discussion. Include the background in the commit message to help such
> > reviewers.
> >
> >> >
> >> > --Sean
> >> >
> >> > [1]
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.ke
> rnel.org%2Fnetdev%2F20220902215737.981341-1-
> sean.anderson%40seco.com%2FT%2F%23md5c6b66bc229c09062d205352a7d127c02b8d2
> 62&amp;data=05%7C01%7Cmadalin.bucur%40nxp.com%7Cb35d8b37f9224e4b793408dab
> 1525b5a%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638017264524356126%7
> CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haW
> wiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2BcoXaNNlcqzKLsGC5WKuk8Mwette
> D51cCbzJvHfG7Vs%3D&amp;reserved=0
> >>
> >> I see it asked in that thread, but not answered. Why are you exposing
> >> "physical" addresses to userspace? There should be no reason for that.
> >
> > I don't see anything about needing physical or virtual address in the
> > discussion, or i've missed it.
> 
> Well, Madalin originally added this, so perhaps she has some insight.
> 
> I have no idea why we set the IFMAP stuff, since that seems like it's for
> PCMCIA. Not sure about sysfs either.
> 
> > If nobody knows why it is needed, either use an obfusticated value, or
> > remove it all together. If somebody/something does need it, they will
> > report the regression.
> 
> I'd rather apply this (or v2 of this) and then remove the "feature" in
> follow-up.
> 
> --Sean


root@...alhost:~# grep 1ae /etc/udev/rules.d/72-fsl-dpaa-persistent-networking.rules
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae0000", NAME="fm1-mac1"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae2000", NAME="fm1-mac2"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae4000", NAME="fm1-mac3"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae6000", NAME="fm1-mac4"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae8000", NAME="fm1-mac5"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1aea000", NAME="fm1-mac6"

root@...alhost:~# grep 1ae  /sys/devices/platform/soc/soc:fsl,dpaa/soc:fsl,dpaa:ethernet@...et/fm1-mac*/device_addr
/sys/devices/platform/soc/soc:fsl,dpaa/soc:fsl,dpaa:ethernet@...et/fm1-mac3/device_addr:1ae4000
/sys/devices/platform/soc/soc:fsl,dpaa/soc:fsl,dpaa:ethernet@...et/fm1-mac4/device_addr:1ae6000
/sys/devices/platform/soc/soc:fsl,dpaa/soc:fsl,dpaa:ethernet@...et/fm1-mac5/device_addr:1ae8000
/sys/devices/platform/soc/soc:fsl,dpaa/soc:fsl,dpaa:ethernet@...et/fm1-mac6/device_addr:1aea000


Have a great day!

Madalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ