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)
Jan 12 2024, 8:32 AM
Unknown Object (File)
Dec 23 2023, 8:12 PM
Unknown Object (File)
Dec 20 2023, 3:42 AM
Unknown Object (File)
Dec 5 2023, 5:07 AM
Unknown Object (File)
Sep 7 2023, 11:23 PM
Unknown Object (File)
Aug 27 2023, 5:36 AM
Unknown Object (File)
Aug 26 2023, 1:54 AM
Unknown Object (File)
Jul 3 2023, 8:59 AM
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