diff options
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -374,6 +374,25 @@ long do_faccessat(int dfd, const char __user *filename, int mode) | |||
374 | override_cred->cap_permitted; | 374 | override_cred->cap_permitted; |
375 | } | 375 | } |
376 | 376 | ||
377 | /* | ||
378 | * The new set of credentials can *only* be used in | ||
379 | * task-synchronous circumstances, and does not need | ||
380 | * RCU freeing, unless somebody then takes a separate | ||
381 | * reference to it. | ||
382 | * | ||
383 | * NOTE! This is _only_ true because this credential | ||
384 | * is used purely for override_creds() that installs | ||
385 | * it as the subjective cred. Other threads will be | ||
386 | * accessing ->real_cred, not the subjective cred. | ||
387 | * | ||
388 | * If somebody _does_ make a copy of this (using the | ||
389 | * 'get_current_cred()' function), that will clear the | ||
390 | * non_rcu field, because now that other user may be | ||
391 | * expecting RCU freeing. But normal thread-synchronous | ||
392 | * cred accesses will keep things non-RCY. | ||
393 | */ | ||
394 | override_cred->non_rcu = 1; | ||
395 | |||
377 | old_cred = override_creds(override_cred); | 396 | old_cred = override_creds(override_cred); |
378 | retry: | 397 | retry: |
379 | res = user_path_at(dfd, filename, lookup_flags, &path); | 398 | res = user_path_at(dfd, filename, lookup_flags, &path); |