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)
Sat, Sep 21, 4:56 AM
Unknown Object (File)
Tue, Sep 10, 12:54 AM
Unknown Object (File)
Sun, Sep 8, 8:37 AM
Unknown Object (File)
Aug 12 2024, 6:36 PM
Unknown Object (File)
Aug 1 2024, 12:04 AM
Unknown Object (File)
Jul 27 2024, 11:32 PM
Unknown Object (File)
Jul 9 2024, 3:22 PM
Unknown Object (File)
May 5 2024, 2:32 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.