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: 13510058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4F78C3DA6E for ; Wed, 3 Jan 2024 13:05:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3AADA8D0069; Wed, 3 Jan 2024 08:05:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 35AB88D0061; Wed, 3 Jan 2024 08:05:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 249858D0069; Wed, 3 Jan 2024 08:05:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1218C8D0061 for ; Wed, 3 Jan 2024 08:05:48 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C6F7E4089A for ; Wed, 3 Jan 2024 13:05:47 +0000 (UTC) X-FDA: 81638021934.23.1B31C74 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 12E7740022 for ; Wed, 3 Jan 2024 13:05:44 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=t1EAJyIS; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704287145; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=pGzJ3pIamCfAHwKHKyh5iFIjvKRVUsIH86gCTLZpLrQ=; b=wqFqHSVJ5UFK0NVBESDXfNg6cUcYvzexb1sdgQV8B+MdS8hhGBfLFkPnz5vfEvpEp++9Xx BeCKjkwBv+rmnm+VYbESlAzkJtna9dKg2gZ8x8RZ3NodKYq/KEX2siaAo5POJhgo/DR6jW hMqzuCE3Lqo7ZwYKN1AveJZAyLhmQic= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=t1EAJyIS; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704287145; a=rsa-sha256; cv=none; b=BHQfJU8YE3RMfjpherMuzSHCcO9OJat7iUVPe1UyiriQ9qlPLEz4p0WSN+R1e4475r8TSz +EEaFASmeoiSozM4bTso9qKe3cE+KaNXpSWMLbfK50yHIGn57Vu4e8VSM2tLAuYGD6hXVR E7HL2TBxpwdVj7SnGVIwoTJQSeTUDVQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0CBCF61477; Wed, 3 Jan 2024 13:05:44 +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 MIME-Version: 1.0 X-Rspamd-Queue-Id: 12E7740022 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: o8guqqioatp3k7ay666m1qzke4xd81dp X-HE-Tag: 1704287144-308527 X-HE-Meta: U2FsdGVkX197rkZ3IoADdUemgDPW3PQdgj7Lnj3G15a54FL1Wy0jKhkQ/WOdPXhdrHXfG5Qer0irNAvSkXcPesryFZWLjoalyCgO8aTlRvQ8+YmQH/085Dw13kiVqPdJvT77f9at8JKO2PF+QFAFi4Ok271n4B78mIqFJXU+LUrsYRIelyefcnyERrgK/UfeKBcxUARCH28thtnQkzmeZR9qaUbJtf+zTi08S7+cJwgUbKTkrNHrjv1eCb+lffas7fPWi7XAkm15ndXH4kSYN1WAMJgVvr8lSAwcRWf/mwh3qXn+fKv4uJ/Ke/N5oobvGU1Xil+dKwl3KBP+d4gkkmGjvm1IqQE5CXDGhZa+6CYuuHyFGiCKURIyL0XowYlA5ZOFXq23FWWlZ0ducRFUsScysiXOyayddjuaNAm2cPNWZipMiKfb4/I1N9piWIu4RtV59Ob8sRo7g9os52v/5EcFmzyqaJ4vBzoZLh6eWDvM9O+UMevzQ0LR4jZ1nmJrVjI5OOv9qBb5FfBMIZLWZkE3O+Zaq7neFEIcdUhLxguHFCqJF63dZ94SeCtiA+A/yVA64Fj/vyri7s4zMm6pndVDn+oquHYupEqTID3BlERWmx8eSo2za3nOwRjVFol0R4UI2YMnawCUauBGV+It5J827/FHdoj03zvuQx8bNsv/fmIAyWibI8Z0ZuBbDlIUje3jNquYgnH15+pYqi55FKvdEapM3hiaMxdr7YS0Br+QZIvaz35pl5S/e+w699CBPJTkSl5oGY/QEVtjL+vbLCvySX4r3TZuxxkOH21VZYXCTmBSFaZBmDL3gDFC1AwjSP4KK2hVQyzrmetmfgYgITIjjFuOTZ23VvGQtuxWK7YE1EiWxZZF5/6lO5bFIOYY4R1+Pv1YPPOY1JjPGGESl+94tFkQWhq2/VR11Kjns73/77v5h8o47by1av3LB1PpaIylIVfwPPGsMQiYGjP xyEiu/Ot s2daMAmHgYau9UyHa61m55E5+CY+aEqAdzi0eQNS1b8JXT5avWhtvKlZLX/5Ky6iwwbnQb7H9hryM4BOSg5X2a61XT9GEZvaPu1tWbVtdMO16Pv/w5oDrAt2sfdZY9nomHB2ABiG/ZK/uv5zKYze2YDJgL95xBL8P2CORSHsorjnKBG6H+l8XFbu99qeUmy5BN0P3vbm+EZ/DQn9PRGtFQz6A5+Ak08L95we0WiIpe6nkdVJPRD++T/t1JnyNHkTI5Obn0isrz7O6jHeCdR6XpxFZLmZeHCRfgp/lVW2rHb9yk+9Q9vt2y1dSBG4kdZEuyj7sztzkMJUPCWhLBYTbnXdkPXIPdnBFoWS9hA5IplrVes/IOGtnMdRDoqmgUugEy4VWRfeE5d9G5YFHTmqZKwpJV+af5+ZC1PY8/gS8A7skgXuvCpJyV3RGCTCk8Y6fYxowd458bDJfzUdgXSA8to+mAqG5CYqfFBpu X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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) */