Page MenuHomeFreeBSD

fix crashes caused by not setting done_namei correctly
ClosedPublic

Authored by rmacklem on Feb 7 2023, 11:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 23, 6:26 PM
Unknown Object (File)
Sat, Jan 18, 9:29 PM
Unknown Object (File)
Wed, Jan 15, 3:25 AM
Unknown Object (File)
Nov 26 2024, 8:16 PM
Unknown Object (File)
Nov 16 2024, 7:36 PM
Unknown Object (File)
Nov 8 2024, 12:32 AM
Unknown Object (File)
Nov 2 2024, 8:00 PM
Unknown Object (File)
Sep 29 2024, 1:38 AM
Subscribers

Details

Summary

Using done_namei instead of ni_startdir did not
fix the crashes reported in the PR. Upon looking
more closely at the code, the only case where the
code near the end of nfsvno_open() needs to be
executed is when nfsvno_namei() has succeeded,
but a subsequent error was detected.

This patch uses done_namei to indicate this case.

Also, nfsvno_relpathbuf() should only be called for
this case and not whenever nfsvno_open() is called
with nd_repstat != 0. A bug was introduced here when
the HASBUF flag was deleted.

Test Plan

Tested by the reporter of the PR.

Diff Detail

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

Event Timeline

style suggests keeping explicit NULL comparisons, but i don't think it matters

This revision is now accepted and ready to land.Feb 7 2023, 11:13 PM

Yep. And style also states that the style of a function
(or is it a file?) should not be changed unless you are
re-writing 50% of it.

In this case, I put the code back in the stable/13 form,
because I figured it would be less confusing if someone
compares it.