Since autofs_lookup() calls into autofs_trigger_vn() to perform automounting, and autofs_trigger_vn() unlocks the vnode, it is possible for the unmount to start meantime. Then autofs_trigger() accesses freed memory. At this point, busy can be only done unblocking, and the transient failure must abort the trigger operation. This would cause spurious automounter errors, but at least should prevent accesses to the freed memory. PR: 294361 Tested by: rew
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| sys/fs/autofs/autofs_vnops.c | ||
|---|---|---|
| 144–149 | Does this comment describe a desired (but not correct) behaviour of the old code (and if so is it more wrong now)? | |
| sys/fs/autofs/autofs_vnops.c | ||
|---|---|---|
| 144–149 | Yes, it does describes the intent. Old code was unsufficient because vref-ed vnode does not prevent forced unmount. I updated the comment. | |
| sys/fs/autofs/autofs_vnops.c | ||
|---|---|---|
| 146 | ||
| 169 | I have a related question that is not specific to this review.. what do you think about the idea of not referencing the autofs node while the vnode is unlocked? I ask because I've got a couple patches that work towards that idea but I have not finished it. this is an area of code that will need to be addressed to handle autofs node removal | |
| sys/fs/autofs/autofs_vnops.c | ||
|---|---|---|
| 169 | What do you mean by 'referencing the node'? Do you mean vref-ing the vnode instead? I think this is trivially fine, since vp must be referenced by vfs_lookup() when calling into VOP_LOOKUP(). | |