LWN.net Logo

Anatomy of a user namespaces vulnerability

Anatomy of a user namespaces vulnerability

Posted Mar 24, 2013 16:38 UTC (Sun) by meyert (subscriber, #32097)
Parent article: Anatomy of a user namespaces vulnerability

So, why isn't this set to "enabled" on current Fedora 18?

# cat /proc/sys/fs/protected_hardlinks
0

Where to enable this option permanently?


(Log in to post comments)

Anatomy of a user namespaces vulnerability

Posted Mar 24, 2013 16:40 UTC (Sun) by meyert (subscriber, #32097) [Link]

Is there actually a list of options that better where enabled in Fedora, from a security point of view? like this other one I know about:
https://fedoraproject.org/wiki/Features/SELinuxDenyPtrace

Anatomy of a user namespaces vulnerability

Posted Mar 24, 2013 17:47 UTC (Sun) by rahulsundaram (subscriber, #21946) [Link]

It is enabled in Fedora 19 by default and I am not sure there is a list of options documented that can be enabled in general. If they were, they probably would be there by default anyway.

Setting protected *links

Posted Apr 2, 2013 6:23 UTC (Tue) by Duncan (guest, #6647) [Link]

> # cat /proc/sys/fs/protected_hardlinks
> 0
>
> Where to enable this option permanently?

Assuming fedora has the common sysctrl initscript/unitfile, along with the associated /etc/sysctrl.d/* and/or /etc/syctrl.conf, you'd set it there (omitting the /proc/sys bit as that's the normal working dir for this unit/script).

As I follow upstream kernel development reasonably closely on both LWN and independently (running a custom configured Linus git kernel), I saw the feature introduced for kernel 3.7, and added entries to my sysctrl.conf file appropriately (JED are my initials, used to distinguish my own modifications, $>> is the non-root version of the last line of my custom-set $PS1 bash prompt (#>> would indicate root, appearing as green on red so there's no mistaking it):

$>>grep protected /etc/sysctl.conf
# JED: protected sticky/tempdir symlinks/hardlinks (kernel 3.7+)
fs.protected_symlinks = 1
fs.protected_hardlinks = 1

Duncan

Setting protected *links

Posted Apr 5, 2013 21:11 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

You could also drop a file in /etc/sysctl.d/99-jed.conf file instead of conflicting with package manager-controlled files.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds