]> Git Repo - linux.git/commitdiff
Merge tag 'kernel-6.14-rc1.cred' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Mon, 20 Jan 2025 18:13:06 +0000 (10:13 -0800)
committerLinus Torvalds <[email protected]>
Mon, 20 Jan 2025 18:13:06 +0000 (10:13 -0800)
Pull cred refcount updates from Christian Brauner:
 "For the v6.13 cycle we switched overlayfs to a variant of
  override_creds() that doesn't take an extra reference. To this end the
  {override,revert}_creds_light() helpers were introduced.

  This generalizes the idea behind {override,revert}_creds_light() to
  the {override,revert}_creds() helpers. Afterwards overriding and
  reverting credentials is reference count free unless the caller
  explicitly takes a reference.

  All callers have been appropriately ported"

* tag 'kernel-6.14-rc1.cred' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (30 commits)
  cred: fold get_new_cred_many() into get_cred_many()
  cred: remove unused get_new_cred()
  nfsd: avoid pointless cred reference count bump
  cachefiles: avoid pointless cred reference count bump
  dns_resolver: avoid pointless cred reference count bump
  trace: avoid pointless cred reference count bump
  cgroup: avoid pointless cred reference count bump
  acct: avoid pointless reference count bump
  io_uring: avoid pointless cred reference count bump
  smb: avoid pointless cred reference count bump
  cifs: avoid pointless cred reference count bump
  cifs: avoid pointless cred reference count bump
  ovl: avoid pointless cred reference count bump
  open: avoid pointless cred reference count bump
  nfsfh: avoid pointless cred reference count bump
  nfs/nfs4recover: avoid pointless cred reference count bump
  nfs/nfs4idmap: avoid pointless reference count bump
  nfs/localio: avoid pointless cred reference count bumps
  coredump: avoid pointless cred reference count bump
  binfmt_misc: avoid pointless cred reference count bump
  ...

1  2 
fs/smb/server/smb_common.c

index f51cd0816b1a940cc1b8517a27268c27c517c6b0,d009651fd5a8f80db16760ac1f93b6e92a08e9a4..425c756bcfb8628ebc023ec1c22423aafdfba124
@@@ -18,8 -18,8 +18,8 @@@
  #include "mgmt/share_config.h"
  
  /*for shortname implementation */
 -static const char basechars[43] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_-!@#$%";
 -#define MANGLE_BASE (sizeof(basechars) / sizeof(char) - 1)
 +static const char *basechars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_-!@#$%";
 +#define MANGLE_BASE (strlen(basechars) - 1)
  #define MAGIC_CHAR '~'
  #define PERIOD '.'
  #define mangle(V) ((char)(basechars[(V) % MANGLE_BASE]))
@@@ -781,10 -781,6 +781,6 @@@ int __ksmbd_override_fsids(struct ksmbd
  
        WARN_ON(work->saved_cred);
        work->saved_cred = override_creds(cred);
-       if (!work->saved_cred) {
-               abort_creds(cred);
-               return -EINVAL;
-       }
        return 0;
  }
  
@@@ -796,13 -792,11 +792,11 @@@ int ksmbd_override_fsids(struct ksmbd_w
  void ksmbd_revert_fsids(struct ksmbd_work *work)
  {
        const struct cred *cred;
        WARN_ON(!work->saved_cred);
  
-       cred = current_cred();
-       revert_creds(work->saved_cred);
-       put_cred(cred);
+       cred = revert_creds(work->saved_cred);
        work->saved_cred = NULL;
+       put_cred(cred);
  }
  
  __le32 smb_map_generic_desired_access(__le32 daccess)
This page took 0.077436 seconds and 4 git commands to generate.