nfsd-6.3 fixes:
- Fix a crash and a resource leak in NFSv4 COMPOUND processing - Fix issues with AUTH_SYS credential handling - Try again to address an NFS/NFSD/SUNRPC build dependency regression -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEKLLlsBKG3yQ88j7+M2qzM29mf5cFAmQsLHMACgkQM2qzM29m f5eNAA/8DokMQLQ+gN8zhQNqmw92sUdW3m41o0/DfETVXyE60sX8uOE7PktSGwfz fWMMiQpvmnmw/lbO84XQ9i8E0hjh8cT26l1CJum4VgSFiBJJvIqNxb0Yro43R4Jc 1wU2AOpC9qzCokdHhHKszDXuOgsz3v5OMJSQz3mG50dlq8/+6KKrCnK6jakyrvxr vKcVMsoENhxh2MnJfbsIQ70UM/rF6dmZWzGuBJH51Fkt+0FD9cnxXZKCkv1+D8JN 5Hr+8rv4I/VqBGDzv9QHoEowZr70e8UUi2UME/jwSArhdxwsfPEqV/qWwHq9Q133 RW40Gco7/E3JUjpAVTRXVGSB+LwU1EvhWQ9qSpSx5D2CPAHJ9hsOw4I54+Q0vD+j 2druOpqIITZOvI3K54ZJXa2LK6SpZ8NnncP5YkLWOwR0Wqohy1U8Sm5uOiMs+IJa neTxL7f+u3MDQgaDCTuBkI4oKzSDF/ZiMTWh52iPyy9x03SRYXbW6UgqDiySIg0P jvvaDFCvKvvL2qEmksMoQbWxSjVj8PqL+qJIxQNIZwHbows6paL+l0rdSPXc+l2O 97GBlqNPfHt+AjfJvGDscaIcLA+gu+ErzwxG6BLKvB9QcX9/F3A62Nh3txpe5Q1r M5NyQwK3vVQcTejMqw34sBqp3EeI5iIJ9CjD/2tN+dUpeHyQld8= =bk6S -----END PGP SIGNATURE----- Merge tag 'nfsd-6.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: - Fix a crash and a resource leak in NFSv4 COMPOUND processing - Fix issues with AUTH_SYS credential handling - Try again to address an NFS/NFSD/SUNRPC build dependency regression * tag 'nfsd-6.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: callback request does not use correct credential for AUTH_SYS NFS: Remove "select RPCSEC_GSS_KRB5 sunrpc: only free unix grouplist after RCU settles nfsd: call op_release, even when op_func returns an error NFSD: Avoid calling OPDESC() with ops->opnum == OP_ILLEGAL
This commit is contained in:
Коммит
ceeea1b782
|
@ -75,7 +75,6 @@ config NFS_V3_ACL
|
|||
config NFS_V4
|
||||
tristate "NFS client support for NFS version 4"
|
||||
depends on NFS_FS
|
||||
select RPCSEC_GSS_KRB5
|
||||
select KEYS
|
||||
help
|
||||
This option enables support for version 4 of the NFS protocol
|
||||
|
|
|
@ -297,6 +297,7 @@ nfsd4_block_get_device_info_scsi(struct super_block *sb,
|
|||
|
||||
out_free_dev:
|
||||
kfree(dev);
|
||||
gdp->gd_device = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -946,8 +946,8 @@ static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct r
|
|||
if (!kcred)
|
||||
return NULL;
|
||||
|
||||
kcred->uid = ses->se_cb_sec.uid;
|
||||
kcred->gid = ses->se_cb_sec.gid;
|
||||
kcred->fsuid = ses->se_cb_sec.uid;
|
||||
kcred->fsgid = ses->se_cb_sec.gid;
|
||||
return kcred;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2476,10 +2476,12 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
|
|||
for (i = 0; i < argp->opcnt; i++) {
|
||||
op = &argp->ops[i];
|
||||
op->replay = NULL;
|
||||
op->opdesc = NULL;
|
||||
|
||||
if (xdr_stream_decode_u32(argp->xdr, &op->opnum) < 0)
|
||||
return false;
|
||||
if (nfsd4_opnum_in_range(argp, op)) {
|
||||
op->opdesc = OPDESC(op);
|
||||
op->status = nfsd4_dec_ops[op->opnum](argp, &op->u);
|
||||
if (op->status != nfs_ok)
|
||||
trace_nfsd_compound_decode_err(argp->rqstp,
|
||||
|
@ -2490,7 +2492,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
|
|||
op->opnum = OP_ILLEGAL;
|
||||
op->status = nfserr_op_illegal;
|
||||
}
|
||||
op->opdesc = OPDESC(op);
|
||||
|
||||
/*
|
||||
* We'll try to cache the result in the DRC if any one
|
||||
* op in the compound wants to be cached:
|
||||
|
@ -5400,10 +5402,8 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
|
|||
__be32 *p;
|
||||
|
||||
p = xdr_reserve_space(xdr, 8);
|
||||
if (!p) {
|
||||
WARN_ON_ONCE(1);
|
||||
return;
|
||||
}
|
||||
if (!p)
|
||||
goto release;
|
||||
*p++ = cpu_to_be32(op->opnum);
|
||||
post_err_offset = xdr->buf->len;
|
||||
|
||||
|
@ -5418,8 +5418,6 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
|
|||
op->status = encoder(resp, op->status, &op->u);
|
||||
if (op->status)
|
||||
trace_nfsd_compound_encode_err(rqstp, op->opnum, op->status);
|
||||
if (opdesc && opdesc->op_release)
|
||||
opdesc->op_release(&op->u);
|
||||
xdr_commit_encode(xdr);
|
||||
|
||||
/* nfsd4_check_resp_size guarantees enough room for error status */
|
||||
|
@ -5460,6 +5458,9 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
|
|||
}
|
||||
status:
|
||||
*p = op->status;
|
||||
release:
|
||||
if (opdesc && opdesc->op_release)
|
||||
opdesc->op_release(&op->u);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -416,14 +416,23 @@ static int unix_gid_hash(kuid_t uid)
|
|||
return hash_long(from_kuid(&init_user_ns, uid), GID_HASHBITS);
|
||||
}
|
||||
|
||||
static void unix_gid_free(struct rcu_head *rcu)
|
||||
{
|
||||
struct unix_gid *ug = container_of(rcu, struct unix_gid, rcu);
|
||||
struct cache_head *item = &ug->h;
|
||||
|
||||
if (test_bit(CACHE_VALID, &item->flags) &&
|
||||
!test_bit(CACHE_NEGATIVE, &item->flags))
|
||||
put_group_info(ug->gi);
|
||||
kfree(ug);
|
||||
}
|
||||
|
||||
static void unix_gid_put(struct kref *kref)
|
||||
{
|
||||
struct cache_head *item = container_of(kref, struct cache_head, ref);
|
||||
struct unix_gid *ug = container_of(item, struct unix_gid, h);
|
||||
if (test_bit(CACHE_VALID, &item->flags) &&
|
||||
!test_bit(CACHE_NEGATIVE, &item->flags))
|
||||
put_group_info(ug->gi);
|
||||
kfree_rcu(ug, rcu);
|
||||
|
||||
call_rcu(&ug->rcu, unix_gid_free);
|
||||
}
|
||||
|
||||
static int unix_gid_match(struct cache_head *corig, struct cache_head *cnew)
|
||||
|
|
Загрузка…
Ссылка в новой задаче