Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6852320imu; Wed, 14 Nov 2018 07:56:40 -0800 (PST) X-Google-Smtp-Source: AJdET5dNhWvDhdgjGk5TqpzfN0Ctjl4mGUT8WWA8eWBaGcH+3UIm1S18zWP2jYB6vla08WSCbE4H X-Received: by 2002:a65:6148:: with SMTP id o8mr2206812pgv.451.1542211000904; Wed, 14 Nov 2018 07:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542211000; cv=none; d=google.com; s=arc-20160816; b=CHWZZH5it5PG79bAUDgh6kH0AnkpsRBFuh9Xu5wCCYQZ0+9mkkUcNs1lKvrxyt3nMR hz5ZYMhmeZl9dUsrX3CUn+8lmm/w8OBjH5sjNsERtUlWyo3ypctAdbcoDO+yeVF5Q+xe Z8wsSooznL0T7Htc69fJ5ucEasbVZSzqlL0wpXKkD94lcU6WkKEspKMdhhQtfXL2VkVA XMFuYvk6hwYcv2uTFUAxC4xJlb/LadN1q8wR0hv7t5oU6X5lhodcB3LDD2bxsfxdJ1Uc GGHR8vlrrinAaFuG/BtJwJTZwx9ew2YY7afuytVSWe6muTIpqIkb7uHxJCcbpPU3G/5R QyKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QG/XeLlqcVyArfnpaTnojgJ2BWOgv8S3rOSjjAAp5c4=; b=sOTUh+o8fxBdsAxL9fbwtrdoFdeoxMTXbTgSePiYbR6KBlh2+l8YKA7UgOvm7Eb86k by36gXAoCz9hptQJ1pYdH61CBN2GtiaYZeFq3NhOuIHMHJ/I1D0KavdY5WnloOYFDIBf 3VXVhVmxcwWp0Gr2qmFp3ffsBKo47QIBcgBeWKoIBAz5WQzjQJ17IEFEMqIR4HbnirQH 3cNb+Geim/cf/qQAx7gf+ixiQunJu9nLQxLyE0nxdY4yWOgFRs0HbK399jHxQK6k7Pat remmUcitv90tK0sgAU1tt8cJfmn0VLiFN5B6cJ+sxxHTIMhrwD3LehofegEfGWoMSWfh WgNQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22-v6si5417557pfa.169.2018.11.14.07.56.24; Wed, 14 Nov 2018 07:56:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387407AbeKOB6E (ORCPT + 99 others); Wed, 14 Nov 2018 20:58:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50804 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727885AbeKOB6E (ORCPT ); Wed, 14 Nov 2018 20:58:04 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E573168F; Wed, 14 Nov 2018 15:54:17 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.31]) by smtp.corp.redhat.com (Postfix) with SMTP id C393B60BF6; Wed, 14 Nov 2018 15:54:14 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 14 Nov 2018 16:54:16 +0100 (CET) Date: Wed, 14 Nov 2018 16:54:14 +0100 From: Oleg Nesterov To: Andrew Morton 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: <20181114155413.GC13885@redhat.com> References: <20181112160931.GA28463@redhat.com> <20181112160956.GA28472@redhat.com> <20181112155248.4dde2613979f4c176565629e@linux-foundation.org> <20181113165557.GG30990@redhat.com> <20181113124305.73b8ac9e5a2ef9b18d3444b2@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181113124305.73b8ac9e5a2ef9b18d3444b2@linux-foundation.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 14 Nov 2018 15:54:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/13, Andrew Morton wrote: > > On Tue, 13 Nov 2018 17:55:58 +0100 Oleg Nesterov wrote: > > > > However it would be basically cost-free to increase > > > BINPRM_BUF_SIZE up to the point where sizeof(struct linux_binprm) == > > > PAGE_SIZE? > > > > I don't think we should take sizeof(struct linux_binprm) into account, the > > new members can come at any time and we can never decrease BINPRM_BUF_SIZE. > > My main point is.. why not make BINPRM_BUF_SIZE a lot larger than 256? Of course we can make it larger. And of course 256 is just another silly/random value. Currently it seems to work, but if we have another bug report we should probably rework load_script() to use vmalloc()'ed buffer. Perhaps we should do this right now and I am just too lazy. Oleg.