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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sat, 4 Jun 2011 23:23:45 +0100
From:	Al Viro <>
To:	Linus Torvalds <>
Cc:	"Eric W. Biederman" <>,,
Subject: Re: [RFC] breakage in sysfs_readdir() and s_instances abuse in sysfs

On Sun, Jun 05, 2011 at 06:55:12AM +0900, Linus Torvalds wrote:
> On Sun, Jun 5, 2011 at 6:22 AM, Al Viro <> wrote:
> >
> > Are you OK with the sketch above? ?I can probably cook a patch along those
> > lines by tomorrow...
> I'm ok with the sketch, but might think otherwise when actually seeing
> the patch. And I wish some namespace person would look at this issue.
> And the networking people would seem to need to be aware of it too,
> but you've only cc'd fsdevel, so they are entirely unaware of the
> whole thread..

Eh...  The question had been to Eric, unless that pile is actually yours...
netdev Cc'd, and I'll forward the previous posting there in a few.

FWIW, reproducing that is trivial: on a box with netns enabled:

dizzy:~# unshare -n -- sh -c "mount -t sysfs none /mnt; ls -l /mnt/class/net; ls
 -l /mnt/class/net/eth0"                                                        
[ 1301.429755] IPv4 FIB: Using LC-trie version 0.409                            
total 0                                                                         
lrwxrwxrwx 1 root root 0 Jun  4 18:16 lo -> ../../devices/virtual/net/lo        
lrwxrwxrwx 1 root root 0 Jun  4 18:16 sit0 -> ../../devices/virtual/net/sit0    
ls: cannot access /mnt/class/net/eth0: No such file or directory                
dizzy:~# ls -l /mnt/class/net/; ls -l /mnt/class/net/eth0                       
total 0                                                                         
lrwxrwxrwx 1 root root 0 Jun  4 18:17 /mnt/class/net/eth0 -> ../../devices/pci00

IOW, while netns is alive we get sane behaviour - lookup for class/net/eth0
fails, since there's no such object in that netns.  Once it's gone, we get
class/net in that sysfs instance empty on readdir *and* lookup for
class/net/eth0 succeeds giving us an object from another netns.

Apologies for not adding netdev - it started as sysfs-internal race, so the
beginning of that thread went to fsdevel...
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists