Page MenuHomeFreeBSD

loader: net_open() should not replace f->f_devdata
ClosedPublic

Authored by tsoome on Sep 29 2021, 4:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 5 2025, 10:39 AM
Unknown Object (File)
Feb 21 2025, 4:59 PM
Unknown Object (File)
Feb 11 2025, 11:48 AM
Unknown Object (File)
Dec 11 2024, 6:01 PM
Unknown Object (File)
Dec 2 2024, 12:59 PM
Unknown Object (File)
Nov 27 2024, 5:07 AM
Unknown Object (File)
Nov 24 2024, 8:29 AM
Unknown Object (File)
Oct 5 2024, 3:05 PM
Subscribers

Details

Summary

net_open() does replace f_devdata with pointer to netdev_sock,
this will cause memory leak when device is closed, but also does
alter the devopen() logic.

We should store &netdev_sock to dev->d_opendata instead, this
would preserve and follow the devopen() logic.

Fixes network boot on aarch64 (tested by bz).

Diff Detail

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

Event Timeline

Is it limited to aarch64 or general EFI netbooting?

I think manu replied as well saying he saw this.

In D32227#727121, @bz wrote:

Is it limited to aarch64 or general EFI netbooting?

We get unexpected data (assuming pointer to devdesc structure), so it really depends on memory state and howthe system will react.

Can the other reviewers please comment and this be comitted if dared okay? I just forgot to patch a tree for another new system and ran into it again.

This revision is now accepted and ready to land.Oct 18 2021, 9:40 PM