Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4214052yba; Sun, 12 May 2019 07:36:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfVlhMyKFRIt8t8mA8BVLiLBUFgW97lIQOy61qcQlQ/At/T2vSSUOE9j/kAgB6CzAA0JtF X-Received: by 2002:a63:4c45:: with SMTP id m5mr25678103pgl.78.1557671810627; Sun, 12 May 2019 07:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557671810; cv=none; d=google.com; s=arc-20160816; b=0YKNUyAxyuNtFmYo3tam/bQUdLZyagwhwPb94XlQS8HZWJPGvniPSJ/jN7l6ARtDg1 lmQSzrdnWjRt3pzRh+JPiHNcI0XaspZM7QtoL23U3YTvUnvcusAPn0wTnbZGRlynH1FS RWzQRzj/dSkPPhfKYMKT/En8RZ5fMcPc7CNK7tjsvPxqBpNREUoqLASy5X5u5iMrADkp ybIkP4rc6NVjU1pArVp5bAEuZs7FoVzaaHfmEMM8JB84OXzt2YYpES1zaArCEspnLxt8 2WUpT9UXol/YSkxv4GfmC2b51daVYzUgUMRj7+s69YfOhK9Vp599/fh41KXhuw5VkcA7 7RBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=rj1xYp3bdbLmB5I4rmF5eddBCdDybeCIweQdtWz6Qds=; b=N4cpNY4CRK9t3RVi5p/oa1N3JWFl4hNCJqfr5UuYoQVkgpWRz32rhlb79X+GzlKx0x Tx7kkIzNomevDziv98jGO5JPmct6QHe/99gn6147XGLUKsQW7d8T7FCnMuyyMbiBR/SJ AMAC+ZY8++nD2C6Pry3p/nH6KvkLcObDaZHG2WKdx4J95U/uRHDmHxllRszd+aLKOD0K SbkMeW3EZvAmjdnPmjogCMxsAQfkKlH8wgBGeCa61eIbZuO2kq2YHfYvC1X6JnHr0kjO qNO3Hnad6vQqud2HR0pAmQgNGQa1eLKxm9v9pkgo0U7UOm0/m5OkmaDsR3EJLxXesfPh kZmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=uBjJnZYu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si12207393pfk.205.2019.05.12.07.36.34; Sun, 12 May 2019 07:36:50 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=uBjJnZYu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726832AbfELOe3 (ORCPT + 99 others); Sun, 12 May 2019 10:34:29 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35938 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbfELOe2 (ORCPT ); Sun, 12 May 2019 10:34:28 -0400 Received: by mail-pg1-f196.google.com with SMTP id a3so5392404pgb.3 for ; Sun, 12 May 2019 07:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rj1xYp3bdbLmB5I4rmF5eddBCdDybeCIweQdtWz6Qds=; b=uBjJnZYujXqLDjdsyGju48YBheW3/jE8xCPZQJjpgJd9RZWkns4nx6DTpkmfTtRT1k ei249ShnwoxPskGiuNU2YeD9/BPNrZPrtoYO8ZyHf0ot27+I+0f1WBbkzVZZpEeLt/kW jMSMhpzEhHai35mqb0aIYC/YGM/oqvuYZs9wYq3ePwDMbwoZmFU3rxbRBhaDIDN1S6R1 a/KqZ5WR+U0qpaUapt170v2T+DDaFp0TqrA+OPkRdWL9hxxezVgcp5Cs0gSS7DpwKd7t sqfCFn5Ds12xQx0WBUYk9RVzc2LzeATQ4N9jnrzRwoWXYd1UOcCnKnfe74JIJjmISotF tvxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rj1xYp3bdbLmB5I4rmF5eddBCdDybeCIweQdtWz6Qds=; b=hjcO5+0SrQPOk6AKJe+FjPwvA6PPXoLCQd9kyjCVS09E3r7N8xhpCwPESBbZUO0Hue kwUdoI1XuT3ca4Avs3cstE8F8p3R+vbJ/lLQxmzMLmTxeF7RPfP5JMQqmbr/U45yoI8I rL2n3lRzED/kJ+KqX8fpk5yhpmAjG7BMXRL14oSH/t+xT/vwdBR/XzCZJ0K75VowLOO3 n/2vnSuXVNysPuag3bp/QmC5wJ5/OPwX1vpIy5d3PLQ9AePe4X4iVuykTf1/WPO77cTW OFHpPlonzcYf7SCdInQ4d/g+J0bMNqpk22SuwrJokqNKgXP9JPeYhqAsAlQ2bkhOTb3e BjYA== X-Gm-Message-State: APjAAAV9QULPHiu2diHruff7XhA7hzeskMJC1umINb5OnYU/H2v8g5wL 2IITqyp0xDpuN2aUNPguV1fgeg== X-Received: by 2002:a62:3892:: with SMTP id f140mr27329042pfa.128.1557671668210; Sun, 12 May 2019 07:34:28 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:1112:65f7:3af0:f60d? ([2601:646:c200:1ef2:1112:65f7:3af0:f60d]) by smtp.gmail.com with ESMTPSA id k10sm11400208pgo.82.2019.05.12.07.34.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 May 2019 07:34:27 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v6 5/6] binfmt_*: scope path resolution of interpreters From: Andy Lutomirski X-Mailer: iPhone Mail (16E227) In-Reply-To: <20190512133549.ymx5yg5rdqvavzyq@yavin> Date: Sun, 12 May 2019 07:34:26 -0700 Cc: Linus Torvalds , Andrew Lutomirski , Jann Horn , 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 , Linux Containers , linux-fsdevel , Linux API , kernel list , linux-arch Content-Transfer-Encoding: quoted-printable Message-Id: <0ED963D0-4C31-45B1-B361-E4A75DFBF7C1@amacapital.net> References: <20190506191735.nmzf7kwfh7b6e2tf@yavin> <20190510204141.GB253532@google.com> <20190510225527.GA59914@google.com> <9CD2B97D-A6BD-43BE-9040-B410D996A195@amacapital.net> <20190512133549.ymx5yg5rdqvavzyq@yavin> To: Aleksa Sarai Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 12, 2019, at 6:35 AM, Aleksa Sarai wrote: >=20 >> On 2019-05-12, Linus Torvalds wrote: >>> On Sat, May 11, 2019 at 7:37 PM Andy Lutomirski wr= ote: >>> I bet this will break something that already exists. An execveat() >>> flag to turn off /proc/self/exe would do the trick, though. >>=20 >> Thinking more about it, I suspect it is (once again) wrong to let the >> thing that does the execve() control that bit. >>=20 >> Generally, the less we allow people to affect the lifetime and >> environment of a suid executable, the better off we are. >>=20 >> But maybe we could limit /proc/*/exe to at least not honor suid'ness >> of the target? Or does chrome/runc depend on that too? >=20 > Speaking on the runc side, we don't depend on this. It's possible > someone depends on this for fexecve(3) -- but as mentioned before in > newer kernels glibc uses execve(AT_EMPTY_PATH). Why are we concerned about suid? Don=E2=80=99t we already block suid if the= path being execed doesn=E2=80=99t come from the current mountns? That shou= ld mostly cover the things we care about, no? I suppose we could also block suid for deleted files, so that deleting a kno= wn-buggy suid binary becomes more reliable. But every sensible package tool s= hould already be chmoding the suid away before unlinking.=