Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751757AbdHAAsj (ORCPT ); Mon, 31 Jul 2017 20:48:39 -0400 Received: from namei.org ([65.99.196.166]:40603 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbdHAAsi (ORCPT ); Mon, 31 Jul 2017 20:48:38 -0400 Date: Tue, 1 Aug 2017 10:48:17 +1000 (AEST) From: James Morris To: Kees Cook cc: Andrew Morton , David Howells , "Eric W. Biederman" , John Johansen , "Serge E. Hallyn" , Paul Moore , Stephen Smalley , Casey Schaufler , Tetsuo Handa , James Morris , Andy Lutomirski , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 10/15] exec: Use secureexec for setting dumpability In-Reply-To: <1501545093-56634-11-git-send-email-keescook@chromium.org> Message-ID: References: <1501545093-56634-1-git-send-email-keescook@chromium.org> <1501545093-56634-11-git-send-email-keescook@chromium.org> User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1277 Lines: 31 On Mon, 31 Jul 2017, Kees Cook wrote: > The examination of "current" to decide dumpability is wrong. This was a > check of and euid/uid (or egid/gid) mismatch in the existing process, > not the newly created one. This appears to stretch back into even the > "history.git" tree. Luckily, dumpability is later set in commit_creds(). > In earlier kernel versions before creds existed, similar checks also > existed late in the exec flow, covering up the mistake as far back as I > could find. > > Note that because the commit_creds() check examines differences of euid, > uid, egid, gid, and capabilities between the old and new creds, it would > look like the setup_new_exec() dumpability test could be entirely removed. > However, the secureexec test may cover a different set of tests (specific > to the LSMs) than what commit_creds() checks for. So, fix this test to > use secureexec (the removed euid tests are redundant to the commoncap > secureexec checks now). > > Cc: David Howells > Signed-off-by: Kees Cook > Acked-by: Serge Hallyn > --- > fs/exec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: James Morris -- James Morris