Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751966AbcKQXRc (ORCPT ); Thu, 17 Nov 2016 18:17:32 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36186 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbcKQXR3 (ORCPT ); Thu, 17 Nov 2016 18:17:29 -0500 MIME-Version: 1.0 In-Reply-To: <87shqpzpok.fsf_-_@xmission.com> References: <20161019172917.GE1210@laptop.thejh.net> <87pomwi5p2.fsf@xmission.com> <87pomwghda.fsf@xmission.com> <87twb6avk8.fsf_-_@xmission.com> <87inrmavax.fsf_-_@xmission.com> <20161117204707.GB10421@1wt.eu> <20161117213258.GA10839@1wt.eu> <874m3522sy.fsf@xmission.com> <87shqpzpok.fsf_-_@xmission.com> From: Kees Cook Date: Thu, 17 Nov 2016 15:17:27 -0800 X-Google-Sender-Auth: fW0rAcsAfOA67OuzBwqvgaD_iVs Message-ID: Subject: Re: [REVIEW][PATCH 2/3] ptrace: Don't allow accessing an undumpable mm To: "Eric W. Biederman" Cc: Willy Tarreau , Linux Containers , Oleg Nesterov , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Linux FS Devel , Michal Hocko , Jann Horn , Andy Lutomirski 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: 644 Lines: 20 On Thu, Nov 17, 2016 at 2:50 PM, Eric W. Biederman wrote: > > It is the reasonable expectation that if an executable file is not > readable there will be no way for a user without special privileges to > read the file. This is enforced in ptrace_attach but if ptrace > is already attached before exec there is no enforcement for read-only > executables. Given the corner cases being fixed here, it might make sense to add some simple tests to tools/testing/sefltests/ptrace/ to validate these changes and avoid future regressions. Regardless, it'll be nice to have this fixed. :) -Kees -- Kees Cook Nexus Security