cd9660: va_rdev should be NODEV for non-special inodes Reported by: pho nfsclient: va_rdev should be NODEV for non-special nodes Server is allowed to fill any value into the rdev attribute, clear it to satisfy the local requirements. Reported by: bakul
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
469 ↗ | (On Diff #160523) | Somewhat (un)related: nfscl_loadattrcache() is often called with the vnode only shared locked. This flip of the vnode type and reset of v_op is quite broken then. |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
469 ↗ | (On Diff #160523) | To be honest, this code is so old it probably I cannot remember when this actually can I'll poke at it (and maybe add a check for the |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
469 ↗ | (On Diff #160523) | A malignant server might trigger this to corrupt the client state. |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
469 ↗ | (On Diff #160523) | Yep. There used to be a "caching mechanism" inside If my hunch is correct, the only valid case |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
469 ↗ | (On Diff #160523) | Then the right action is perhaps to vgone() the vp. Problem is that vgone() requires exclusively locked vnode too. |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
432 ↗ | (On Diff #160523) | I decided to go with this version, instead of trying to patch the server response, because the vnode type and the server reply (cached in attrs/nattrs) might be not synchronized. As an example of that, see the discussion on the left side of the review, for lines around 468 etc. So I wanted to use the exact data (the vp->v_type) same as used in the currently reverted assert. |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
432 ↗ | (On Diff #160523) | Perhaps we should assert that vp->v_type == vap->va_type? |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
432 ↗ | (On Diff #160523) | This would give a broken or malicious NFS server one more way to trick nfs client into problems. |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
432 ↗ | (On Diff #160523) | The types have to match though. And look at line 469 below... |
sys/fs/nfsclient/nfs_clport.c | ||
---|---|---|
432 ↗ | (On Diff #160523) | For the line 469, see the discussion on the left pane, exactly. This was the motivation for the approach I choose. |