diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-12 07:37:39 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-12 07:37:39 +0200 |
| commit | e6aa640eb2f68920cb849aec0cab44f05d843238 (patch) | |
| tree | 42e07ee412112abe90d459f821e8d73c26cc648e /fs/open.c | |
| parent | 1f573cce48a2ebb35953034062ef01056b7d6a58 (diff) | |
| parent | d45331b00ddb179e291766617259261c112db872 (diff) | |
| download | linux-next-e6aa640eb2f68920cb849aec0cab44f05d843238.tar.gz linux-next-e6aa640eb2f68920cb849aec0cab44f05d843238.zip | |
Merge 5.3-rc4 into driver-core-next
We need the driver core fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/open.c')
| -rw-r--r-- | fs/open.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/open.c b/fs/open.c index b5b80469b93d..a59abe3c669a 100644 --- a/fs/open.c +++ b/fs/open.c @@ -374,6 +374,25 @@ long do_faccessat(int dfd, const char __user *filename, int mode) override_cred->cap_permitted; } + /* + * The new set of credentials can *only* be used in + * task-synchronous circumstances, and does not need + * RCU freeing, unless somebody then takes a separate + * reference to it. + * + * NOTE! This is _only_ true because this credential + * is used purely for override_creds() that installs + * it as the subjective cred. Other threads will be + * accessing ->real_cred, not the subjective cred. + * + * If somebody _does_ make a copy of this (using the + * 'get_current_cred()' function), that will clear the + * non_rcu field, because now that other user may be + * expecting RCU freeing. But normal thread-synchronous + * cred accesses will keep things non-RCY. + */ + override_cred->non_rcu = 1; + old_cred = override_creds(override_cred); retry: res = user_path_at(dfd, filename, lookup_flags, &path); |
