Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1135555ybc; Tue, 12 Nov 2019 15:04:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxFzkQQnK3Yq7hT6ZsEEl0tGo+qUkEExRj9LCuRwyAdHHhDhBGwKO3eUPW8rx5CBqLi1RcG X-Received: by 2002:aa7:c6c9:: with SMTP id b9mr231624eds.1.1573599876748; Tue, 12 Nov 2019 15:04:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573599876; cv=none; d=google.com; s=arc-20160816; b=JtN5YRLE3u4bsjiIVBW+Nynswhi78aw+Xb7BS8If+HfQigYMPRst97dHVV+Vrh8Bem dki30uWHnCYdH/sVpgf8npAwU2B4BXcFNo0vtyiaWli3pWT5sSWKWIvDmdka4cZ7MtN3 ELCOKQHgbJ88fTUFDlIAh0o0tuXIPI4U4n6MPJ5xAeiRNRWMcMuZ+8LETN0f4RNxL6HE zLWGifdXjWo87JU6qQV2tpsWQFwr4hSIA7g4V5QmiMBQT9562yeJ4krFqdJkvfl5ub6/ cqvEUlhWO/Uh/n541hBuuN0s9Z3H6wGkmOhI+//PBGdYp+Ir9pSig2TOoIOWIVj6RMxf da9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=soAK6mR7/nlH57wscE6Anu+LxHtbszZd20gXy3dqtds=; b=dGoOcC15SRopw3cThhwFuOY4EaMFcofAxHwp3xsqT3h9pwmlAYeBHYYYV7UYlidaup TbTRYdLPeC2XrpdOT1BKPmh7N48sZN0B+Lfmto8EUO9GDxvAzcA1RaeraKrXb5RkTp+q +0UgcvMlujSaqWJLBvAZdriZqGFrXHr6ndJagbLkaGQ6XFY9MkPw01N2GpE6Mq9n8s9w MkWepYAqxZIfzSNcOqNcHM96nQ1gQYyWNdKQIaCTb7liiPTQE406T0ihxjCm3MpzEoKE ogdmJdiC5WkV6X6LmPww2mx+pbnnfADImpZ9LACQYDHowRu8QiIcL/NNzx5kBqhFPeiT oxhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bNxjrx04; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q22si2322ejx.69.2019.11.12.15.04.11; Tue, 12 Nov 2019 15:04:36 -0800 (PST) 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=@chromium.org header.s=google header.b=bNxjrx04; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726982AbfKLXDa (ORCPT + 99 others); Tue, 12 Nov 2019 18:03:30 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41832 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726910AbfKLXDa (ORCPT ); Tue, 12 Nov 2019 18:03:30 -0500 Received: by mail-pg1-f195.google.com with SMTP id h4so12840626pgv.8 for ; Tue, 12 Nov 2019 15:03:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=soAK6mR7/nlH57wscE6Anu+LxHtbszZd20gXy3dqtds=; b=bNxjrx04Kt52AdGurWf++izr0TcUWE+iYJy7xJCbvM+w+E/MiddxwrF5h3mu5PeZKw DHa4bg/tfGyMpe1pGUgEUT8A6iMzek4x5HopvI+08asWwi2Rb65z1gdA8Q9/z6PVbQaq iRhFfpwdXXcp981sv9EZnSPA4rEl9wDxUloj0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=soAK6mR7/nlH57wscE6Anu+LxHtbszZd20gXy3dqtds=; b=EFT8oR6w9bzM+AO1kUyYLmbIzbmt2Ywl5XtafSJ3lhxBpzZzLGPHtBZwJXwUZiWciP Sm2MWoVzE8WXDmyrPzlZOMEme73/ID9VFtM7KF3qUYL+VCcNLc0V5NCbavvhjrV8Dj/T YiqYiwuIUNr9wNbqV6GyHtD6XNmN6Erv31PF/9nZEEIWI47FgTLMmkQPrtsKQQinwAby p6jlUQnvoF/ZVphQ1teJQnpKuH1Un2KoypIxdmcvKfK9Ou2B6k0vvU57pFeSEFQUOBwA csk3KraqJsR9rQd5j14GK5EmQg2BKw+CjiIMukmYSrfPt8Srsaqd7xC6TAvWLFaNadTk Dv3Q== X-Gm-Message-State: APjAAAV3COR2dG/kNF+vfn6ukkFcgPsNGBHd93PNXU7Qgc+EJfiQ+X6h MuASIkGqXd7z10oF6KlKCfTgOA== X-Received: by 2002:a63:3cd:: with SMTP id 196mr31871pgd.150.1573599809214; Tue, 12 Nov 2019 15:03:29 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id r22sm33477pfg.54.2019.11.12.15.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 15:03:28 -0800 (PST) Date: Tue, 12 Nov 2019 15:03:27 -0800 From: Kees Cook To: Jann Horn Cc: "Theodore Y. Ts'o" , "Michael Kerrisk (man-pages)" , Christian Brauner , Florian Weimer , Christian Brauner , lkml , linux-man , Oleg Nesterov , Arnd Bergmann , David Howells , Pavel Emelyanov , Andrew Morton , Adrian Reber , Andrei Vagin , Linux API , Ingo Molnar Subject: Re: For review: documentation of clone3() system call Message-ID: <201911121502.3CADFBE3@keescook> References: <20191107151941.dw4gtul5lrtax4se@wittgenstein> <2eb2ab4c-b177-29aa-cdc4-420b24cfd7b3@gmail.com> <20191111165800.GD7017@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 11, 2019 at 09:24:33PM +0100, Jann Horn wrote: > On Mon, Nov 11, 2019 at 5:58 PM Theodore Y. Ts'o wrote: > > On Mon, Nov 11, 2019 at 03:55:35PM +0100, Jann Horn wrote: > > > Not on Linux, but on OpenBSD, they do use MAP_STACK now AFAIK; this > > > was announced here: > > > . > > > Basically they periodically check whether the userspace stack pointer > > > points into a MAP_STACK region, and if not, they kill the process. So > > > even if it's a no-op on Linux... > > > > Hmm, is that something we should do in Linux? Even if we only check > > on syscall entry, which should be pretty inexpensive, it seems like it > > would be very effective in protecting various ROP techniques. > > I'm not a big fan, especially if that would only happen on syscall > entry; at the point where you have enough control to perform syscalls, > it probably isn't too difficult to move your ROP stack over to a > legitimate stack. It does have "your process is doing something unexpected" checking, though, if we want to declare (and enforce) the expected behavior of userspace stack usage. (i.e. not strictly as a ROP defense.) -- Kees Cook