Re: Opening symlinks in tmpfs as root fails!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Mohammad_AlSaleh <ce.mohammad.alsaleh@xxxxxxxxx> on Tue, 2014/12/30 14:36:
> Hello.
> 
> I just came across some weird behavior.
> 
> A small testcase:
> 
> cd /tmp # should be tmpfs
> touch tfile
> ln -s tfile tlink
> cat tlink
> 
> When cat executes, it returns with success(0). But, if cat is executed
> as root, it fails with a permission denied error.
> 
> What's really happening is, the open() syscall fails with EACCESS when
> the file is a symlink in a tmpfs-mounted dir. But only fails when run
> as root!
> 
> I'm assuming this is a bug. Can anyone confirm it?

This is expected as /tmp has the sticky bit set.

https://wiki.ubuntu.com/Security/Features#Symlink_restrictions
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}

Attachment: pgpsu6YPrkC5G.pgp
Description: OpenPGP digital signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux