Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965065AbdLSATx (ORCPT ); Mon, 18 Dec 2017 19:19:53 -0500 Received: from mail-vk0-f51.google.com ([209.85.213.51]:34636 "EHLO mail-vk0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935074AbdLSATu (ORCPT ); Mon, 18 Dec 2017 19:19:50 -0500 X-Google-Smtp-Source: ACJfBouIz3KG3XtgX8ZrHSPuBI1j/hlHK+rXq/7+znY+wuzsqJMXxCNUwlc1H0Q85IgGgZScIwH6WXBVPME0wgujulU= MIME-Version: 1.0 In-Reply-To: <87300dbc-6c72-7b2e-f5e3-3b33a811fcfa@redhat.com> References: <87300dbc-6c72-7b2e-f5e3-3b33a811fcfa@redhat.com> From: Kees Cook Date: Mon, 18 Dec 2017 16:19:48 -0800 X-Google-Sender-Auth: vnwYLgQRpqCOUnDvwEruujfXwuk Message-ID: Subject: Re: Coredump regression with e37fdb785a5f ("exec: Use secureexec for setting dumpability") To: Laura Abbott Cc: David Howells , Serge Hallyn , James Morris , Linux Kernel Mailing List , Thorsten Leemhuis , Martin Pitt Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1970 Lines: 48 On Mon, Dec 18, 2017 at 3:17 PM, Laura Abbott wrote: > Hi, > > Fedora got a bug report https://bugzilla.redhat.com/show_bug.cgi?id=1525974 > of coredumps failing for systemd units. If systemd units segfault, no > core is produced. > > commit e37fdb785a5f95ecadf43b773c97f676500ac7b8 (refs/bisect/bad) > Author: Kees Cook > Date: Tue Jul 18 15:25:31 2017 -0700 > > exec: Use secureexec for setting dumpability > 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 > Reviewed-by: James Morris > > > This was still broken as of -rc3 although interestingly enough this worked > on my rawhide system. Any ideas? Hmmm, interesting. So dumpability can't follow secureexec -- that seems like a bad state since secureexec represents a process with privilege... -Kees -- Kees Cook Pixel Security