Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2581595yba; Fri, 10 May 2019 14:23:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgur/DanuK58pGs1Mh4k4RJ7Fkp5WDjz5rtwcRAOA6TfJF4IcObBmF/y4AB1KQNTJ8ZvXb X-Received: by 2002:a63:4342:: with SMTP id q63mr16198804pga.435.1557523406548; Fri, 10 May 2019 14:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557523406; cv=none; d=google.com; s=arc-20160816; b=bMkfqECTnVSerG15vugSCri9gSZvOnR+WUDZ30dSZAND0wXhiAmOqFvGjAwxFI/PJn YUJoxW+fn4NuIuMKWjgPKdsHGfY4Yy+IhE3IFU+hgD4+jY4HtaeJZmtUVmoCvIhtR5oB +gJXnQZrtf/3FGltKM6JjojPmsdUpM/o9yFmuRnPHIShuIAOCQY4phqZKa9i8dMRikCO 9J9GZ79tCTc5UGLfnNg/uHaVNDIyjIZpbNhJPW8T51mwVMyq24ZK7vqbFScM1r9CIttA 8yd0bchZK9CpqnqOyxDHwrwH9oTBWb7likcMF4+Tn9CtDBaMYj8hq1kHSOUeWYFLhV9I nWUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=96U2yZYS650ZUvzK9vYJuvBGVOJrn9p57cUfQy+WY+8=; b=WTLAtReWh3L/FL4tjYapW6gLVqBDSJQKuz99ZLXt7/ruXQvgjc4F0gAXybjB/boBtk S8LpqOhE2ljbjBzpLmZV6Tzc2plKbBBl+mhOHATCUi3PCu6Pfz0Exa1I9shrzbqKUN12 hFz/GtJIhVV4I5nvBPJurnZm1rHwgL1btA/qT2Fj+RS9V1hFFjqQeI0WCaUhdQO4sPWC AsebJBpqoPhRo5tvmTTxKOU07/Vz7stRRRJGuYKL3JLaeNEedYDi16Qot2bGbxHOcO18 8yxeSxnBTJHvSgtCOMdc0oDU7JF6lDEf4/GkwtykmILe5dxYxFEAAndgPVg8KXzN2MqF xZRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0fS3cTmH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si8091796plk.413.2019.05.10.14.23.09; Fri, 10 May 2019 14:23:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0fS3cTmH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728112AbfEJVUk (ORCPT + 99 others); Fri, 10 May 2019 17:20:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:32840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbfEJVUj (ORCPT ); Fri, 10 May 2019 17:20:39 -0400 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E24F42182B for ; Fri, 10 May 2019 21:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557523238; bh=eVSDLxFRJtNqvSdy6nzYE0dpoYEOh2L4bbdtCHYcgX4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=0fS3cTmHczG1ssOc5teJdrM/TgWQ6nVTFhgCqAq8ASGKhIkMVg92wafAOLYiI3MWl INOHmViBS9cNEKaDJzcRJl2lEH3LwAKUHnacjQ8LBm+I8aoDSG2JbRqJtx70KX/w7K pTHZRqYnAaT5e2/zJ0Nn7aMXre7H8IOi3HsAkp+Y= Received: by mail-wm1-f48.google.com with SMTP id j187so8744601wmj.1 for ; Fri, 10 May 2019 14:20:37 -0700 (PDT) X-Gm-Message-State: APjAAAXZCCZ5cgRkj16u3f9wrHOpzFoVWpFjBKughG8zs+ApPZn09/P+ PV7bXuu1Wg0vVXQAri5O+8uSV8Yl20xI8S9tKjH1Mg== X-Received: by 2002:a7b:cb58:: with SMTP id v24mr8095092wmj.107.1557523234745; Fri, 10 May 2019 14:20:34 -0700 (PDT) MIME-Version: 1.0 References: <20190506165439.9155-1-cyphar@cyphar.com> <20190506165439.9155-6-cyphar@cyphar.com> <20190506191735.nmzf7kwfh7b6e2tf@yavin> <20190510204141.GB253532@google.com> In-Reply-To: <20190510204141.GB253532@google.com> From: Andy Lutomirski Date: Fri, 10 May 2019 14:20:23 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 5/6] binfmt_*: scope path resolution of interpreters To: Jann Horn Cc: Aleksa Sarai , Andy Lutomirski , Al Viro , Jeff Layton , "J. Bruce Fields" , Arnd Bergmann , David Howells , Eric Biederman , Andrew Morton , Alexei Starovoitov , Kees Cook , Christian Brauner , Tycho Andersen , David Drysdale , Chanho Min , Oleg Nesterov , Aleksa Sarai , Linus Torvalds , Linux Containers , linux-fsdevel , Linux API , kernel list , linux-arch Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 10, 2019 at 1:41 PM Jann Horn wrote: > > On Tue, May 07, 2019 at 05:17:35AM +1000, Aleksa Sarai wrote: > > On 2019-05-06, Jann Horn wrote: > > > In my opinion, CVE-2019-5736 points out two different problems: > > > > > > The big problem: The __ptrace_may_access() logic has a special-case > > > short-circuit for "introspection" that you can't opt out of; this > > > makes it possible to open things in procfs that are related to the > > > current process even if the credentials of the process wouldn't permit > > > accessing another process like it. I think the proper fix to deal with > > > this would be to add a prctl() flag for "set whether introspection is > > > allowed for this process", and if userspace has manually un-set that > > > flag, any introspection special-case logic would be skipped. > > > > We could do PR_SET_DUMPABLE=3 for this, I guess? > > Hmm... I'd make it a new prctl() command, since introspection is > somewhat orthogonal to dumpability. Also, dumpability is per-mm, and I > think the introspection flag should be per-thread. I've lost track of the context here, but it seems to me that mitigating attacks involving accidental following of /proc links shouldn't depend on dumpability. What's the actual problem this is trying to solve again?