-
Notifications
You must be signed in to change notification settings - Fork 40
Sync with Main Branch #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… on LAN and WAN due to webconfig post (#139) Reason for change: wanmanager crashes when webconfig blob request is processed. Test Procedure: Updated in Jira. Risks: none Priority: P2 Signed-off-by: [email protected] <[email protected]>
…d eth_wan_mac value is not updated (#138) Reason for Change: BPI Device Mac is not getting updated in eth_wan_mac sysevent and in AdvSecurity logs Test Procedure: Build should get compile and eth_wan_mac value should be board MAC address Risks: Low Signed-off-by: ksaipr036 <[email protected]>
* RDKBDEV-3234: remove dependency on dbus Reason for change: remove dependency on dbus Test Proedure: Sanity. Risks: None. Signed-off-by: Andre McCurdy <[email protected]> * Update Makefile.am --------- Signed-off-by: Andre McCurdy <[email protected]> Co-authored-by: Andre McCurdy <[email protected]> Co-authored-by: Augusto S. Mainardi <[email protected]>
* Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c * Update wanmgr_rdkbus_apis.c --------- Co-authored-by: Augusto S. Mainardi <[email protected]>
* RDKB-58521 : WAN Manager Telemetry Markers 2.0 - Phase 1 Reason for change: Implementing Telemetry support for Wanmanager. Scalable to handle further telemetry versions Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> * RDKB-58521 : WAN Manager Telemetry Markers 2.0 - Phase 1 Reason for change: Implementing Telemetry support for Wanmanager. Scalable to handle further telemetry versions Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> --------- Signed-off-by: [email protected] <[email protected]> Co-authored-by: Augusto S. Mainardi <[email protected]>
…XLE connected on Port 4 (#143) * CMXB7-6291:Gateway operation mode changes from Docsis to Ethwan when XLE connected on Port 4 Reason for change: Added logic to execute ti_udhcpc if intel flag is defined. Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> * CMXB7-6291:Gateway operation mode changes from Docsis to Ethwan when XLE connected on Port 4 Reason for change: Added logic to execute ti_udhcpc if intel flag is defined. Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> * CMXB7-6291:Gateway operation mode changes from Docsis to Ethwan when XLE connected on Port 4 Reason for change: Added logic to execute ti_udhcpc if intel flag is defined. Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> * CMXB7-6291:Gateway operation mode changes from Docsis to Ethwan when XLE connected on Port 4 Reason for change: Added logic to execute ti_udhcpc if intel flag is defined. Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> * CMXB7-6291:Gateway operation mode changes from Docsis to Ethwan when XLE connected on Port 4 Reason for change: Added logic to execute ti_udhcpc if intel flag is defined. Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> * CMXB7-6291:Gateway operation mode changes from Docsis to Ethwan when XLE connected on Port 4 Reason for change: Added logic to execute ti_udhcpc if intel flag is defined. Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> * CMXB7-6291:Gateway operation mode changes from Docsis to Ethwan when XLE connected on Port 4 Reason for change: Added logic to execute ti_udhcpc if intel flag is defined. Test Procedure: Updated in Jira. Risks: none Priority: P1 Signed-off-by: [email protected] <[email protected]> --------- Signed-off-by: [email protected] <[email protected]>
* Update wanmgr_rdkbus_apis.c --------- Co-authored-by: Augusto S. Mainardi <[email protected]>
Update CODEOWNERS
…lover. Reason for change: RDKB-59763 - Develop that US acceptance criteria. Test Procedure: Build should passed WANManager functionality should work without any issue Risks: Medium Signed-off-by: LakshminarayananShenbagaraj <[email protected]>
…spot Failover." This reverts commit e8c147d.
wanmgr(dhcp): guard MAP-T field in DHCPv6 lease debug print Wrap the maptAssigned field and its printf argument in copyDhcpv6Data() with #ifdef FEATURE_MAPT, and adjust the format/argument list accordingly. This prevents a format/argument mismatch and allows successful compilation when FEATURE_MAPT is not enabled. Signed-off-by: Parthiban Selvaraj <[email protected]>
Deploy cla action
* RDKB-61835 : Update Ipv6 sysevents when Ipv6 configured. Signed-off-by: Parthiban Selvaraj <[email protected]> * Changing buffer size --------- Signed-off-by: Parthiban Selvaraj <[email protected]>
…ent name (#153) T2 component initialising Signed-off-by: [email protected] <[email protected]> --------- Signed-off-by: [email protected] <[email protected]>
…#148) Reason for change: CellularManager handles both usb0 and wwan0, thus avoiding the copy of wwan0 interface name Test procedure: Tested RNDIS USB tethering feature Risks: Low Signed-off-by: Manigandan Gopalakrishnan <[email protected]>
| { | ||
| if(strlen(MarkerArguments)>0) | ||
| { | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER,sizeof(MarkerArguments)); |
Check failure
Code scanning / CodeQL
Potentially unsafe call to strncat Critical
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
The fix is to ensure that each call to strncat never appends more than the free space left in the destination buffer, including reserving space for the terminating null byte.
- For all calls of the form
strncat(MarkerArguments, src, sizeof(MarkerArguments)), replace the last argument with the available free space:BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1. - Because multiple appends occur in sequence, we must recalculate the remaining space after each append.
- To avoid repeatedly recalculating, store
size_t remaining = BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1;before each strncat call, and before each strncat call recalculate the space. - Only append if there is sufficient space left—use checks and possibly truncate the string to fit.
- Add a utility function to perform safe append: this can be placed in the same file if desired, to avoid unsafe calls everywhere.
Required changes:
- Replace all unsafe strncat calls at lines 14, 16, 17, and 18 inside
wanmgr_telemetry_append_key_valueto use correct free space calculation. - Optionally add an internal helper function for safe append, or inline the logic.
No additional library imports are needed, as standard C library suffices.
-
Copy modified lines R12-R13 -
Copy modified lines R15-R18 -
Copy modified lines R20-R31
| @@ -9,13 +9,26 @@ | ||
| { | ||
| if(value != NULL && strlen(MarkerArguments) < BUFFER_LENGTH_256 ) | ||
| { | ||
| if(strlen(MarkerArguments)>0) | ||
| size_t remaining; | ||
| if(strlen(MarkerArguments)>0) | ||
| { | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER,sizeof(MarkerArguments)); | ||
| remaining = BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1; | ||
| if (remaining > 0) { | ||
| strncat(MarkerArguments, WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER, remaining); | ||
| } | ||
| } | ||
| strncat(MarkerArguments,key,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,value,sizeof(MarkerArguments)); | ||
| remaining = BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1; | ||
| if (remaining > 0) { | ||
| strncat(MarkerArguments, key, remaining); | ||
| } | ||
| remaining = BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1; | ||
| if (remaining > 0) { | ||
| strncat(MarkerArguments, WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER, remaining); | ||
| } | ||
| remaining = BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1; | ||
| if (remaining > 0) { | ||
| strncat(MarkerArguments, value, remaining); | ||
| } | ||
| } | ||
| } | ||
|
|
| { | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER,sizeof(MarkerArguments)); | ||
| } | ||
| strncat(MarkerArguments,key,sizeof(MarkerArguments)); |
Check failure
Code scanning / CodeQL
Potentially unsafe call to strncat Critical
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix this problem, we must ensure that no calls to strncat can overflow the MarkerArguments buffer. For each call, calculate exactly how much space is left in the buffer (after the current length and allowing for the terminating null), and pass at most that number of bytes to strncat. For best robustness, all calls to strncat for MarkerArguments should become:
strncat(MarkerArguments, src, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1);This ensures that at most one less than the total buffer (allowing for the null terminator) is appended, from wherever the current content is at.
We should replace all four calls in wanmgr_telemetry_append_key_value (lines 14, 16, 17, 18) accordingly. No new imports or methods are needed; only the third argument to strncat should be changed. The change applies to the function in source/WanManager/wanmgr_t2_telemetry.c. No other code or structure needs modifying.
-
Copy modified line R14 -
Copy modified lines R16-R18
| @@ -11,11 +11,11 @@ | ||
| { | ||
| if(strlen(MarkerArguments)>0) | ||
| { | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1); | ||
| } | ||
| strncat(MarkerArguments,key,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,value,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,key, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1); | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1); | ||
| strncat(MarkerArguments,value, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1); | ||
| } | ||
| } | ||
|
|
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER,sizeof(MarkerArguments)); | ||
| } | ||
| strncat(MarkerArguments,key,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER,sizeof(MarkerArguments)); |
Check failure
Code scanning / CodeQL
Potentially unsafe call to strncat Critical
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix this problem, each call to strncat must be provided with a size argument that reflects only the remaining space in the MarkerArguments buffer (excluding the current filled length and reserving a byte for the null terminator), rather than always using sizeof(MarkerArguments).
In practical terms, for each call to append a string to MarkerArguments, calculate the current length as strlen(MarkerArguments), then use the remaining length as sizeof(MarkerArguments) - strlen(MarkerArguments) - 1 as the third argument to strncat.
- Only update calls to strncat within the
wanmgr_telemetry_append_key_valuefunction, precisely those lines (14, 16, 17, 18). - To be efficient and readable, compute the remaining buffer space at the start of each append step and use that value for the corresponding strncat call.
- Since the delimiter/key/value strings could individually overflow the buffer, add a check to ensure that the buffer is not already full before a given append or, if desired, prevent adding further key-value pairs if not enough space remains (already partially handled by the line 10 guard).
- No extra imports or definitions are required: all logic can be implemented with existing C standard library functions already in scope.
-
Copy modified line R14 -
Copy modified lines R16-R18
| @@ -11,11 +11,11 @@ | ||
| { | ||
| if(strlen(MarkerArguments)>0) | ||
| { | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments, WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1); | ||
| } | ||
| strncat(MarkerArguments,key,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,value,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments, key, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1); | ||
| strncat(MarkerArguments, WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1); | ||
| strncat(MarkerArguments, value, BUFFER_LENGTH_256 - strlen(MarkerArguments) - 1); | ||
| } | ||
| } | ||
|
|
| } | ||
| strncat(MarkerArguments,key,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,value,sizeof(MarkerArguments)); |
Check failure
Code scanning / CodeQL
Potentially unsafe call to strncat Critical
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, update all calls to strncat in wanmgr_telemetry_append_key_value so that the third argument is the amount of space left in MarkerArguments minus 1 (to ensure space for the null terminator). Specifically, for each append, calculate the remaining capacity as sizeof(MarkerArguments) - strlen(MarkerArguments) - 1, and pass this as the third argument to strncat.
Change only the calls in this function:
- Line 14: from
strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER,sizeof(MarkerArguments)); - Line 16: from
strncat(MarkerArguments,key,sizeof(MarkerArguments)); - Line 17: from
strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER,sizeof(MarkerArguments)); - Line 18: from
strncat(MarkerArguments,value,sizeof(MarkerArguments));
Replace each with a calculation of remaining room, using a helper inline or local variable.
No new imports or methods are needed.
-
Copy modified lines R12-R13 -
Copy modified lines R15-R16 -
Copy modified lines R18-R23
| @@ -9,13 +9,18 @@ | ||
| { | ||
| if(value != NULL && strlen(MarkerArguments) < BUFFER_LENGTH_256 ) | ||
| { | ||
| if(strlen(MarkerArguments)>0) | ||
| size_t remaining; | ||
| if(strlen(MarkerArguments)>0) | ||
| { | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER,sizeof(MarkerArguments)); | ||
| remaining = sizeof(MarkerArguments) - strlen(MarkerArguments) - 1; | ||
| strncat(MarkerArguments, WANMGR_T2_TELEMETRY_MARKER_ARG_DELIMITER, remaining); | ||
| } | ||
| strncat(MarkerArguments,key,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER,sizeof(MarkerArguments)); | ||
| strncat(MarkerArguments,value,sizeof(MarkerArguments)); | ||
| remaining = sizeof(MarkerArguments) - strlen(MarkerArguments) - 1; | ||
| strncat(MarkerArguments, key, remaining); | ||
| remaining = sizeof(MarkerArguments) - strlen(MarkerArguments) - 1; | ||
| strncat(MarkerArguments, WANMGR_T2_TELEMETRY_MARKER_KEY_VALUE_DELIMITER, remaining); | ||
| remaining = sizeof(MarkerArguments) - strlen(MarkerArguments) - 1; | ||
| strncat(MarkerArguments, value, remaining); | ||
| } | ||
| } | ||
|
|
ddf12ec
into
feature-hotspot-wan
Sync with Main Branch