Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4705144imu; Mon, 12 Nov 2018 15:53:32 -0800 (PST) X-Google-Smtp-Source: AJdET5e9TQ9Cxb0jVqTgGyaiHBDSDqI6FHebLpuUbbB/q/sBjv1Hgrr9SJT359IBj0uGyzGpN0fv X-Received: by 2002:a63:36c4:: with SMTP id d187mr2599572pga.404.1542066812342; Mon, 12 Nov 2018 15:53:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542066812; cv=none; d=google.com; s=arc-20160816; b=unwHXc9lgLBcCbq1A0AZFXPGb+jTlnW4U3iRUKceofq+HIyx2rxTNsdjxMq2GA1e+M Ad4vh9aoYt69Lir2QoEBYqKRu1WrYnVojpiu9Ojmu6kQ+/Tk6kUuIpTgPBs9DvQ/zXqu +nvU+fc8O9zkx1sgF33AYOjxD5cqsB20SXffTIKOZJiozwPiF0ncOyvTOFnW69ccEFPG MoTx+oSMlCqYHLM4+FikLks16PKgRCNLiTgpfaLoeU2LrhWtULz9Jz5qLE54PePLa3eF hZXDsp3v2QUtjZ+NsidrjjXi25S3VRy6rnSdZIH8vZdiRwV/m1PMx+3qTFV7Fl1jEDL6 t/Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=/VPa/d+HqOgKg3A4xQYP3Xf4e6R6g+bpj1yvXPjKDaE=; b=DzFjo8wZCxoohchCub53QMbTMF75wMrca0LLW16QAvKXsUFVOTAX/TRWpwHLloJZ79 bGK3lQf2OICxog0+/FFYoaY2Pn+dj7hPuxOGmiPS7gU4y9DTWt1zTM1KI7+WR3x4Xgaa W2FFwH+ivJKAeWtZ4bJVCJVvoFG5+xy5O3i5quOEMQS/HiEtEYGXqTe8JI7DSc0wvi7u NBBKd6tOqutTdEERKi4AillFsA1Sg2+U2oeRgGEpsiAgAoH93Nm3XVTLydigPtVZWMRT cpgPZDp5i56Dc7PrKB+Uqd+NWvPM9gzSLASI5tRLXYIPYWWg0PI2X+ejD9QevIidPQgp d3Hw== ARC-Authentication-Results: i=1; mx.google.com; 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 bc11-v6si18744751plb.120.2018.11.12.15.53.14; Mon, 12 Nov 2018 15:53:32 -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; 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 S1727428AbeKMJsO (ORCPT + 99 others); Tue, 13 Nov 2018 04:48:14 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54718 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbeKMJsN (ORCPT ); Tue, 13 Nov 2018 04:48:13 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 13201A67; Mon, 12 Nov 2018 23:52:49 +0000 (UTC) Date: Mon, 12 Nov 2018 15:52:48 -0800 From: Andrew Morton To: Oleg Nesterov Cc: Ben Woodard , "Eric W. Biederman" , Kees Cook , Michal Hocko , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] exec: increase BINPRM_BUF_SIZE to 256 Message-Id: <20181112155248.4dde2613979f4c176565629e@linux-foundation.org> In-Reply-To: <20181112160956.GA28472@redhat.com> References: <20181112160931.GA28463@redhat.com> <20181112160956.GA28472@redhat.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Nov 2018 17:09:56 +0100 Oleg Nesterov wrote: > Large enterprise clients often times run applications out of networked > file systems where the IT mandated layout of project volumes can end up > leading to paths that are longer than 128 characters. Bumping this up to > the next order of two solves this problem in all but the most egregious > case while still fitting into a 512b slab. > > ... > > --- a/include/uapi/linux/binfmts.h > +++ b/include/uapi/linux/binfmts.h > @@ -16,6 +16,6 @@ struct pt_regs; > #define MAX_ARG_STRINGS 0x7FFFFFFF > > /* sizeof(linux_binprm->buf) */ > -#define BINPRM_BUF_SIZE 128 > +#define BINPRM_BUF_SIZE 256 > > #endif /* _UAPI_LINUX_BINFMTS_H */ It does seem a rather silly restriction, and it's tempting to suggest reworking the code so that linux_binprm.buf is dynamically sized to accommodate even ludicrously large strings. But obviously 128 bytes has been enough for all this time, so that's going too far. However it would be basically cost-free to increase BINPRM_BUF_SIZE up to the point where sizeof(struct linux_binprm) == PAGE_SIZE?