From patchwork Tue Nov 26 07:55:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: ChenQi X-Patchwork-Id: 53209 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BF56D5A6ED for ; Tue, 26 Nov 2024 07:55:51 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web11.41054.1732607750256288534 for ; Mon, 25 Nov 2024 23:55:50 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=10608bb639=qi.chen@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AQ5DvKD021849 for ; Mon, 25 Nov 2024 23:55:49 -0800 Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 433feq2k6m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 25 Nov 2024 23:55:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c3kctzGTZE6U5EaNBfITWx86MI/+YGPxslIDkg7TRi8RoFNl7A6+M0zYxMuvDm5+BYzvQvj0CHFWRIvwcsQv93B6umhN8CBMe/Z0UULg2SZWLQH8Mey81clok3TdfA0bYGfVNgKASZF4O7ctvXofoR4eimBiOrzrtnhdwo4uocZ2EufkNK2nWiBvh/XtFao4QcxD1a07swMWXglCoHwauBZRFQai13oXTVZrrr7f33DrhRD4lJekWl28CzlbE+fwvYpQi/wD1SvqNggYLWLq3+CFPoS52R/gV/SHHv6T3p3B4sn6eRwfxyFP4kqIeWM1kEaYYr/eSgZBEOGi49RexQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rPYXcc4Lw37MLZnDrwZQZTL7NVYBdx9erOL/JVA2M7I=; b=nWQHdnusRfz6gkqYZDhSMK8xzEoFSVUbMPfpZlgDyXxYqHNuEP2zXySqjEXO10ujeWrXmvl5qg1P1LifdKrlKgggtzP4Sgd2bileieNLdzhPZrtpkiL4dV3KukDqAP5IpxWEmaVOpDg+vQcajYC7qE/NjAJ0eqi168T8IBL3CVBfkEoN0oisbxIVFWqLrLWJn6+/KuEhGNiOuqKPGcYAq6nlY+XAUQ8xwX6OPvuqtm9I6F7KKHm12c1bWJHTr2Q0U3M4GxrOjHiE6vn/AwbhEOphTkyGE4tgMl9uzv6znlH9d/4BTuY5F9c5wbl+eAGCmhPQHdg5nkjYdb00RpWuZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from CO6PR11MB5602.namprd11.prod.outlook.com (2603:10b6:303:13a::5) by DS7PR11MB6293.namprd11.prod.outlook.com (2603:10b6:8:97::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Tue, 26 Nov 2024 07:55:44 +0000 Received: from CO6PR11MB5602.namprd11.prod.outlook.com ([fe80::a7e3:721d:9cec:6093]) by CO6PR11MB5602.namprd11.prod.outlook.com ([fe80::a7e3:721d:9cec:6093%4]) with mapi id 15.20.8182.019; Tue, 26 Nov 2024 07:55:44 +0000 From: Qi.Chen@windriver.com To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone][PATCH] coreutils: fix CVE-2024-0684 Date: Mon, 25 Nov 2024 23:55:34 -0800 Message-Id: <20241126075534.2340778-1-Qi.Chen@windriver.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: BY5PR03CA0013.namprd03.prod.outlook.com (2603:10b6:a03:1e0::23) To CO6PR11MB5602.namprd11.prod.outlook.com (2603:10b6:303:13a::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR11MB5602:EE_|DS7PR11MB6293:EE_ X-MS-Office365-Filtering-Correlation-Id: bc45fa07-5e72-47b7-05f8-08dd0defbafa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?6KCSm7cslt1OsmONyslUYbCZLCCHEUq?= =?utf-8?q?+GdyCRXWvzbQujQtB20VoAgBCJXIQ0duhUtNhjrgN3Rh5TgVCq6VjNfh6lnnyki7C?= =?utf-8?q?5leX1QEANQ+r1y3SHzg2rNrlHWtkJRxADBKd8IGmq8hMQfdWC3Uj7QRBShuU9sDIY?= =?utf-8?q?UF1B6Rka7WsCylF5GwGFu1uNWVCyeR8thBbdB29g9vwLFg6uRUn+AQpIpKVilHdRh?= =?utf-8?q?lY4Lsb8PRGqntawD5LPeHNvo92n5zIktLlT/NK6NvO1Sla6M8Z9TBpr37fcngS/9J?= =?utf-8?q?qg+afm0o2zjpF6Tg3lo5yO96FVSeX+p16aWPupbDPZ26wXPISfXNEKa4JhBzCEo/q?= =?utf-8?q?y6Ola1ay4AukBnmbtsd8dn46j8mAyfdq98SXvAAmU1Io9FJlz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L96cu9SVg4mVuds?= =?utf-8?q?ELcCq1iko08/5rcEAGQ5yqc443Jg+xZzuRcpU9ji8pTaR6frHquA4C0bee4ynpcnK?= =?utf-8?q?hxrletqGtcbfvmgWRW52FFJdI/fpasqsvg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR11MB5602.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9ZbW4aTaMsxii/Ali3OGQc9LwJL8?= =?utf-8?q?DURfMfdlOS6/PCycRg6kSGna10wBhepoWYpTlbRAh6i0dWIRaOgSozZqrprmdJMdJ?= =?utf-8?q?PBzki+HtCfd6qd/W+GoIfcO3Koh9mvnQNZ8njcLvvTtEWFcHrNDGikylsnaHfz4s3?= =?utf-8?q?Tjj49kHXAPt6aAbvOtvH3kd/AM5OHeYc9uTsRen0nxRSt7fXAdRPyH33wuRQt9z88?= =?utf-8?q?Pc6iXCLdmZXNiR0bFxW+Oqdn+WWMnthtZ7zQE+ko7oau+ls3s6scLownR1ABX5Bu+?= =?utf-8?q?ZRrlRggM0qnWnwqM2kh3vEYui4HdjnJYCe7+sdzuPEqAEkLJMOkYhDmvlesEJq6Q3?= =?utf-8?q?rE5zljWdKQf6lKKQFH83jhNMHbaKX6yFDqSe2spKZ5nUGNUvKB1KOMhOpLA2ojjkF?= =?utf-8?q?sv7eUNhsjwVq2YJT4Hv/S6JlZvyt5ZPcXP3CzuLYL5+3I/yDyeUIDNqOHLSQ7c/WV?= =?utf-8?q?l2ppb7u4Qktf0YbLrnaMpUkQ5rH/NQR5sfVxilSSeV9twqLC0TXjeC0FqmpsHBH9M?= =?utf-8?q?DgofdEBfLcwEFgsJAZXd8g+E9gevfF6BoK7j40x8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2DZBhoqNNF5atSsK5VGmaDM?= =?utf-8?q?c42ojr22H3DvG+hrb8WJN2nf7nHK4VIh390tveQUsLwzVJbCvx0yIs9vd4d2qnxEN?= =?utf-8?q?KHGIuR/bYkmK?= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc45fa07-5e72-47b7-05f8-08dd0defbafa X-MS-Exchange-CrossTenant-AuthSource: CO6PR11MB5602.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 07:55:44.2642 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ryXi5HIcY4LCTC6yCFmneXhb1TwpI2Q/ECv69dCLEZ8AGN/O/FYtXXTqVCdMKbfDryM5aCTGrW9tz6TIm+f0vA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB6293 X-Authority-Analysis: v=2.4 cv=c+L5Qg9l c=1 sm=1 tr=0 ts=67457f05 cx=c_pps a=/1KN1z/xraQh0Fnb7pnMZA==:117 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=VlfZXiiP6vEA:10 a=bRTqI5nwn0kA:10 a=t7CeM3EgAAAA:8 a=ENYW0vS-B00P3n3B2IkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=JM4-IM7dGyYZWQGaSAIV:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: _yu0QQzuB2VX19Gp8KRPCmH-CDclTimv X-Proofpoint-GUID: _yu0QQzuB2VX19Gp8KRPCmH-CDclTimv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-11-26_06,2024-11-25_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 clxscore=1015 priorityscore=1501 adultscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.21.0-2409260000 definitions=main-2411260063 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0064b401.pphosted.com id 4AQ5DvKD021849 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 26 Nov 2024 07:55:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/207841 From: Chen Qi Backport patch with tweaks for the current version to fix CVE-2024-0684. Signed-off-by: Chen Qi --- ...0001-split-do-not-shrink-hold-buffer.patch | 42 +++++++++++++++++++ meta/recipes-core/coreutils/coreutils_9.0.bb | 1 + 2 files changed, 43 insertions(+) create mode 100644 meta/recipes-core/coreutils/coreutils/0001-split-do-not-shrink-hold-buffer.patch diff --git a/meta/recipes-core/coreutils/coreutils/0001-split-do-not-shrink-hold-buffer.patch b/meta/recipes-core/coreutils/coreutils/0001-split-do-not-shrink-hold-buffer.patch new file mode 100644 index 0000000000..3eab65dcf1 --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils/0001-split-do-not-shrink-hold-buffer.patch @@ -0,0 +1,42 @@ +From 80dca40bbb36b7b1630bb5a43d62b3ff21b4e064 Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Mon, 25 Nov 2024 23:43:49 -0800 +Subject: [PATCH] split: do not shrink hold buffer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* src/split.c (line_bytes_split): Do not shrink hold buffer. +If it’s large for this batch it’s likely to be large for the next +batch, and for ‘split’ it’s not worth the complexity/CPU hassle to +shrink it. Do not assume hold_size can be bufsize. + +CVE: CVE-2024-0684 + +Upstream-Status: Backport [c4c5ed8f4e9cd55a12966d4f520e3a13101637d9] + +The original patch is tweaked to fit the current version. + +Signed-off-by: Chen Qi +--- + src/split.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/src/split.c b/src/split.c +index 4b1b144..e44e867 100644 +--- a/src/split.c ++++ b/src/split.c +@@ -785,10 +785,7 @@ line_bytes_split (uintmax_t n_bytes, char *buf, size_t bufsize) + { + cwrite (n_out == 0, hold, n_hold); + n_out += n_hold; +- if (n_hold > bufsize) +- hold = xrealloc (hold, bufsize); + n_hold = 0; +- hold_size = bufsize; + } + + /* Output to eol if present. */ +-- +2.25.1 + diff --git a/meta/recipes-core/coreutils/coreutils_9.0.bb b/meta/recipes-core/coreutils/coreutils_9.0.bb index 8a2fbeca32..1cce9192ec 100644 --- a/meta/recipes-core/coreutils/coreutils_9.0.bb +++ b/meta/recipes-core/coreutils/coreutils_9.0.bb @@ -20,6 +20,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \ file://0001-local.mk-fix-cross-compiling-problem.patch \ file://e8b56ebd536e82b15542a00c888109471936bfda.patch \ file://run-ptest \ + file://0001-split-do-not-shrink-hold-buffer.patch \ " SRC_URI[sha256sum] = "ce30acdf4a41bc5bb30dd955e9eaa75fa216b4e3deb08889ed32433c7b3b97ce"