Page MenuHomeFreeBSD

[PATCH] stge: fix null pointer dereference
ClosedPublic

Authored by ztong0001_gmail.com on Mar 21 2022, 9:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 1:24 PM
Unknown Object (File)
Oct 13 2024, 2:40 AM
Unknown Object (File)
Oct 13 2024, 2:11 AM
Unknown Object (File)
Oct 13 2024, 2:11 AM
Unknown Object (File)
Oct 4 2024, 1:01 PM
Unknown Object (File)
Oct 1 2024, 5:12 PM
Unknown Object (File)
Sep 26 2024, 1:56 PM
Unknown Object (File)
Sep 23 2024, 12:06 PM
Subscribers

Details

Summary

stge_attach() could fail at line 464, sc->sc_spec remains NULL when
calling stge_detach(), thus bus_release_resources() at line 704 will
trigger null pointer dereference. We need to check the nulliness before
calling bus_release_resources().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ztong0001_gmail.com created this revision.

Dear Reviewers,
I was doing some code review and found some issues in the NIC driver.
I am a completely newbie and I'd appreciate it if someone could give some comments on the patch.
Thanks and have a good one.

  • Tong
ztong0001_gmail.com retitled this revision from stge: fix null pointer dereference to [PATCH] stge: fix null pointer dereference.
markj added a subscriber: markj.

The patch seems ok, but here are some general comments:

  • When uploading raw patches directly to phabricator, please upload with full context per https://wiki.freebsd.org/Phabricator#Create_a_Revision_via_Web_Interface
  • This is a very old driver that does not get any maintenance, and I can't see any evidence that any users of the driver, if any, have actually hit this bug. So there will be very little interest in merging such patches.
This revision is now accepted and ready to land.Mar 31 2022, 6:06 PM
This revision was automatically updated to reflect the committed changes.