HomeFreeBSD

vfs: add NDREINIT to facilitate repeated namei calls

Description

vfs: add NDREINIT to facilitate repeated namei calls

struct nameidata mixes caller arguments, internal state and output, which
can be quite error prone.

Recent addition of valdiating ni_resflags uncovered a caller which could
repeatedly call namei, effectively operating on partially populated state.

Add bare minimium validation this does not happen. The real fix would
decouple aforementioned state.

Reported by: pho
Tested by: pho (different variant)

Details

Provenance
mjgAuthored on
Parents
rS367129: MFC r366932:
Branches
Unknown
Tags
Unknown