Commit e4469c6
committed
NFSD: Fix the NFSv4.1 CREATE_SESSION operation
RFC 8881 Section 18.36.4 discusses the implementation of the NFSv4.1
CREATE_SESSION operation. The section defines four phases of
operation.
Phase 2 processes the CREATE_SESSION sequence ID. As a separate
step, Phase 3 evaluates the CREATE_SESSION arguments.
The problem we are concerned with is when phase 2 is successful but
phase 3 fails. The spec language in this case is "No changes are
made to any client records on the server."
RFC 8881 Section 18.35.4 defines a "client record", and it does
/not/ contain any details related to the special CREATE_SESSION
slot. Therefore NFSD is incorrect to skip incrementing the
CREATE_SESSION sequence id when phase 3 (see Section 18.36.4) of
CREATE_SESSION processing fails. In other words, even though NFSD
happens to store the cs_slot in a client record, in terms of the
protocol the slot is logically separate from the client record.
Three complications:
1. The world has moved on since commit 86c3e16 ("nfsd4: confirm
only on succesful create_session") broke this. So we can't simply
revert that commit.
2. NFSD's CREATE_SESSION implementation does not cleanly delineate
the logic of phases 2 and 3. So this won't be a surgical fix.
3. Because of the way it currently handles the CREATE_SESSION slot
sequence number, nfsd4_create_session() isn't caching error
responses in the CREATE_SESSION slot. Instead of replaying the
response cache in those cases, it's executing the transaction
again.
Reorganize the CREATE_SESSION slot sequence number accounting. This
requires that error responses are appropriately cached in the
CREATE_SESSION slot (once it is found).
Reported-by: Connor Smith <[email protected]>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218382
Signed-off-by: Chuck Lever <[email protected]>1 parent f810402 commit e4469c6
1 file changed
+31
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3562 | 3562 | | |
3563 | 3563 | | |
3564 | 3564 | | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
3565 | 3568 | | |
3566 | 3569 | | |
3567 | 3570 | | |
| |||
3732 | 3735 | | |
3733 | 3736 | | |
3734 | 3737 | | |
| 3738 | + | |
3735 | 3739 | | |
3736 | 3740 | | |
3737 | 3741 | | |
3738 | | - | |
3739 | 3742 | | |
3740 | 3743 | | |
3741 | 3744 | | |
| |||
3761 | 3764 | | |
3762 | 3765 | | |
3763 | 3766 | | |
3764 | | - | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
3765 | 3771 | | |
3766 | | - | |
3767 | | - | |
3768 | | - | |
3769 | | - | |
| 3772 | + | |
3770 | 3773 | | |
3771 | | - | |
3772 | | - | |
3773 | | - | |
3774 | | - | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
3775 | 3780 | | |
3776 | 3781 | | |
3777 | | - | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
3778 | 3792 | | |
3779 | 3793 | | |
3780 | 3794 | | |
3781 | 3795 | | |
3782 | | - | |
| 3796 | + | |
3783 | 3797 | | |
3784 | 3798 | | |
3785 | 3799 | | |
3786 | | - | |
3787 | | - | |
3788 | | - | |
3789 | | - | |
3790 | | - | |
3791 | | - | |
3792 | | - | |
3793 | | - | |
| 3800 | + | |
3794 | 3801 | | |
3795 | 3802 | | |
3796 | 3803 | | |
3797 | 3804 | | |
3798 | 3805 | | |
3799 | | - | |
| 3806 | + | |
3800 | 3807 | | |
3801 | 3808 | | |
3802 | 3809 | | |
3803 | 3810 | | |
3804 | 3811 | | |
3805 | | - | |
3806 | | - | |
3807 | | - | |
3808 | 3812 | | |
3809 | 3813 | | |
3810 | 3814 | | |
| |||
3817 | 3821 | | |
3818 | 3822 | | |
3819 | 3823 | | |
3820 | | - | |
3821 | | - | |
3822 | 3824 | | |
3823 | 3825 | | |
3824 | 3826 | | |
| |||
3831 | 3833 | | |
3832 | 3834 | | |
3833 | 3835 | | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
3834 | 3839 | | |
3835 | 3840 | | |
3836 | 3841 | | |
| |||
0 commit comments