Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 08 Dec 2011 14:34:47 +0800
From: Frank Kingswood <>
To: Linus Torvalds <>
CC: Kees Cook <>,
  Andrew Morton <>,
  Al Viro <>,,,,
  Randy Dunlap <>, Rik van Riel <>,
  Federica Teodori <>,
  Lucian Adrian Grijincu <>,
  Ingo Molnar <>, Peter Zijlstra <>,
  Eric Paris <>,
  Dan Rosenberg <>,
Subject: Re: [PATCH v2011.1] fs: symlink restrictions on sticky directories

On 08/12/11 02:41, Linus Torvalds wrote:
> On Tue, Dec 6, 2011 at 3:58 PM, Kees Cook<>  wrote:
>> A long-standing class of security issues is the symlink-based
>> time-of-check-time-of-use race, most commonly seen in world-writable
>> directories like /tmp.
> Ugh. I really dislike the implementation.
> Wouldn't it be much nicer to instead actually use the symlink
> protection fields, and make the rules be:
>   - creating a symlink as root does the traditional "lrwxrwxrwx" thing
>   - creating a symlink in a directory you own similarly does "lrwxrwxrwx"
>   - creating a symlink anywhere else (which implies either sticky or
> world-writable directory) does "lrwx------", so only you can use it.
> That seems to be much nicer semantics, and makes the protection
> *visible* instead of some kind of hacky run-time random behavior
> depending on some invisible config option that people aren't even
> aware of.

This sounds really good way to go about it, but it seems that an 
implementation might be invasive.

Currently the symlinks are created in the file system e.g. ext4_symlink 
has the S_IFLNK|S_IRWXUGO buried in it. It is likely other fs's follow 
this model too.

Also, having tried creating such a link, it seems that the read-side 
permissions check (at least in generic_readlink) is missing.

Frank A. Kingswood            
Cambridge, United Kingdom                               +44-7545-209 100

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.