<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Oct 27, 2026 at 11:53 PM Stephen Hemminger <<a href="mailto:stephen@networkplumber.org">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">LTO build with -Werror reports stack overflows in tf_msg.c:<br>
<br>
In function 'tf_global_cfg_set':<br>
rte_memcpy.h:91:9: error: writing 16 bytes into a region of size 8<br>
tf_msg.c:1574:45: note: at offset 48 into destination object 'req'<br>
of size 56<br>
<br>
In function 'tf_msg_set_if_tbl_entry':<br>
rte_memcpy.h:105:9: error: writing 32 bytes into a region of size 0<br>
tf_msg.c:1813:41: note: at offset 136 into destination object 'req'<br>
of size 128<br>
<br>
tf_msg_set_global_cfg() limits config_sz_in_bytes to 16, but<br>
req.data and req.mask are each 8 bytes. A config larger than 8 bytes<br>
overruns data into mask, and the mask copy runs off the end of req.<br>
<br>
tf_msg_set_if_tbl_entry() has no check at all. data_sz_in_bytes is a<br>
uint16_t copied into the 88 byte req.data. The ULP mapper fills it<br>
from a blob of up to 128 bytes.<br>
<br>
Check both against sizeof() of the destination, as the matching get<br>
functions already do.<br>
<br>
Fixes: 98487d729b4a ("net/bnxt: cleanup and refactor session management")<br>
Cc: <a href="mailto:stable@dpdk.org" target="_blank">stable@dpdk.org</a><br>
<br>
Signed-off-by: Stephen Hemminger <<a href="mailto:stephen@networkplumber.org" target="_blank">stephen@networkplumber.org</a>><br></blockquote><div><span style="font-family:Calibri;font-size:11pt;background-color:transparent">Acked-by: Kishore
Padmanabha <<a href="mailto:kishore.padmanabha@broadcom.com">kishore.padmanabha@broadcom.com</a>></span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
drivers/net/bnxt/tf_core/tf_msg.c | 6 ++++--<br>
1 file changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/net/bnxt/tf_core/tf_msg.c b/drivers/net/bnxt/tf_core/tf_msg.c<br>
index aab8d05d81..ab03afaabd 100644<br>
--- a/drivers/net/bnxt/tf_core/tf_msg.c<br>
+++ b/drivers/net/bnxt/tf_core/tf_msg.c<br>
@@ -23,7 +23,6 @@<br>
* means we have to manually sync hwrm with these defines if the<br>
* tf.yaml changes.<br>
*/<br>
-#define TF_MSG_SET_GLOBAL_CFG_DATA_SIZE 16<br>
#define TF_MSG_EM_INSERT_KEY_SIZE 64<br>
#define TF_MSG_EM_INSERT_RECORD_SIZE 96<br>
#define TF_MSG_TBL_TYPE_SET_DATA_SIZE 88<br>
@@ -1618,7 +1617,7 @@ tf_msg_set_global_cfg(struct tf *tfp,<br>
req.offset = tfp_cpu_to_le_32(params->offset);<br>
<br>
/* Check for data size conformity */<br>
- if (params->config_sz_in_bytes > TF_MSG_SET_GLOBAL_CFG_DATA_SIZE) {<br>
+ if (params->config_sz_in_bytes > sizeof(req.data)) {<br>
rc = -EINVAL;<br>
TFP_DRV_LOG(ERR,<br>
"%s: Invalid parameters for msg type, rc:%s\n",<br>
@@ -1816,6 +1815,9 @@ tf_msg_set_if_tbl_entry(struct tf *tfp,<br>
struct tf_dev_info *dev;<br>
struct tf_session *tfs;<br>
<br>
+ if (params->data_sz_in_bytes > sizeof(req.data))<br>
+ return -EINVAL;<br>
+<br>
/* Retrieve the session information */<br>
rc = tf_session_get_session(tfp, &tfs);<br>
if (rc) {<br>
-- <br>
2.53.0<br>
<br>
</blockquote></div></div>