Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758242Ab1EZSfX (ORCPT ); Thu, 26 May 2011 14:35:23 -0400 Received: from mail.lang.hm ([64.81.33.126]:37966 "EHLO bifrost.lang.hm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753523Ab1EZSfW (ORCPT ); Thu, 26 May 2011 14:35:22 -0400 Date: Thu, 26 May 2011 11:34:16 -0700 (PDT) From: david@lang.hm X-X-Sender: dlang@asgard.lang.hm To: Linus Torvalds cc: Will Drewry , Colin Walters , Kees Cook , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Steven Rostedt , linux-kernel@vger.kernel.org, James Morris Subject: Re: [PATCH 3/5] v2 seccomp_filters: Enable ftrace-based system call filtering In-Reply-To: Message-ID: References: <1305807728.11267.25.camel@gandalf.stny.rr.com> <1306254027.18455.47.camel@twins> <20110524195435.GC27634@elte.hu> <20110525150153.GE29179@elte.hu> <20110525180100.GY19633@outflux.net> <20110525191152.GC19633@outflux.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 37 On Thu, 26 May 2011, Linus Torvalds wrote: > > On Thu, May 26, 2011 at 9:33 AM, Will Drewry 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. I believe that sendmail had this exact vunerability when capibilities were used to control setuid a couple of years ago. David Lang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/