From patchwork Wed Jan 3 13:07:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 184739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5005386dyb; Wed, 3 Jan 2024 05:06:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/kZ65Fx44Hn+Bz9IlNb1jBNFS5vF+LDh5L93L69T14mA9bn0QGJCEG9lVVlcq05o+DSjM X-Received: by 2002:a17:903:18e:b0:1d4:2473:e7de with SMTP id z14-20020a170903018e00b001d42473e7demr19789976plg.125.1704287160570; Wed, 03 Jan 2024 05:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704287160; cv=none; d=google.com; s=arc-20160816; b=VAH5KO0aLF4tbHG7ES83+szekvpTzY8od+19o0k+FzO8aYV902NC0eMjgmi1mAJ7J5 w46w+3gbvt0WZ/rnq/V3aq5c/Pu9b1Q+Y88OzMFNZMHM6tBiRfpzXJeOrdW0g/gwl1I6 UDsQn1SLbExN9H/33XbgVlkNyJRBp5QjP+VsWp2wEuH0Q/pd8hjNEDG7arwwdb3MoRI4 NilafeDcjkRSB3hj/JQRPlOP1Y5R5CKWBbkl+EllLV37sWHU2XX0XOOC2waqna6ffZtd +6x1FQqBX4ajb3cFCrb/ec/EFDCERPKNkmDDt5kGAklwh2hTAphpEmu1DxXB4Q5GDIsG YO+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=pGzJ3pIamCfAHwKHKyh5iFIjvKRVUsIH86gCTLZpLrQ=; fh=U9Xw46Yvik7SuZ3eMvnTMftWWwzspkw+p0ER04/hzgw=; b=pS0N1Av/b+1V50iSvRD8AvZRSrFDrolQGb6kurOrnfhVUMrxnXSuPrpwGCDIeGU686 Lpf4wCJAZQQ2zEAaiX18XrnL8odYyB2g8k6SqbyV7x/lo6Atm1rMZwpIKOhyTLL1sPSG jDvFK26xGS/w1udZVwZuh9CTgMOLwAFbKG5eVBv4GrmEB6tYLXzbXKJbqOkkpuo+jq3M jjkyH/6Ihes/5vRxZnfa4Idcw2AUjq9Ogi94jhj98aP0XkVf7QAWabY/8ULw74Hfv/bV sB0a3EuC/ip50Fp2MQw7NXNvet4upLEueupcxSyMJRXoWtgixn+hJzXSmANournWmA5I 02Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t1EAJyIS; spf=pass (google.com: domain of linux-kernel+bounces-15548-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15548-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x11-20020a170902fe8b00b001d46a313b41si13657635plm.353.2024.01.03.05.06.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:06:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15548-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t1EAJyIS; spf=pass (google.com: domain of linux-kernel+bounces-15548-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15548-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 343732840B1 for ; Wed, 3 Jan 2024 13:06:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2A11199C4; Wed, 3 Jan 2024 13:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t1EAJyIS" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 241A3199A2 for ; Wed, 3 Jan 2024 13:05:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D224C433C7; Wed, 3 Jan 2024 13:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704287143; bh=qy1B/hVtV9MM5lWSYrtrT8fgfP6SIBH1VGhcHFiT9yY=; h=From:To:Cc:Subject:Date:From; b=t1EAJyISncSnz5PGeFlyA9kbqbxPNviKX8PD5T4nilzclBHEpUmxRdW5+vxcxThP8 +R3U0j/shTqpfxy5IFw7drdbekMeUt9M5nfm2ijQuOnoB9MvGMxTnQ3jnAOQ8tTX9+ s5wNtB/17rJLyESY/2RXqHB5V9bu1kj2oBDUmd4n/HIBFvAodKc/VjuitS0U7/TQoU CjdzAkC5PKwlC9vgqGuMVrw64q1BfRgKn2IynBja3BYRIYC/nYJz57n1BBUnEDy5sA hhubRjLlCMkVyp98fBklxGS+mo5oqj+0QcO4uV9yLcwdN8LYeWJMiNeELz3hHF0zmE H0aBGvfH+ip7w== From: alexs@kernel.org To: Eric Biederman , Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Alex Shi , curlinhuang@tencent.com Subject: [PATCH] execve: argument list space enlargement Date: Wed, 3 Jan 2024 21:07:22 +0800 Message-ID: <20240103130722.1551670-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787074613621673243 X-GMAIL-MSGID: 1787074613621673243 From: Alex Shi Wechat using too long gcc parameters, then get a strace complain: execve(...) = -1 E2BIG (Argument list too long) Have to increase the parameter space for this, stack has enough space for this enlargement. Signed-off-by: Alex Shi Cc: Alex Shi To: linux-kernel@vger.kernel.org To: linux-mm@kvack.org To: Kees Cook To: Eric Biederman --- include/uapi/linux/binfmts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h index c6f9450efc12..717f6cafe8dd 100644 --- a/include/uapi/linux/binfmts.h +++ b/include/uapi/linux/binfmts.h @@ -12,7 +12,7 @@ struct pt_regs; * prevent the kernel from being unduly impacted by misaddressed pointers. * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer. */ -#define MAX_ARG_STRLEN (PAGE_SIZE * 32) +#define MAX_ARG_STRLEN (PAGE_SIZE * 128) #define MAX_ARG_STRINGS 0x7FFFFFFF /* sizeof(linux_binprm->buf) */