mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
seven client fixes
-----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmoQd3sACgkQiiy9cAdy T1ELLwv9E8J16srSXUXrMtxbvZj6oMntsG7a6vvTTkbkUQ9odODTHEStVCKwOoX1 jVXXkuHaU9HgX21HB2Z10ykp3y65WPgZ/DGvCtM+bWHGbMLTmp2U+1p+kDjqlRel PQaD+kaLUCTm1yDnWqKscFUUxj4SLmHpnAfpbyWPIY+ogpAAhnlVbwvUKwmrTKsw gJH5rHdq3Uc6pZ7hnfzWm1JMjty9lmuMyTy+hRy9g4CvOhpvBbuNyDqsot4IWVL/ AyAwUqnaCFYLTETp+ThLieTL/e10UxpXSLn+UBCgXLlNjcDNG2RA6YphNAWF+Gte 9fsruwi6oTBTV4YGOiB59qKG2dc9uDzyZWRoXQ2LLo+cu1LmJPAVJSZopjgO+ghq v3dKjzUMg4qP7EBkmweVRBQWE3G2Qbp5MTjxNFYWfJqam5dRD1Qp5rBcepnAqhiz 4v+8xjp3rCNde+0XpEc+rwh0bye8HdU6y+IIpP3qybehXawh5n0AzNcx1D+c4EaH RvbrKOJl =3O3z -----END PGP SIGNATURE----- Merge tag 'v7.1-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: - Fix missing lock - Fix dentry in use after unmounting - cifs.upcall security fix - require CAP_NET_ADMIN for swn netlink - change allocation in DUP_CTX_STR to GFP_KERNEL - minor smbdirect debug fix - handle_read_data() folio fix * tag 'v7.1-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb: client: change allocation requirements in DUP_CTX_STR macro smb: client: require net admin for CIFS SWN netlink smb: smbdirect: divide, not multiply, milliseconds by 1000 cifs: Fix busy dentry used after unmounting smb: client: use data_len for SMB2 READ encrypted folioq copy smb: client: reject userspace cifs.spnego descriptions smb: client: protect tc_count increment in smb2_find_smb_sess_tcon_unlocked()
This commit is contained in:
commit
558c3eca71
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/list.h>
|
||||
#include <linux/cred.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <keys/user-type.h>
|
||||
|
|
@ -40,12 +41,27 @@ cifs_spnego_key_destroy(struct key *key)
|
|||
kfree(key->payload.data[0]);
|
||||
}
|
||||
|
||||
static int
|
||||
cifs_spnego_key_vet_description(const char *description)
|
||||
{
|
||||
/*
|
||||
* cifs.spnego descriptions are authority-bearing inputs to cifs.upcall.
|
||||
* They are only valid when produced by CIFS while using the private
|
||||
* spnego_cred installed below. Do not let userspace create this type
|
||||
* of key through request_key(2)/add_key(2), since the helper treats
|
||||
* pid/uid/creduid/upcall_target as kernel-originating fields.
|
||||
*/
|
||||
if (current_cred() != spnego_cred)
|
||||
return -EPERM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* keytype for CIFS spnego keys
|
||||
*/
|
||||
struct key_type cifs_spnego_key_type = {
|
||||
.name = "cifs.spnego",
|
||||
.vet_description = cifs_spnego_key_vet_description,
|
||||
.instantiate = cifs_spnego_key_instantiate,
|
||||
.destroy = cifs_spnego_key_destroy,
|
||||
.describe = user_describe,
|
||||
|
|
|
|||
|
|
@ -306,6 +306,8 @@ static void cifs_kill_sb(struct super_block *sb)
|
|||
|
||||
/* Wait for all pending oplock breaks to complete */
|
||||
flush_workqueue(cifsoplockd_wq);
|
||||
/* Wait for all opened files to release */
|
||||
flush_workqueue(deferredclose_wq);
|
||||
|
||||
/* finally release root dentry */
|
||||
dput(cifs_sb->root);
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ static int parse_symlink_flavor(struct fs_context *fc, char *value,
|
|||
#define DUP_CTX_STR(field) \
|
||||
do { \
|
||||
if (ctx->field) { \
|
||||
new_ctx->field = kstrdup(ctx->field, GFP_ATOMIC); \
|
||||
new_ctx->field = kstrdup(ctx->field, GFP_KERNEL); \
|
||||
if (new_ctx->field == NULL) { \
|
||||
smb3_cleanup_fs_context_contents(new_ctx); \
|
||||
return -ENOMEM; \
|
||||
|
|
|
|||
|
|
@ -33,13 +33,17 @@ static const struct nla_policy cifs_genl_policy[CIFS_GENL_ATTR_MAX + 1] = {
|
|||
static const struct genl_ops cifs_genl_ops[] = {
|
||||
{
|
||||
.cmd = CIFS_GENL_CMD_SWN_NOTIFY,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = cifs_swn_notify,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct genl_multicast_group cifs_genl_mcgrps[] = {
|
||||
[CIFS_GENL_MCGRP_SWN] = { .name = CIFS_GENL_MCGRP_SWN_NAME },
|
||||
[CIFS_GENL_MCGRP_SWN] = {
|
||||
.name = CIFS_GENL_MCGRP_SWN_NAME,
|
||||
.flags = GENL_MCAST_CAP_NET_ADMIN,
|
||||
},
|
||||
};
|
||||
|
||||
struct genl_family cifs_genl_family = {
|
||||
|
|
|
|||
|
|
@ -4836,7 +4836,7 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,
|
|||
}
|
||||
|
||||
/* Copy the data to the output I/O iterator. */
|
||||
rdata->result = cifs_copy_folioq_to_iter(buffer, buffer_len,
|
||||
rdata->result = cifs_copy_folioq_to_iter(buffer, data_len,
|
||||
cur_off, &rdata->subreq.io_iter);
|
||||
if (rdata->result != 0) {
|
||||
if (is_offloaded)
|
||||
|
|
@ -4845,7 +4845,7 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,
|
|||
dequeue_mid(server, mid, rdata->result);
|
||||
return 0;
|
||||
}
|
||||
rdata->got_bytes = buffer_len;
|
||||
rdata->got_bytes = data_len;
|
||||
|
||||
} else if (!check_add_overflow(data_offset, data_len, &end_off) &&
|
||||
buf_len >= end_off) {
|
||||
|
|
|
|||
|
|
@ -169,7 +169,9 @@ smb2_find_smb_sess_tcon_unlocked(struct cifs_ses *ses, __u32 tid)
|
|||
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
|
||||
if (tcon->tid != tid)
|
||||
continue;
|
||||
spin_lock(&tcon->tc_lock);
|
||||
++tcon->tc_count;
|
||||
spin_unlock(&tcon->tc_lock);
|
||||
trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count,
|
||||
netfs_trace_tcon_ref_get_find_sess_tcon);
|
||||
return tcon;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ void smbdirect_connection_legacy_debug_proc_show(struct smbdirect_socket *sc,
|
|||
|
||||
seq_puts(m, "\n");
|
||||
seq_printf(m, "Conn keep_alive_interval: %u ",
|
||||
sp->keepalive_interval_msec * 1000);
|
||||
sp->keepalive_interval_msec / 1000);
|
||||
seq_printf(m, "max_readwrite_size: %u rdma_readwrite_threshold: %u",
|
||||
sp->max_read_write_size,
|
||||
rdma_readwrite_threshold);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user