Page MenuHomeFreeBSD

ixgbe: Avoid sbuf_trim in sysctl handler
ClosedPublic

Authored by kbowling on Aug 22 2021, 5:05 AM.
Tags
None
Referenced Files
F131690835: D31633.diff
Fri, Oct 10, 9:21 AM
F131651589: D31633.id.diff
Fri, Oct 10, 1:37 AM
Unknown Object (File)
Fri, Sep 26, 5:16 AM
Unknown Object (File)
Wed, Sep 24, 8:39 PM
Unknown Object (File)
Mon, Sep 15, 10:57 PM
Unknown Object (File)
Sep 9 2025, 10:28 AM
Unknown Object (File)
Aug 29 2025, 5:12 PM
Unknown Object (File)
Aug 13 2025, 11:14 PM
Subscribers

Details

Summary

This was an error, we cannot use sbuf_trim(9) in the ixgbe_get_phy_firmware_version function because it also gets called in the context of sbuf_new_for_sysctl(9). sbuf(9) explains the interaction with drain functions as used by sbuf_new_for_sysctl(9).

MFC after: 1 day
Fixes: 7660e4ea5cb7

Test Plan

Tested on X552.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Suggested approach which I think might be simpler, but the only mandatory thing is the final space that got left in.

sys/dev/ixgbe/if_ix.c
4697

I'd add a const char *space = ""; here

4705

Then add space =" "; here with {}

4709

and use space here instead of this express....

4710

with the same space = " "; here.

4714

and replace this with space.

4718

I think you missed one of the trailing white spaces here.. It would have been trimmed before.

This revision is now accepted and ready to land.Aug 23 2021, 5:17 PM