Skip to contentSkip to conversation

symlinks under /tmp

DISCUSSION Russell Coker 1 participant 1 message Aug 2, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

In the past there have been numerous security problems due to hostile users creating symlinks under /tmp pointing to important files such as /etc/shadow. They have included tricks for programs running as root that blindly use a fixed name for a tmp file, and race conditions for programs that are slightly better written.

To solve this OpenWall prohibits the creation of symlinks under /tmp pointing to files you don't own.

SE Linux doesn't work that way so we need a different solution to this problem. I have experimented with removing the sysadmfile attribute from user_tmp_t and then giving the sysadm_t domain access to do everything to directories and files that have the tmpfile attribute but to do everything but read lnk_file objects with that attribute.

This works but prevents "ls -l" from displaying the target of the link.

I am now thinking of creating a sysadm_ls_t domain that can read all lnk_file objects, getattr on everything, and search every directory (but write nothing).

What do you think?

Also I noticed that the patch to ls doesn't use lstat_secure() so the operation of "ls --context symlink" is vastly different from "ls -l symlink".
I'll change that in my tree.

Signature · 3 lines
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line

From field.

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.