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)
Fri, Nov 8, 12:32 AM
Unknown Object (File)
Sat, Nov 2, 8:00 PM
Unknown Object (File)
Sep 29 2024, 1:38 AM
Unknown Object (File)
Sep 28 2024, 11:28 PM
Unknown Object (File)
Sep 21 2024, 4:56 AM
Unknown Object (File)
Sep 10 2024, 12:54 AM
Unknown Object (File)
Sep 8 2024, 8:37 AM
Unknown Object (File)
Aug 12 2024, 6:36 PM
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 Skipped
Unit
Tests Skipped

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.