Unverified Commit 203e3cc2 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15376 [openEuler-24.03-LTS][linux-6.6.y sync] Backport 6.6.62-6.6.63 LTS Conflicts Patches

Merge Pull Request from: @koishimind 
 
Submit after modification(2):
1. mptcp: update local address flags when setting it
2. NFSD: Async COPY result needs to return a write verifier

KABI break(1):
1. mm: refactor arch_calc_vm_flag_bits() and arm64 MTE handling

Do nothing because merged(2):
1. mm: avoid unsafe VMA hook invocation when error arises on mmap hook
2. mm: resolve faulty mmap_region() error path behaviour 
 
Link:https://gitee.com/openeuler/kernel/pulls/15376

 

Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 9ace3a04 eb359f41
Loading
Loading
Loading
Loading
+8 −15
Original line number Diff line number Diff line
@@ -751,15 +751,6 @@ nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
			   &access->ac_supported);
}

static void gen_boot_verifier(nfs4_verifier *verifier, struct net *net)
{
	__be32 *verf = (__be32 *)verifier->data;

	BUILD_BUG_ON(2*sizeof(*verf) != sizeof(verifier->data));

	nfsd_copy_write_verifier(verf, net_generic(net, nfsd_net_id));
}

static __be32
nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
	     union nfsd4_op_u *u)
@@ -1627,7 +1618,6 @@ static void nfsd4_init_copy_res(struct nfsd4_copy *copy, bool sync)
		test_bit(NFSD4_COPY_F_COMMITTED, &copy->cp_flags) ?
			NFS_FILE_SYNC : NFS_UNSTABLE;
	nfsd4_copy_set_sync(copy, sync);
	gen_boot_verifier(&copy->cp_res.wr_verifier, copy->cp_clp->net);
}

static ssize_t _nfsd_copy_file_range(struct nfsd4_copy *copy,
@@ -1798,9 +1788,14 @@ static __be32
nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
		union nfsd4_op_u *u)
{
	struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
	struct nfsd4_copy *async_copy = NULL;
	struct nfsd4_copy *copy = &u->copy;
	struct nfsd42_write_res *result;
	__be32 status;
	struct nfsd4_copy *async_copy = NULL;

	result = &copy->cp_res;
	nfsd_copy_write_verifier((__be32 *)&result->wr_verifier.data, nn);

	copy->cp_clp = cstate->clp;
	if (nfsd4_ssc_is_inter(copy)) {
@@ -1820,8 +1815,6 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
	memcpy(&copy->fh, &cstate->current_fh.fh_handle,
		sizeof(struct knfsd_fh));
	if (nfsd4_copy_is_async(copy)) {
		struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);

		async_copy = kzalloc(sizeof(struct nfsd4_copy), GFP_KERNEL);
		if (!async_copy)
			goto out_err;
@@ -1837,8 +1830,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
			goto out_err;
		if (!nfs4_init_copy_state(nn, copy))
			goto out_err;
		memcpy(&copy->cp_res.cb_stateid, &copy->cp_stateid.cs_stid,
			sizeof(copy->cp_res.cb_stateid));
		memcpy(&result->cb_stateid, &copy->cp_stateid.cs_stid,
			sizeof(result->cb_stateid));
		dup_copy_fields(copy, async_copy);
		async_copy->copy_task = kthread_create(nfsd4_do_async_copy,
				async_copy, "%s", "copy thread");
+12 −0
Original line number Diff line number Diff line
@@ -558,6 +558,7 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
	struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN];
	struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR];
	struct net *net = sock_net(skb->sk);
	struct mptcp_pm_addr_entry *entry;
	struct mptcp_sock *msk;
	int ret = -EINVAL;
	struct sock *sk;
@@ -599,6 +600,17 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
	if (loc.flags & MPTCP_PM_ADDR_FLAG_BACKUP)
		bkup = 1;

	spin_lock_bh(&msk->pm.lock);
	list_for_each_entry(entry, &msk->pm.userspace_pm_local_addr_list, list) {
		if (mptcp_addresses_equal(&entry->addr, &loc.addr, false)) {
			if (bkup)
				entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
			else
				entry->flags &= ~MPTCP_PM_ADDR_FLAG_BACKUP;
		}
	}
	spin_unlock_bh(&msk->pm.lock);

	lock_sock(sk);
	ret = mptcp_pm_nl_mp_prio_send_ack(msk, &loc.addr, &rem.addr, bkup);
	release_sock(sk);