Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-3.10' of git://linux-nfs.org/~bfields/linux

Pull nfsd fixes from Bruce Fields:
"Small fixes for two bugs and two warnings"

* 'for-3.10' of git://linux-nfs.org/~bfields/linux:
nfsd: fix oops when legacy_recdir_name_error is passed a -ENOENT error
SUNRPC: fix decoding of optional gss-proxy xdr fields
SUNRPC: Refactor gssx_dec_option_array() to kill uninitialized warning
nfsd4: don't allow owner override on 4.1 CLAIM_FH opens

+48 -37
+13 -2
fs/nfsd/nfs4proc.c
··· 279 279 { 280 280 struct svc_fh *current_fh = &cstate->current_fh; 281 281 __be32 status; 282 + int accmode = 0; 282 283 283 284 /* We don't know the target directory, and therefore can not 284 285 * set the change info ··· 291 290 292 291 open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) && 293 292 (open->op_iattr.ia_size == 0); 293 + /* 294 + * In the delegation case, the client is telling us about an 295 + * open that it *already* performed locally, some time ago. We 296 + * should let it succeed now if possible. 297 + * 298 + * In the case of a CLAIM_FH open, on the other hand, the client 299 + * may be counting on us to enforce permissions (the Linux 4.1 300 + * client uses this for normal opens, for example). 301 + */ 302 + if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEG_CUR_FH) 303 + accmode = NFSD_MAY_OWNER_OVERRIDE; 294 304 295 - status = do_open_permission(rqstp, current_fh, open, 296 - NFSD_MAY_OWNER_OVERRIDE); 305 + status = do_open_permission(rqstp, current_fh, open, accmode); 297 306 298 307 return status; 299 308 }
+5 -7
fs/nfsd/nfs4recover.c
··· 146 146 * then disable recovery tracking. 147 147 */ 148 148 static void 149 - legacy_recdir_name_error(int error) 149 + legacy_recdir_name_error(struct nfs4_client *clp, int error) 150 150 { 151 151 printk(KERN_ERR "NFSD: unable to generate recoverydir " 152 152 "name (%d).\n", error); ··· 159 159 if (error == -ENOENT) { 160 160 printk(KERN_ERR "NFSD: disabling legacy clientid tracking. " 161 161 "Reboot recovery will not function correctly!\n"); 162 - 163 - /* the argument is ignored by the legacy exit function */ 164 - nfsd4_client_tracking_exit(NULL); 162 + nfsd4_client_tracking_exit(clp->net); 165 163 } 166 164 } 167 165 ··· 182 184 183 185 status = nfs4_make_rec_clidname(dname, &clp->cl_name); 184 186 if (status) 185 - return legacy_recdir_name_error(status); 187 + return legacy_recdir_name_error(clp, status); 186 188 187 189 status = nfs4_save_creds(&original_cred); 188 190 if (status < 0) ··· 339 341 340 342 status = nfs4_make_rec_clidname(dname, &clp->cl_name); 341 343 if (status) 342 - return legacy_recdir_name_error(status); 344 + return legacy_recdir_name_error(clp, status); 343 345 344 346 status = mnt_want_write_file(nn->rec_file); 345 347 if (status) ··· 599 601 600 602 status = nfs4_make_rec_clidname(dname, &clp->cl_name); 601 603 if (status) { 602 - legacy_recdir_name_error(status); 604 + legacy_recdir_name_error(clp, status); 603 605 return status; 604 606 } 605 607
+30 -28
net/sunrpc/auth_gss/gss_rpc_xdr.c
··· 21 21 #include <linux/sunrpc/svcauth.h> 22 22 #include "gss_rpc_xdr.h" 23 23 24 - static bool gssx_check_pointer(struct xdr_stream *xdr) 25 - { 26 - __be32 *p; 27 - 28 - p = xdr_reserve_space(xdr, 4); 29 - if (unlikely(p == NULL)) 30 - return -ENOSPC; 31 - return *p?true:false; 32 - } 33 - 34 24 static int gssx_enc_bool(struct xdr_stream *xdr, int v) 35 25 { 36 26 __be32 *p; ··· 254 264 if (unlikely(p == NULL)) 255 265 return -ENOSPC; 256 266 count = be32_to_cpup(p++); 257 - if (count != 0) { 258 - /* we recognize only 1 currently: CREDS_VALUE */ 259 - oa->count = 1; 267 + if (!count) 268 + return 0; 260 269 261 - oa->data = kmalloc(sizeof(struct gssx_option), GFP_KERNEL); 262 - if (!oa->data) 263 - return -ENOMEM; 270 + /* we recognize only 1 currently: CREDS_VALUE */ 271 + oa->count = 1; 264 272 265 - creds = kmalloc(sizeof(struct svc_cred), GFP_KERNEL); 266 - if (!creds) { 267 - kfree(oa->data); 268 - return -ENOMEM; 269 - } 273 + oa->data = kmalloc(sizeof(struct gssx_option), GFP_KERNEL); 274 + if (!oa->data) 275 + return -ENOMEM; 270 276 271 - oa->data[0].option.data = CREDS_VALUE; 272 - oa->data[0].option.len = sizeof(CREDS_VALUE); 273 - oa->data[0].value.data = (void *)creds; 274 - oa->data[0].value.len = 0; 277 + creds = kmalloc(sizeof(struct svc_cred), GFP_KERNEL); 278 + if (!creds) { 279 + kfree(oa->data); 280 + return -ENOMEM; 275 281 } 282 + 283 + oa->data[0].option.data = CREDS_VALUE; 284 + oa->data[0].option.len = sizeof(CREDS_VALUE); 285 + oa->data[0].value.data = (void *)creds; 286 + oa->data[0].value.len = 0; 287 + 276 288 for (i = 0; i < count; i++) { 277 289 gssx_buffer dummy = { 0, NULL }; 278 290 u32 length; ··· 792 800 struct xdr_stream *xdr, 793 801 struct gssx_res_accept_sec_context *res) 794 802 { 803 + u32 value_follows; 795 804 int err; 796 805 797 806 /* res->status */ ··· 801 808 return err; 802 809 803 810 /* res->context_handle */ 804 - if (gssx_check_pointer(xdr)) { 811 + err = gssx_dec_bool(xdr, &value_follows); 812 + if (err) 813 + return err; 814 + if (value_follows) { 805 815 err = gssx_dec_ctx(xdr, res->context_handle); 806 816 if (err) 807 817 return err; ··· 813 817 } 814 818 815 819 /* res->output_token */ 816 - if (gssx_check_pointer(xdr)) { 820 + err = gssx_dec_bool(xdr, &value_follows); 821 + if (err) 822 + return err; 823 + if (value_follows) { 817 824 err = gssx_dec_buffer(xdr, res->output_token); 818 825 if (err) 819 826 return err; ··· 825 826 } 826 827 827 828 /* res->delegated_cred_handle */ 828 - if (gssx_check_pointer(xdr)) { 829 + err = gssx_dec_bool(xdr, &value_follows); 830 + if (err) 831 + return err; 832 + if (value_follows) { 829 833 /* we do not support upcall servers sending this data. */ 830 834 return -EINVAL; 831 835 }