Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FIX ci_tcp_sendmsg_fill_pkt NULL pointer error #291

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

@liujinhui-job
Copy link

@liujinhui-job liujinhui-job commented Jun 23, 2025

oo_pkt_fill call oo_pkt_filter_next_pkt and ci_netif_pkt_alloc_block,then *p_netif_locked will coredump, bacause it is NULL

oo_pkt_fill get p_netif_locked value, will coredump
@liujinhui-job liujinhui-job requested a review from a team as a code owner June 23, 2025 08:14
Copy link
Contributor

ivatet-amd commented Jun 26, 2025
edited
Loading

Thank you @liujinhui-job.

Could you share your (minimal) repro please? The latest incarnation appears correct to me, but my concern is that the affected code has not been updated recently, and there may be additional regressions lurking in the area, rendering this fix incomplete.

I can reproduce it with tx_timestamping, but it requires some hacking in pkt_filler to reduce the delta between buf_start and buf_end from 2048 to a smaller number, e.g. ~1000, combined with a larger payload size, e.g. ~1500, sent by the client app:

$ scripts/onload build/gnu_x86_64/tests/onload/hwtimestamping/tx_timestamping --proto tcp --templated
...
TCP listening on port 9000
 TCP connection accepted
Selecting hardware timestamping mode.
...
Packet 0 - 1528 bytes
Segmentation fault (core dumped)

In other words, I'm not convinced my repro is good enough to verify your fix.

Copy link
Author

While examining the source code, I observed that the parameter "NULL/p_netif_locked/" appeared unusual.

Consequently, I modified the ts->eff_mss value in the ci_tcp_send_fill_pkts function to 4096 and transmitted a 4096-byte packet, which successfully triggered a segmentation fault.

However, in actual operational scenarios, I'm uncertain whether ts->eff_mss would realistically reach 4096.

Copy link
Contributor

I wonder if we are looking at dead code in oo_pkt_fill() and should replace if( pf->buf_start == pf->buf_end ) with assert( pf->buf_start != pf->buf_end ). I cannot say now without further looking at the code and various NIC constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sianj-xilinx sianj-xilinx Awaiting requested review from sianj-xilinx

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /