From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752521AbdKEBKJ (ORCPT ); Sat, 4 Nov 2017 21:10:09 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:49454 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751913AbdKEBKH (ORCPT ); Sat, 4 Nov 2017 21:10:07 -0400 X-Google-Smtp-Source: ABhQp+RCsHVYIKZq5F18kjD3lmjazWd0b+AhJcTxYZB+NhrLiRBwroGPnHP4GbwQD2q2ewKz6isfdw== Subject: Re: Regression: commit da029c11e6b1 broke toybox xargs. To: Kees Cook , Linus Torvalds Cc: Linux Kernel Mailing List , toybox@lists.landley.net, enh@google.com References: <0b3a9bd0-3046-cdab-cfee-0ca45ee64e8d@landley.net> From: Rob Landley Message-ID: Date: Sat, 4 Nov 2017 20:10:03 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/03/2017 08:37 PM, Kees Cook wrote: > We don't. (In fact, arg copying happens before we've even figured out > which binfmt is involved.) I lifted it to just before the point of no > return, but moving it before arg copying looks very hard (which > contributed to why we went with the implementation we did). > >> So it's pretty painful to make the limits different for suid and >> non-suid binaries. > > I would agree. I think I know what to implement for toybox now: xargs should trust libc's sysconf() to provide the common-case starting limit (subtracting env space) then implement the fallback pipe-from-child thing to iteratively try half the argument list when that fails. Elliott's even cc'd so he can update bionic's sysconf for the new 10 meg thing from the title commit. :) Rob