From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756432AbdKDBWV (ORCPT ); Fri, 3 Nov 2017 21:22:21 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:46454 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbdKDBWU (ORCPT ); Fri, 3 Nov 2017 21:22:20 -0400 X-Google-Smtp-Source: ABhQp+QiKXd2wRKkr1r/6q0Nj8n3Q/rn3+COretdoFhjuZCtBrG6fAvn6uOW1yN7+KKqtJkKPWbwO3qaVdboklfvwy8= MIME-Version: 1.0 In-Reply-To: References: <0b3a9bd0-3046-cdab-cfee-0ca45ee64e8d@landley.net> From: Linus Torvalds Date: Fri, 3 Nov 2017 18:22:19 -0700 X-Google-Sender-Auth: eMXl3yjs-LZZi0DRmkvX1AZdKxI Message-ID: Subject: Re: Regression: commit da029c11e6b1 broke toybox xargs. To: Kees Cook Cc: Rob Landley , Linux Kernel Mailing List , toybox@lists.landley.net, enh@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 3, 2017 at 5:42 PM, Kees Cook wrote: > > If we didn't do the "but no more than 75% of _STK_LIM", and moved to > something like "check stack utilization after loading the binary", we > end up in the position where the kernel is past the point of no return > (so instead of E2BIG, the execve()ing process just SEGVs), which is > much harder to debug or recover from (i.e. there's no process left to > return from the execve() from). Yeah, we've had that problem in the past, and it's the worst of all worlds. You can still trigger it (set RLIMIT_DATA to something much too small, for example, and then generate more than that by just repeating the same argument multiple times so that the execve() user doesn't trigger the limit, but the newly executed process does). But it should really be something that you need to be truly insane to trigger. I think we still don't know whether we're going to be suid at the time we copy the arguments, do we? So it's pretty painful to make the limits different for suid and non-suid binaries. Linus