News for hackers. Stuff that matters.
Re:What Are Capabilities? by loeg on Sunday January 07, 2018 @08:58PM (#16094087)
One interesting application of the idea of capabilities to an existing POSIX system is FreeBSD's Capsicum. (There is also a Linux port of Capsicum, but it has not been integrated into Torvalds' tree.)

In Capsicum, capabilities are tracked on a per file descriptor basis. A typical program opens any input paths, restricts capabilities on open fds (including stdio), and then enters sandbox mode.

Once the capability mode sandbox is entered, no additional capabilities can be granted, and filesystem access via absolute paths is revoked. (Sandbox mode programs are expected to access files they already have open, or to use relative accesses to walk file trees.)

Erroneous system calls generate ECAPMODE or ENOTCAPABLE errors if they attempt to perform actions they do not have permission to do.

Re:What Are Capabilities? by Majora320 on Monday January 08, 2018 @02:28AM (#16095212)
What prevents a Sandbox mode program from just using a chain of `··`s to access the root?
Re:What Are Capabilities? by loeg on Monday January 08, 2018 @01:20PM (#16098612)
Access to ".." above the "root" of a given dirfd are disallowed in the sandbox.

So for example, if you have an open dirfd with the LOOKUP capability when you enter the sandbox, you can access the following relative paths:

".", "./foo/bar", "./foo/.."

But you cannot access these relative paths:

"..", "./foo/../..", etc.

Re:What Are Capabilities? by ithkuil on Monday January 08, 2018 @03:22AM (#16095398)
IIRC openat(2) honours the sandboxing rules