Skip to content

Commit 7f0e9ee

Browse files
committed
Merge tag 'vfs-6.14-rc6.fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs
Pull vfs fixes from Christian Brauner: - Fix spelling mistakes in idmappings.rst - Fix RCU warnings in override_creds()/revert_creds() - Create new pid namespaces with default limit now that pid_max is namespaced * tag 'vfs-6.14-rc6.fixes' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: pid: Do not set pid_max in new pid namespaces doc: correcting two prefix errors in idmappings.rst cred: Fix RCU warnings in override/revert_creds
2 parents ebb0f38 + d385c8b commit 7f0e9ee

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

Documentation/filesystems/idmappings.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ what id ``k11000`` corresponds to in the second or third idmapping. The
6363
straightforward algorithm to use is to apply the inverse of the first idmapping,
6464
mapping ``k11000`` up to ``u1000``. Afterwards, we can map ``u1000`` down using
6565
either the second idmapping mapping or third idmapping mapping. The second
66-
idmapping would map ``u1000`` down to ``21000``. The third idmapping would map
67-
``u1000`` down to ``u31000``.
66+
idmapping would map ``u1000`` down to ``k21000``. The third idmapping would map
67+
``u1000`` down to ``k31000``.
6868

6969
If we were given the same task for the following three idmappings::
7070

include/linux/cred.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,12 @@ static inline bool cap_ambient_invariant_ok(const struct cred *cred)
172172

173173
static inline const struct cred *override_creds(const struct cred *override_cred)
174174
{
175-
const struct cred *old = current->cred;
176-
177-
rcu_assign_pointer(current->cred, override_cred);
178-
return old;
175+
return rcu_replace_pointer(current->cred, override_cred, 1);
179176
}
180177

181178
static inline const struct cred *revert_creds(const struct cred *revert_cred)
182179
{
183-
const struct cred *override_cred = current->cred;
184-
185-
rcu_assign_pointer(current->cred, revert_cred);
186-
return override_cred;
180+
return rcu_replace_pointer(current->cred, revert_cred, 1);
187181
}
188182

189183
/**

kernel/pid_namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns
107107
goto out_free_idr;
108108
ns->ns.ops = &pidns_operations;
109109

110-
ns->pid_max = parent_pid_ns->pid_max;
110+
ns->pid_max = PID_MAX_LIMIT;
111111
err = register_pidns_sysctls(ns);
112112
if (err)
113113
goto out_free_inum;

0 commit comments

Comments
 (0)