lkml.org 
[lkml]   [2022]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net] net: fman: Use physical address for userspace interfaces
From
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.
>
> --Sean
>
> [1] https://lore.kernel.org/netdev/20220902215737.981341-1-sean.anderson@seco.com/T/#md5c6b66bc229c09062d205352a7d127c02b8d262

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.

Andrew

\
 
 \ /
  Last update: 2022-10-18 20:35    [W:0.090 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site