Message ID | 40002e888f5b950c07b0bff781f151771fcd0f10.1666877952.git.szabolcs.nagy@arm.com (mailing list archive) |
---|---|
State | Committed |
Commit | b866018f54ad0670ee9b930a14ae6e8960b9f4bf |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E0849392AC37 for <patchwork@sourceware.org>; Thu, 27 Oct 2022 15:38:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0849392AC37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666885115; bh=5v9AXkbBVtDKrUrJb3LgNxpRHfkr0ob0lZUqLnMD/2o=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=m3EOsbRaIkZIo/Tz6f0tji3rbBllsOhOzP5J7UrVOqdfDX2X1xUKdsGoH1JXjPvMI Uv81PlXQ6Fq3nPDzNBD3LboNxYPu1ze3FhVfJCXwHB10AJEkjSdkmMiBR4+C5dHEMO wlmSAX3VKasy0wbCwWXeLWMifYGulgx5T5VTlhAw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70078.outbound.protection.outlook.com [40.107.7.78]) by sourceware.org (Postfix) with ESMTPS id D3CA838983A9 for <libc-alpha@sourceware.org>; Thu, 27 Oct 2022 15:33:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3CA838983A9 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=GeHQqzywGG1GVDx3KszBxJaGnh/y8EtB75fk/apoLDOb4H38XMxRpCeUjPGUtPe5cHaUwIss2OvT7Nb0SF/SeTiFpQ029PtWHGgki95JRRgSmbrwwusm6f75or37EQUI/EMLfyuLesQc/vi12SZvPzLQwLJad0RZ3MvnSrpVYBV2u71PnD7VX5MqBLe//AhX7cMrSxa0L0B1sDB4VKIpACwdyCFIDXfqLxixhhtQ460nZL5dMe40ubK9a3xm0wuk5GD/o+fBEZvrSSrSk46tGkKAmGCqN93tx8A+2m7n8/tU9dwSDzPlb7tuwhtbZ4Ojl2SwoGpWwWoUEU9do5swXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=5v9AXkbBVtDKrUrJb3LgNxpRHfkr0ob0lZUqLnMD/2o=; b=RsxhB5i7SrCK36D+kD2bxTousa9QLh4hRUmE4sHhkzkQuCxKi5TnESrnOACp6BvNMKR9D1NsHlQffrEH+g2Q787WKqYc1y0OtASREqHdiECOlyQYhv73f/7Lwb50aCTYe8PmWTgkZi5aV2i7ZXAfN7BGe4/lpRThqaCgvxkuOXL28hgJ7Wb3+BzMDrwRn7udphdHEua0WLPVtcbqmZGUA+01JjBRgkMcMeHs1Lce6ruJrlRQ/Q1BRlmV7eDqpflc/xlTUmm0eFvhhD4jWLDScizO/BujpCZlb4Sd/WX0G3y1AdZ3AhQBHfT948h24MluWiw3tSzUiNvYmsLNIRX+MA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1, 1, smtp.mailfrom=arm.com] dmarc=[1, 1, header.from=arm.com]) Received: from DB6P195CA0006.EURP195.PROD.OUTLOOK.COM (2603:10a6:4:cb::16) by AS8PR08MB7885.eurprd08.prod.outlook.com (2603:10a6:20b:508::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Thu, 27 Oct 2022 15:33:53 +0000 Received: from DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:cb:cafe::4d) by DB6P195CA0006.outlook.office365.com (2603:10a6:4:cb::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Thu, 27 Oct 2022 15:33:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT062.mail.protection.outlook.com (100.127.142.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Thu, 27 Oct 2022 15:33:53 +0000 Received: ("Tessian outbound f394866f3f2b:v130"); Thu, 27 Oct 2022 15:33:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 42a96ccdeef6a0f4 X-CR-MTA-TID: 64aa7808 Received: from 0cfd5ea9c21e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F47DDEEE-88AA-4A5E-9700-66FAAE2777A1.1; Thu, 27 Oct 2022 15:33:46 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0cfd5ea9c21e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 27 Oct 2022 15:33:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nme+3oYkwR+DwzCoggXQF8ORXVdhRQ2zR5Gh55VWxhFRGESg+cc4iM2mNDXEKFBQWYCcAwtm7kWqaQqyJ1gKLCPCh5mC1Bc/1VVdQMov9xnI9FJfdakAa8a34LG/mNZY9rZZskj1mElRzCD/2RGMb8afGHErbHSjAsQCZa4qBBlUPrf8TmFMBsPUjeZ6EXDkn9w7auShbBgRG+n423VVmblEYdzZljL2z2Yr6zpVXxGb8jhSF1FxzFe40lQL44h4kaHnfqW5ghLhDQZFy3vrFbitoaMDP7zR6dnhC2OP6/ZGWnnML3k+Dhdw5LeCE8DC1G7FOOCnEvgn4r25M4AFBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=5v9AXkbBVtDKrUrJb3LgNxpRHfkr0ob0lZUqLnMD/2o=; b=iE3Is+b71YtJvHyiJeoi35kQo+R53hYlYMBHXSfloQdGjfZ8mVELvVq9CBeSmczG9WdJGk4xmqZclwy6hElylfapd8DAhxbXcJ1jUyK92N6uWJC3Avnvj2dPz7rl/fo4rDWNZ8UOS3TO2TSPZGyERnpwxTNVEvONGraRh7B00pKx2f7WwavEgpQNwuMG0hkfNlSREbEMjowxt0R94XKkDPVDEQ/h2QUh3HSkioevO7WYNe+uy4f4mtjUD6DedrMNxZIH1vFDs1n4ncwB5duXLucLWNO9BpDuEb474D4yVpkPdjzeQUMEXAKKdGJkAnFHvx/O5aA1NA8PvXjR/fOE0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from DB6P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::20) by AS8PR08MB6182.eurprd08.prod.outlook.com (2603:10a6:20b:291::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Thu, 27 Oct 2022 15:33:43 +0000 Received: from DBAEUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:28:cafe::91) by DB6P191CA0010.outlook.office365.com (2603:10a6:6:28::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Thu, 27 Oct 2022 15:33:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT016.mail.protection.outlook.com (100.127.142.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5709.10 via Frontend Transport; Thu, 27 Oct 2022 15:33:43 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 27 Oct 2022 15:33:43 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 27 Oct 2022 15:33:43 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 27 Oct 2022 15:33:42 +0000 To: <libc-alpha@sourceware.org> Subject: [PATCH 17/20] Fix missing NUL terminator in stdio-common/scanf13 test Date: Thu, 27 Oct 2022 16:33:42 +0100 Message-ID: <40002e888f5b950c07b0bff781f151771fcd0f10.1666877952.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1666877952.git.szabolcs.nagy@arm.com> References: <cover.1666877952.git.szabolcs.nagy@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT016:EE_|AS8PR08MB6182:EE_|DBAEUR03FT062:EE_|AS8PR08MB7885:EE_ X-MS-Office365-Filtering-Correlation-Id: 838aafad-03d6-4a03-74a4-08dab830a788 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6MtNlOHtiqmI2ULLOZp0GofSHWddAFPDth07nqZ5Ek+3iZ0l8E0Pd8eniLtstQpGX9o28P/IVxVQ2my3qTKr8TeY56aZbecPhslq3TT3wlZSVFEMFP3E2r68fgVdL+qozx6VUjjtFTeuBnLMfcPsjPMkYPSoglUoPJ0yF6/1wzvWZ6yOsRFg38PCsUVmWQXqBtyJekfECmkuN7iyZei/LgopkSy99uoswgFkKFL0kbSH7OTAjJQFj80k0PePkosJsNoYiceN5R4QP3wgD+COiyRNLHMn4LnNuF4gl+XRbQFwMsLkmiADYIaOOPaGcrdH+U8OpsWgxmGXIaCnS1aCJJ2zFRnyqA1nU+5ix7pD1RWTnZN3bfv+7d9MxncIoXsS3XbSNONUHI75/Uqq4pHdKNQ+9BVQVG5tUM4GwA3+g/rueAbb8LWfAgTuuLnIiScgIKZNzpmHWdYZsKXBwDz3mfGpJbksVWCTkdG2KojnYVbVtek40vBSg/6mLqZpfScvVL+HarTCThyk2pq4Thqlsm12IWEoG6wUFVq2bkSJ2RN9F4HFXDavjlBaXlGFvAewGpNNSDnFi6SQ/7OJxWxXdtKaBu6Cx0xMG2L+EPj6IEiAVOKDT5HaCUu86EXdQzTIfDM1pqgN0Dno/RMt+RaqmI3TNNtJLZ2O5DhnM/yEetVtOgrk56a44Z/uiL7NGxzqqqf38n4Z9BxyGvf/cg+IMzRqBGzIMtIkYXmig8/QxV5tuTUWgEoNuyV32dj5kJOkYXXA7nQMkq0HQL9TbhsWbQxQeT+zQhJUmQR1cxcmdTE= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199015)(46966006)(36840700001)(40470700004)(6916009)(5660300002)(4744005)(41300700001)(26005)(70206006)(70586007)(7696005)(36756003)(316002)(356005)(82740400003)(81166007)(82310400005)(47076005)(2906002)(426003)(40480700001)(8936002)(36860700001)(8676002)(2616005)(40460700003)(44832011)(336012)(86362001)(478600001)(186003)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6182 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0160c1c7-1a19-4c40-70e7-08dab830a184 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KzNIVU2p7TcqN/owlrHBJtVC2YlxaJTgpwysMC704F1j+uUi0okYm4UOe0eVu28fJqTkY4Cut6BoULwwm499GY2QWYe1733CefuRyRk3J8Pt+7oUR4ejKUkGq4bXKMB7/25aYZSnW/Vd2PS5LtA0WPlnBzJOmHnkOVxNh8NjiQ0bccFoqtmYMCaVPkSr5SXMEs0qAgJtNrNvxBkmzzuzuLCylDeqRB+G18P0wIiWa+It0nuOLsnuE9Z/rEgMkE8DeRg1axqFVxIgpbiVEHLkpHL9nrqysHUfbjqNkk6jsfuzgz4mvcUtqnY8kEgitgC5hiVyxD6bJpnZFoUa+XkHdF62fLD8Blyi0a3Kr/S+YYDZdZpNUJqI5VGsMRAsskeYP4Dt4+Wd6bW7McmC0J4mNjunUFNEULCNyQlW0sZrrIlDMHCylAL0LQcAUA8wAVbdWKf1+168f3V3KKVHvWzjGvOs+cooFYmmwRXU+kmtQjbLt7AeHJ1wrC5s55c96sSJn2cFxrfO/UgBV7cYKvyRQ7HmSvp7pc0ysjFLK54W723z20tMuTcEA2JPNbBeojTSpq8be6PI/uS0iPv7Sly6HjpJyYYK6+01pOt8/3EXlgni3tRVlkLGkxnniG4FVW2GhT9v8vBMQpehF2K925xA9ymNmC1dhlqtvJXdn8NfrdHzsnBsc99T0XUzkUL4QofWvBszaKq/YzktnhrsZS/h6Mblk0TuQp+l8F1BzFpOucbHSn4tAQzTNunzvgPAViTrG8F58DHHXnxay8/2vohtyw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230022)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(82740400003)(186003)(36756003)(336012)(86362001)(81166007)(36860700001)(478600001)(2906002)(47076005)(8676002)(41300700001)(82310400005)(40460700003)(70586007)(7696005)(5660300002)(316002)(8936002)(4744005)(70206006)(2616005)(44832011)(26005)(426003)(40480700001)(6916009); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2022 15:33:53.4869 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 838aafad-03d6-4a03-74a4-08dab830a788 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7885 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Szabolcs Nagy via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Szabolcs Nagy <szabolcs.nagy@arm.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
patches from the morello port
|
|
Checks
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Szabolcs Nagy
Oct. 27, 2022, 3:33 p.m. UTC
sscanf is only defined on nul terminated string input, but '\0' was missing in this test which caused _IO_str_init_static_internal to read OOB on the stack when computing the bounds of the string. --- stdio-common/scanf13.c | 1 + 1 file changed, 1 insertion(+)
Comments
* Szabolcs Nagy via Libc-alpha: > sscanf is only defined on nul terminated string input, but '\0' was > missing in this test which caused _IO_str_init_static_internal to > read OOB on the stack when computing the bounds of the string. > --- > stdio-common/scanf13.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c > index 720224aa05..60aa62a26f 100644 > --- a/stdio-common/scanf13.c > +++ b/stdio-common/scanf13.c > @@ -67,6 +67,7 @@ main (void) > buf[2049] = 0x84; > buf[2058] = '\t'; > buf[2059] = 'a'; > + buf[sizeof (buf) - 1] = '\0'; > if (sscanf (buf, "%ms%mc", &sp1, &sp2) != 2) > FAIL (); > else We want this test to be correct (see bug 17577), but for now this is the right change. Reviewed-by: Florian Weimer <fweimer@redhat.com> Thanks, Florian
diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c index 720224aa05..60aa62a26f 100644 --- a/stdio-common/scanf13.c +++ b/stdio-common/scanf13.c @@ -67,6 +67,7 @@ main (void) buf[2049] = 0x84; buf[2058] = '\t'; buf[2059] = 'a'; + buf[sizeof (buf) - 1] = '\0'; if (sscanf (buf, "%ms%mc", &sp1, &sp2) != 2) FAIL (); else