From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C38DE42ED5 for ; Fri, 21 Jul 2023 07:28:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B419B427F5; Fri, 21 Jul 2023 07:28:44 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2073.outbound.protection.outlook.com [40.107.21.73]) by mails.dpdk.org (Postfix) with ESMTP id 6854E40DD8; Fri, 21 Jul 2023 07:28:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g8h4oUWgRpGTHgKTMxy+I1EKu7Z9UrKCJk5dahXhG7RTD4MilkY9yEMxPCg+vq/UEaZAE0elOvF01QpemdpjycFrS3bJJeEInfStH4ZW6hJVM6Rkme495sbrZGgFX/EHLh9GohLMfQLHEQLgD/jnmaI/4dZ7jSjReY8nUgLCdjKvcYuS2kt2k592QjhazYLgdckiARd/JqK8LLZgyArdBMBManERCs4W413LXxCba7TEZ9QA/FBYMTeZFRYtmb1b6xKh0SbzV7Og9X1x6cfef0Zs0mFQi9TB0Ogae0TgUCWZ6brWHIGTl9PyazpxGAJcOeN2B86wAk2pjqAOwMG0eQ== 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=SWsvCjwOI3kh95KppTZK0Slr5yXh0KeJk0xANCk+78Y=; b=Eg9oTTxYdg5ylm8+h4LJ+DB9oLTfDyp6jPeMWbSf1V7HcA111K1zMbbaQii/GmESB3dVXrrpeZLbOW+Ochycn/VElWuR13UGym4mZOY1T0xnpYoBHVVAcTSBbJ+4NgiIn6WQcLyGX31g0wf66vJpkLAaQ2t9oWfDGPGZMFwxEsmXyJ5a2ZQ28hXrSPMMsm9mQkI8f89zWy2EfVheLlP8wBm1uu4SmZ3IcMni8oY1ReWYTAwhnUewwZfhUIvkPTm8gX65H/tc/zjZt9AboWa/1eDItnObsydEg92Pon9V4e8Qq5iIvxC+Xtlj3RmzrAU7ri9mPkX3CZReeJmcAenHDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SWsvCjwOI3kh95KppTZK0Slr5yXh0KeJk0xANCk+78Y=; b=XV+MtMXOvs9O8e2synhv2AlMGLa/5Zjzm7/vQEeGFMNDF+4yPQkog7jTBnLDVi7V+TC958TYpn1jlqkd8NKUokiVpM5DeJvmE+40LglZhLbYg3f7UotsECc8fyCYzTKUgbxQ2VnxwGCmNheuaD2Ry2sivBygt0ste4pLPHKX+yo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by PA4PR04MB7919.eurprd04.prod.outlook.com (2603:10a6:102:c1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 05:28:41 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::77bd:51fa:4812:99d3]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::77bd:51fa:4812:99d3%7]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023 05:28:40 +0000 From: Gagandeep Singh To: ferruh.yigit@amd.com, dev@dpdk.org Cc: jerinj@marvell.com, Gagandeep Singh , stable@dpdk.org Subject: [PATCH] bus/dpaa: fix outside array bounds error with GCC v13 Date: Fri, 21 Jul 2023 10:58:10 +0530 Message-Id: <20230721052810.2048437-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:1f4::15) To DB9PR04MB8202.eurprd04.prod.outlook.com (2603:10a6:10:24f::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|PA4PR04MB7919:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d18c363-fb9f-467d-0430-08db89ab570b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AV0e387UcgnNIOk3/n/fiwWHzYW/F47NaKoUv2Bz/vMxZ6B8+7snLvFZP3z2io7I9dJS+L+sl1UgpLWTlR25ncm3qkpGsIHmw7kmOq6vTIdTFHNrEJn7n3pfv5k1VGPk5DCMASASgzkXImPSmpHkR0RV0MMqZRQWlQXPeYaSR7qpMK00wFiNstvg81Rl4FSLn/BFx5yl40vOyECnV1g0wtqsuXaBDWkvpUI64qPIB3daqtJk/4s0rnvOdZZdzlhdIQTGF21VAfxo2co6HZpvdvW9qZ6N0Qf/Hmoox7HBkMJ7oK9unuupS+3pj+r25A4aM7Fl4J2zs7R3UyXYWUfDxVpEHP4gVwHwIQ0tFAiwHXol11tCgOO1D054esikoNjVWf4RFDgBWowlyA2EpEe6wwyRUTX/ricbsn/h3uE0VoLg3D0cx8sCTi1XCxpajWy6ZthPPRnRARe54p2wCHluOjzMmWS1QiAxP32vugTiPk4/7qb+7OaFxpeAxsTtLMcgCHneCRnRuVz5iF8odkEMkyBNpBsULMh2GcNe9fk1iO7jbBHfmqp0rQ0OPfoIiTBaQ4TdT3mlTfSygJjeOleRnSNzDfOSWLQyTfyCdIWv2HA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(376002)(396003)(136003)(39860400002)(346002)(451199021)(66946007)(966005)(6512007)(66556008)(6486002)(6666004)(66476007)(2906002)(8676002)(316002)(8936002)(4326008)(36756003)(38350700002)(5660300002)(6506007)(52116002)(2616005)(38100700002)(186003)(1076003)(26005)(41300700001)(83380400001)(86362001)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?J8Sj5wRst27uSYCMBK13Nao1bPmIC7fJGGMkc2aNpPl0UjB8q7Ah7YqDNIVV?= =?us-ascii?Q?YUBXA4c0JdP9j3v2opDKc95GnGKocF6aXOy7scdw5HCfm9iDeC4GB5LQOtmZ?= =?us-ascii?Q?e+/MguCgyvXvP8cXURkqleWNBB5hs2RJQqJbTrwoACMQ3pZTg8jTQz45w6oK?= =?us-ascii?Q?qf7uKVzEDRuVIRj5pzlvcWucv3n4BqZrKfKO2Kn8BBnkRR8vcAO8uWOr6YBe?= =?us-ascii?Q?K0LyNc1mudwfcfffWhCEjOAMx5ekFnD3myhgVXj6lOdzOAQv9qzFs94nSQSv?= =?us-ascii?Q?bCqbHVzd4PSagdmpouWgEyuNvRC78LRehslVXlRVdFWJldpCD7UHCCDclOMh?= =?us-ascii?Q?nDDonINvSBvsO8Hecpf1qlLs+SSPEsML2uFFLRM8ndjxNbH6WbfkqTuCsuG9?= =?us-ascii?Q?9Q/jpTlC6b2vHorDzd9MjMFXejtYIZO0xvlJl7a3DzOhuxuPy2v6yTxJu7b7?= =?us-ascii?Q?LKGwVXk01odxrQt+ngxb7gVY8sEkZReedGGuVGXbWKZGZ9s7/MTOBxm92yoT?= =?us-ascii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AQJ016ThTWkSwleQ3S?= =?us-ascii?Q?E2zmg02/lJiHcFRgfXvq1mK88e789QXka1BTXIbAz435tQuH55q1vfkrRwdV?= =?us-ascii?Q?7WFZ84tUH0kGOx5VAL2UF6RIYGFJwoLq7PDtX8hOOezixWV2jc1fgTWjE/ei?= =?us-ascii?Q?zcWwqLt8hyEYuP17DRpXSv5FI9B1HJJSoZs2C1Nt?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d18c363-fb9f-467d-0430-08db89ab570b X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8202.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 05:28:40.9419 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 19gyfDk5p+fslhc5XySIuuASjyhsyhxX8ekutI2gv7nWttNjf22BvQDylCLbqg2j X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7919 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org when RTE_ENABLE_ASSERT is enable, DPAA driver is doing wrong NULL check on frame queue which allows the code to have access to NULL address. GCC v13 is giving array bounds error if code is accessing any memory region less than 4KB. This patch fixes this issue by adding proper NULL checks on frame queue. Please refer: https://bugs.dpdk.org/show_bug.cgi?id=1233 Bugzilla ID: 1233 Fixes: c47ff048b99a ("bus/dpaa: add QMAN driver core routines") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- drivers/bus/dpaa/base/qbman/qman.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 3949bf8712..83db0a534e 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) * * Copyright 2008-2016 Freescale Semiconductor Inc. - * Copyright 2017,2019 NXP + * Copyright 2017,2019-2023 NXP * */ @@ -897,7 +897,7 @@ static u32 __poll_portal_slow(struct qman_portal *p, u32 is) /* Lookup in the retirement table */ fq = table_find_fq(p, be32_to_cpu(msg->fq.fqid)); - DPAA_BUG_ON(!fq); + DPAA_BUG_ON(fq != NULL); fq_state_change(p, fq, &swapped_msg, verb); if (fq->cb.fqs) fq->cb.fqs(p, fq, &swapped_msg); @@ -909,6 +909,7 @@ static u32 __poll_portal_slow(struct qman_portal *p, u32 is) #else fq = (void *)(uintptr_t)msg->fq.contextB; #endif + DPAA_BUG_ON(fq != NULL); fq_state_change(p, fq, msg, verb); if (fq->cb.fqs) fq->cb.fqs(p, fq, &swapped_msg); -- 2.25.1