Commit 779327c
nfsd: decouple the xprtsec policy check from check_nfsd_access()
commit e4f574c upstream.
A while back I had reported that an NFSv3 client could successfully
mount using '-o xprtsec=none' an export that had been exported with
'xprtsec=tls:mtls'. By "successfully" I mean that the mount command
would succeed and the mount would show up in /proc/mount. Attempting
to do anything futher with the mount would be met with NFS3ERR_ACCES.
This was fixed (albeit accidentally) by commit bb4f07f ("nfsd:
Fix NFSD_MAY_BYPASS_GSS and NFSD_MAY_BYPASS_GSS_ON_ROOT") and was
subsequently re-broken by commit 0813c5f ("nfsd: fix access
checking for NLM under XPRTSEC policies").
Transport Layer Security isn't an RPC security flavor or pseudo-flavor,
so we shouldn't be conflating them when determining whether the access
checks can be bypassed. Split check_nfsd_access() into two helpers, and
have __fh_verify() call the helpers directly since __fh_verify() has
logic that allows one or both of the checks to be skipped. All other
sites will continue to call check_nfsd_access().
Link: https://lore.kernel.org/linux-nfs/ZjO3Qwf_G87yNXb2@aion/
Fixes: 9280c57 ("NFSD: Handle new xprtsec= export option")
Cc: [email protected]
Signed-off-by: Scott Mayhew <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 2d68f8a commit 779327c
3 files changed
+83
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
1078 | | - | |
| 1078 | + | |
| 1079 | + | |
1079 | 1080 | | |
1080 | | - | |
1081 | | - | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
1082 | 1087 | | |
1083 | 1088 | | |
1084 | 1089 | | |
1085 | 1090 | | |
1086 | 1091 | | |
1087 | | - | |
1088 | | - | |
| 1092 | + | |
1089 | 1093 | | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
| 1094 | + | |
1103 | 1095 | | |
1104 | 1096 | | |
1105 | 1097 | | |
1106 | | - | |
| 1098 | + | |
1107 | 1099 | | |
1108 | 1100 | | |
1109 | 1101 | | |
1110 | 1102 | | |
1111 | | - | |
| 1103 | + | |
1112 | 1104 | | |
1113 | 1105 | | |
1114 | 1106 | | |
1115 | 1107 | | |
1116 | | - | |
| 1108 | + | |
1117 | 1109 | | |
1118 | | - | |
1119 | | - | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1120 | 1133 | | |
1121 | | - | |
1122 | 1134 | | |
1123 | 1135 | | |
1124 | 1136 | | |
| |||
1160 | 1172 | | |
1161 | 1173 | | |
1162 | 1174 | | |
1163 | | - | |
1164 | 1175 | | |
1165 | 1176 | | |
1166 | 1177 | | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
1167 | 1199 | | |
1168 | 1200 | | |
1169 | 1201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
366 | 376 | | |
367 | 377 | | |
368 | 378 | | |
369 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
370 | 390 | | |
371 | 391 | | |
372 | 392 | | |
| |||
378 | 398 | | |
379 | 399 | | |
380 | 400 | | |
381 | | - | |
| 401 | + | |
382 | 402 | | |
383 | 403 | | |
| 404 | + | |
384 | 405 | | |
385 | 406 | | |
386 | 407 | | |
387 | 408 | | |
| 409 | + | |
388 | 410 | | |
389 | 411 | | |
390 | 412 | | |
| |||
0 commit comments