mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fernando Fernandez Mancera <fmancera@suse.de>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, cynthia@kosmx.dev, rafael@kernel.org,
	dakr@kernel.org, christian.brauner@ubuntu.com,
	edumazet@google.com, pabeni@redhat.com, davem@davemloft.net,
	horms@kernel.org
Subject: Re: [PATCH] sysfs: check visibility before changing group attribute ownership
Date: Fri, 17 Oct 2025 01:30:34 +0200	[thread overview]
Message-ID: <f4f5ac14-b110-4893-8014-81ba3a4170ba@suse.de> (raw)
In-Reply-To: <20251016083835.096c09e1@kernel.org>



On 10/16/25 5:38 PM, Jakub Kicinski wrote:
> On Thu, 16 Oct 2025 12:14:56 +0200 Fernando Fernandez Mancera wrote:
>> Since commit 0c17270f9b92 ("net: sysfs: Implement is_visible for
>> phys_(port_id, port_name, switch_id)"), __dev_change_net_namespace() can
>> hit WARN_ON() when trying to change owner of a file that isn't visible.
>> See the trace below:
> 
> Dunno much about sysfs but this is what I had in mind so FWIW:
> 
> Reviewed-by: Jakub Kicinski <kuba@kernel.org>
> 
> I'd be tempted to chuck:
> 
> Fixes: 0c17270f9b92 ("net: sysfs: Implement is_visible for phys_(port_id, port_name, switch_id)")
> 
> here as well. Or are we certain there are other callers that could have
> triggered this earlier?
> 

It is hard for me tell certainly. I am fine adding:

Fixes: 0c17270f9b92 ("net: sysfs: Implement is_visible for 
phys_(port_id, port_name, switch_id)")

but I would keep the current Fixes tag too. IMHO, given that visibility 
could return 0 for some attributes and > 0 for others in the same group, 
is up to sysfs to check the attribute visibility before updating the 
ownership of a whole group.. so this check should have been there since 
the beginning.

Anyway, I am not an expert on sysfs neither..

>> Reported-by: Cynthia <cynthia@kosmx.dev>
> 
> Perhaps:
> 
> Reported-and-bisected-by: ...
> 
Oh, sure, thanks! I am going to wait a bit to allow more feedback and 
send a v2.



      reply	other threads:[~2025-10-16 23:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 10:14 Fernando Fernandez Mancera
2025-10-16 14:46 ` Greg KH
2025-10-16 15:31   ` Cynthia
2025-10-16 23:17     ` Fernando Fernandez Mancera
2025-10-16 15:38 ` Jakub Kicinski
2025-10-16 23:30   ` Fernando Fernandez Mancera [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4f5ac14-b110-4893-8014-81ba3a4170ba@suse.de \
    --to=fmancera@suse.de \
    --cc=christian.brauner@ubuntu.com \
    --cc=cynthia@kosmx.dev \
    --cc=dakr@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®