Re: [PATCH 3/5] v2 seccomp_filters: Enable ftrace-based system call filtering

From: Linus Torvalds
Date: Thu May 26 2011 - 12:54:18 EST


On Thu, May 26, 2011 at 9:33 AM, Will Drewry <wad@xxxxxxxxxxxx> wrote:
>
> FWIW, none of the patches deal with privilege escalation via setuid
> files or file capabilities.

That is NOT AT ALL what I'm talking about.

I'm talking about the "setuid()" system call (and all its cousins:
setgit/setreuid etc). And the whole thread has been about filtering
system calls, no?

Do a google code search for setuid.

In good code, it will look something like

uid = getuid();

if (setuid(uid)) {
fprintf(stderr, "Unable to drop provileges\n");
exit(1);
}

but I guarantee you that there are cases where people just blindly
drop privileges. google code search found me at least the "heirloom"
source code doing exactly that.

And if you filter system calls, it's entirely possible that you can
attack suid executables through such a vector. Your "limit system
calls for security" security suddenly turned into "avoid the system
call that made things secure"!

See what I'm saying?

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/