bus/dpaa: fix outside array bounds error with GCC v13
PATCH 1/1 bus/dpaa: fix outside array bounds error with GCC v13
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
--- drivers/bus/dpaa/base/qbman/qman.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/bus/dpaa/base/qbman/qman.c +3 -2
@@ -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);
Signature · 1 line
2.25.1
Quoted 55 lines · Gagandeep Singh
Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button
when
RTE_ENABLE_ASSERTis 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")Signed-off-by Gagandeep Singh <[email protected]>--- drivers/bus/dpaa/base/qbman/qman.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/bus/dpaa/base/qbman/qman.c +3
-3@@ -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
Jerin Jacob
Acked-byQuoted 2 lines · Hemant Agrawal
Acked-by Hemant Agrawal <[email protected]>
Quoted 57 lines · Gagandeep Singh
Quoted 55 lines
Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button
when
RTE_ENABLE_ASSERTis 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")Signed-off-by Gagandeep Singh <[email protected]>--- drivers/bus/dpaa/base/qbman/qman.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/bus/dpaa/base/qbman/qman.c +3
-3@@ -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
David Marchand
AppliedQuoted 9 lines · Gagandeep Singh
when
RTE_ENABLE_ASSERTis 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.
Quoted 7 lines
Bugzilla ID: 1233
Fixes c47ff048b99a ("bus/dpaa: add QMAN driver core routines")Signed-off-by Gagandeep Singh <[email protected]>Acked-by Hemant Agrawal <[email protected]>Acked-by Jerin Jacob <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand