Merge tag 'fixes-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Dec 2020 00:40:27 +0000 (16:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Dec 2020 00:40:27 +0000 (16:40 -0800)
Pull misc fixes from Christian Brauner:
 "This contains several fixes which felt worth being combined into a
  single branch:

   - Use put_nsproxy() instead of open-coding it switch_task_namespaces()

   - Kirill's work to unify lifecycle management for all namespaces. The
     lifetime counters are used identically for all namespaces types.
     Namespaces may of course have additional unrelated counters and
     these are not altered. This work allows us to unify the type of the
     counters and reduces maintenance cost by moving the counter in one
     place and indicating that basic lifetime management is identical
     for all namespaces.

   - Peilin's fix adding three byte padding to Dmitry's
     PTRACE_GET_SYSCALL_INFO uapi struct to prevent an info leak.

   - Two smal patches to convert from the /* fall through */ comment
     annotation to the fallthrough keyword annotation which I had taken
     into my branch and into -next before df561f6688fe ("treewide: Use
     fallthrough pseudo-keyword") made it upstream which fixed this
     tree-wide.

     Since I didn't want to invalidate all testing for other commits I
     didn't rebase and kept them"

* tag 'fixes-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
  nsproxy: use put_nsproxy() in switch_task_namespaces()
  sys: Convert to the new fallthrough notation
  signal: Convert to the new fallthrough notation
  time: Use generic ns_common::count
  cgroup: Use generic ns_common::count
  mnt: Use generic ns_common::count
  user: Use generic ns_common::count
  pid: Use generic ns_common::count
  ipc: Use generic ns_common::count
  uts: Use generic ns_common::count
  net: Use generic ns_common::count
  ns: Add a common refcount into ns_common
  ptrace: Prevent kernel-infoleak in ptrace_get_syscall_info()

12 files changed:
1  2 
fs/namespace.c
include/linux/time_namespace.h
include/net/net_namespace.h
kernel/cgroup/cgroup.c
kernel/nsproxy.c
kernel/pid.c
kernel/pid_namespace.c
kernel/time/namespace.c
kernel/user_namespace.c
net/core/net-sysfs.c
net/core/net_namespace.c
net/ipv4/tcp_metrics.c

diff --cc fs/namespace.c
Simple merge
index 30312166e70ad11a71a5d14c19470c737b35f8cf,a51ffc089219080bd2fdeb436d36f358f83c2a85..3146f1c056c9895a45d14f75d3b3c49f730b4dd5
@@@ -44,8 -42,8 +42,8 @@@ static inline struct time_namespace *ge
  struct time_namespace *copy_time_ns(unsigned long flags,
                                    struct user_namespace *user_ns,
                                    struct time_namespace *old_ns);
- void free_time_ns(struct kref *kref);
+ void free_time_ns(struct time_namespace *ns);
 -int timens_on_fork(struct nsproxy *nsproxy, struct task_struct *tsk);
 +void timens_on_fork(struct nsproxy *nsproxy, struct task_struct *tsk);
  struct vdso_data *arch_get_vdso_data(void *vvar_page);
  
  static inline void put_time_ns(struct time_namespace *ns)
Simple merge
Simple merge
Simple merge
diff --cc kernel/pid.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index dbc66b896287a49df15e3ca76eb9b6db27c73153,5f658cbedd3431213c94dd9727c9e104fe640247..2ef3b4557f40d72d27a1642d98f1e8f06caf9835
@@@ -249,13 -248,13 +249,13 @@@ int peernet2id_alloc(struct net *net, s
  {
        int id;
  
-       if (refcount_read(&net->count) == 0)
+       if (refcount_read(&net->ns.count) == 0)
                return NETNSA_NSID_NOT_ASSIGNED;
  
 -      spin_lock(&net->nsid_lock);
 +      spin_lock_bh(&net->nsid_lock);
        id = __peernet2id(net, peer);
        if (id >= 0) {
 -              spin_unlock(&net->nsid_lock);
 +              spin_unlock_bh(&net->nsid_lock);
                return id;
        }
  
Simple merge