Page MenuHomeFreeBSD

if_wg: avoid sleeping under the net epoch
ClosedPublic

Authored by kevans on Mar 8 2021, 6:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 7:41 PM
Unknown Object (File)
Feb 19 2024, 4:26 PM
Unknown Object (File)
Jan 15 2024, 2:23 PM
Unknown Object (File)
Jan 12 2024, 2:50 AM
Unknown Object (File)
Dec 20 2023, 7:39 AM
Unknown Object (File)
Dec 16 2023, 1:55 PM
Unknown Object (File)
Sep 18 2023, 2:01 PM
Unknown Object (File)
Sep 18 2023, 1:58 PM
Subscribers

Details

Summary

No sleeping allowed here, so avoid it. Collect the subset of data we
want inside of the epoch, as we'll need extra allocations when we add
items to the nvlist.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37665
Build 34554: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Mar 8 2021, 8:04 AM
sys/dev/if_wg/module/module.c
74

Why NOISE_KEY_SIZE instead of WG_KEY_SIZE?

403

Perhaps assert that we're in the net epoch here?

431

How do you guarantee that the length of the list doesn't increase between the first loop and this one?

sys/dev/if_wg/module/module.c
74

Stole from the r_public member of struct noise_remote that we're copying into here; the distinction doesn't seem to make much sense to me, as we do use them interchangeably elsewhere (see: noise_local_keys() definition then usage over in wg_cloneattach()).

I'll switch it over to WG_KEY_SIZE, though.

431

Whoops, brain-o; will fix to stop at exp->aip_count and update it after.

kevans marked 3 inline comments as done.

Address feedback from @markj

This revision now requires review to proceed.Mar 8 2021, 6:50 PM
sys/dev/if_wg/module/module.c
491

Is it intentional that an error part-way though will result in this function returning success with a truncated list?

522

nvl is leaked in this error path, not a new bug though.

I think this is ok, my last questions are around preexisting behaviour.

This revision is now accepted and ready to land.Mar 8 2021, 9:06 PM
This revision was automatically updated to reflect the committed changes.
kevans marked 2 inline comments as done.