]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up some patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Dec 2023 18:02:21 +0000 (19:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Dec 2023 18:02:21 +0000 (19:02 +0100)
queue-4.14/cred-switch-to-using-atomic_long_t.patch
queue-4.19/cred-switch-to-using-atomic_long_t.patch
queue-6.6/hid-glorious-fix-glorious-model-i-hid-report.patch

index bdf08459f83fef8823bf9393de79bf31c7d392a9..8cd5578b46b5932b1caf2bdd432622f590c40387 100644 (file)
@@ -18,13 +18,13 @@ Signed-off-by: Jens Axboe <axboe@kernel.dk>
 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- include/linux/cred.h |    8 +++---
- kernel/cred.c        |   64 +++++++++++++++++++++++++--------------------------
+ include/linux/cred.h |    6 ++--
+ kernel/cred.c        |   66 +++++++++++++++++++++++++--------------------------
  2 files changed, 36 insertions(+), 36 deletions(-)
 
 --- a/include/linux/cred.h
 +++ b/include/linux/cred.h
-@@ -108,7 +108,7 @@ static inline int groups_search(const st
+@@ -109,7 +109,7 @@ extern void groups_sort(struct group_inf
   * same context as task->real_cred.
   */
  struct cred {
@@ -33,7 +33,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  #ifdef CONFIG_DEBUG_CREDENTIALS
        atomic_t        subscribers;    /* number of processes subscribed */
        void            *put_addr;
-@@ -228,7 +228,7 @@ static inline bool cap_ambient_invariant
+@@ -226,7 +226,7 @@ static inline bool cap_ambient_invariant
   */
  static inline struct cred *get_new_cred(struct cred *cred)
  {
@@ -42,16 +42,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        return cred;
  }
  
-@@ -260,7 +260,7 @@ static inline const struct cred *get_cre
-       struct cred *nonconst_cred = (struct cred *) cred;
-       if (!cred)
-               return NULL;
--      if (!atomic_inc_not_zero(&nonconst_cred->usage))
-+      if (!atomic_long_inc_not_zero(&nonconst_cred->usage))
-               return NULL;
-       validate_creds(cred);
-       nonconst_cred->non_rcu = 0;
-@@ -284,7 +284,7 @@ static inline void put_cred(const struct
+@@ -270,7 +270,7 @@ static inline void put_cred(const struct
  
        if (cred) {
                validate_creds(cred);
@@ -62,7 +53,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  }
 --- a/kernel/cred.c
 +++ b/kernel/cred.c
-@@ -99,17 +99,17 @@ static void put_cred_rcu(struct rcu_head
+@@ -101,17 +101,17 @@ static void put_cred_rcu(struct rcu_head
  
  #ifdef CONFIG_DEBUG_CREDENTIALS
        if (cred->magic != CRED_MAGIC_DEAD ||
@@ -112,7 +103,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(tsk->cred));
  
        cred = (struct cred *) tsk->real_cred;
-@@ -221,7 +221,7 @@ struct cred *cred_alloc_blank(void)
+@@ -197,7 +197,7 @@ const struct cred *get_task_cred(struct
+       do {
+               cred = __task_cred((task));
+               BUG_ON(!cred);
+-      } while (!atomic_inc_not_zero(&((struct cred *)cred)->usage));
++      } while (!atomic_long_inc_not_zero(&((struct cred *)cred)->usage));
+       rcu_read_unlock();
+       return cred;
+@@ -215,7 +215,7 @@ struct cred *cred_alloc_blank(void)
        if (!new)
                return NULL;
  
@@ -121,7 +121,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  #ifdef CONFIG_DEBUG_CREDENTIALS
        new->magic = CRED_MAGIC;
  #endif
-@@ -267,7 +267,7 @@ struct cred *prepare_creds(void)
+@@ -262,7 +262,7 @@ struct cred *prepare_creds(void)
        memcpy(new, old, sizeof(struct cred));
  
        new->non_rcu = 0;
@@ -130,7 +130,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        set_cred_subscribers(new, 0);
        get_group_info(new->group_info);
        get_uid(new->user);
-@@ -355,8 +355,8 @@ int copy_creds(struct task_struct *p, un
+@@ -338,8 +338,8 @@ int copy_creds(struct task_struct *p, un
                p->real_cred = get_cred(p->cred);
                get_cred(p->cred);
                alter_cred_subscribers(p->cred, 2);
@@ -139,9 +139,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +              kdebug("share_creds(%p{%ld,%d})",
 +                     p->cred, atomic_long_read(&p->cred->usage),
                       read_cred_subscribers(p->cred));
-               inc_rlimit_ucounts(task_ucounts(p), UCOUNT_RLIMIT_NPROC, 1);
+               atomic_inc(&p->cred->user->processes);
                return 0;
-@@ -449,8 +449,8 @@ int commit_creds(struct cred *new)
+@@ -429,8 +429,8 @@ int commit_creds(struct cred *new)
        struct task_struct *task = current;
        const struct cred *old = task->real_cred;
  
@@ -152,7 +152,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(new));
  
        BUG_ON(task->cred != old);
-@@ -459,7 +459,7 @@ int commit_creds(struct cred *new)
+@@ -439,7 +439,7 @@ int commit_creds(struct cred *new)
        validate_creds(old);
        validate_creds(new);
  #endif
@@ -161,7 +161,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  
        get_cred(new); /* we will require a ref for the subj creds too */
  
-@@ -532,14 +532,14 @@ EXPORT_SYMBOL(commit_creds);
+@@ -512,14 +512,14 @@ EXPORT_SYMBOL(commit_creds);
   */
  void abort_creds(struct cred *new)
  {
@@ -179,7 +179,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        put_cred(new);
  }
  EXPORT_SYMBOL(abort_creds);
-@@ -555,8 +555,8 @@ const struct cred *override_creds(const
+@@ -535,8 +535,8 @@ const struct cred *override_creds(const
  {
        const struct cred *old = current->cred;
  
@@ -190,7 +190,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(new));
  
        validate_creds(old);
-@@ -578,8 +578,8 @@ const struct cred *override_creds(const
+@@ -558,8 +558,8 @@ const struct cred *override_creds(const
        rcu_assign_pointer(current->cred, new);
        alter_cred_subscribers(old, -1);
  
@@ -201,7 +201,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(old));
        return old;
  }
-@@ -596,8 +596,8 @@ void revert_creds(const struct cred *old
+@@ -576,8 +576,8 @@ void revert_creds(const struct cred *old
  {
        const struct cred *override = current->cred;
  
@@ -212,7 +212,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(old));
  
        validate_creds(old);
-@@ -729,7 +729,7 @@ struct cred *prepare_kernel_cred(struct
+@@ -637,7 +637,7 @@ struct cred *prepare_kernel_cred(struct
  
        *new = *old;
        new->non_rcu = 0;
@@ -221,7 +221,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        set_cred_subscribers(new, 0);
        get_uid(new->user);
        get_user_ns(new->user_ns);
-@@ -843,8 +843,8 @@ static void dump_invalid_creds(const str
+@@ -760,8 +760,8 @@ static void dump_invalid_creds(const str
               cred == tsk->cred ? "[eff]" : "");
        printk(KERN_ERR "CRED: ->magic=%x, put_addr=%p\n",
               cred->magic, cred->put_addr);
@@ -232,7 +232,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(cred));
        printk(KERN_ERR "CRED: ->*uid = { %d,%d,%d,%d }\n",
                from_kuid_munged(&init_user_ns, cred->uid),
-@@ -916,9 +916,9 @@ EXPORT_SYMBOL(__validate_process_creds);
+@@ -833,9 +833,9 @@ EXPORT_SYMBOL(__validate_process_creds);
   */
  void validate_creds_for_do_exit(struct task_struct *tsk)
  {
index bdf08459f83fef8823bf9393de79bf31c7d392a9..a5addec72a76e209641cbb0688a00037e786bb2e 100644 (file)
@@ -18,13 +18,13 @@ Signed-off-by: Jens Axboe <axboe@kernel.dk>
 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- include/linux/cred.h |    8 +++---
- kernel/cred.c        |   64 +++++++++++++++++++++++++--------------------------
+ include/linux/cred.h |    6 ++--
+ kernel/cred.c        |   66 +++++++++++++++++++++++++--------------------------
  2 files changed, 36 insertions(+), 36 deletions(-)
 
 --- a/include/linux/cred.h
 +++ b/include/linux/cred.h
-@@ -108,7 +108,7 @@ static inline int groups_search(const st
+@@ -114,7 +114,7 @@ static inline int groups_search(const st
   * same context as task->real_cred.
   */
  struct cred {
@@ -33,7 +33,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  #ifdef CONFIG_DEBUG_CREDENTIALS
        atomic_t        subscribers;    /* number of processes subscribed */
        void            *put_addr;
-@@ -228,7 +228,7 @@ static inline bool cap_ambient_invariant
+@@ -231,7 +231,7 @@ static inline bool cap_ambient_invariant
   */
  static inline struct cred *get_new_cred(struct cred *cred)
  {
@@ -42,16 +42,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        return cred;
  }
  
-@@ -260,7 +260,7 @@ static inline const struct cred *get_cre
-       struct cred *nonconst_cred = (struct cred *) cred;
-       if (!cred)
-               return NULL;
--      if (!atomic_inc_not_zero(&nonconst_cred->usage))
-+      if (!atomic_long_inc_not_zero(&nonconst_cred->usage))
-               return NULL;
-       validate_creds(cred);
-       nonconst_cred->non_rcu = 0;
-@@ -284,7 +284,7 @@ static inline void put_cred(const struct
+@@ -275,7 +275,7 @@ static inline void put_cred(const struct
  
        if (cred) {
                validate_creds(cred);
@@ -62,7 +53,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  }
 --- a/kernel/cred.c
 +++ b/kernel/cred.c
-@@ -99,17 +99,17 @@ static void put_cred_rcu(struct rcu_head
+@@ -101,17 +101,17 @@ static void put_cred_rcu(struct rcu_head
  
  #ifdef CONFIG_DEBUG_CREDENTIALS
        if (cred->magic != CRED_MAGIC_DEAD ||
@@ -112,7 +103,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(tsk->cred));
  
        cred = (struct cred *) tsk->real_cred;
-@@ -221,7 +221,7 @@ struct cred *cred_alloc_blank(void)
+@@ -197,7 +197,7 @@ const struct cred *get_task_cred(struct
+       do {
+               cred = __task_cred((task));
+               BUG_ON(!cred);
+-      } while (!atomic_inc_not_zero(&((struct cred *)cred)->usage));
++      } while (!atomic_long_inc_not_zero(&((struct cred *)cred)->usage));
+       rcu_read_unlock();
+       return cred;
+@@ -215,7 +215,7 @@ struct cred *cred_alloc_blank(void)
        if (!new)
                return NULL;
  
@@ -121,7 +121,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  #ifdef CONFIG_DEBUG_CREDENTIALS
        new->magic = CRED_MAGIC;
  #endif
-@@ -267,7 +267,7 @@ struct cred *prepare_creds(void)
+@@ -262,7 +262,7 @@ struct cred *prepare_creds(void)
        memcpy(new, old, sizeof(struct cred));
  
        new->non_rcu = 0;
@@ -130,7 +130,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        set_cred_subscribers(new, 0);
        get_group_info(new->group_info);
        get_uid(new->user);
-@@ -355,8 +355,8 @@ int copy_creds(struct task_struct *p, un
+@@ -338,8 +338,8 @@ int copy_creds(struct task_struct *p, un
                p->real_cred = get_cred(p->cred);
                get_cred(p->cred);
                alter_cred_subscribers(p->cred, 2);
@@ -139,9 +139,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +              kdebug("share_creds(%p{%ld,%d})",
 +                     p->cred, atomic_long_read(&p->cred->usage),
                       read_cred_subscribers(p->cred));
-               inc_rlimit_ucounts(task_ucounts(p), UCOUNT_RLIMIT_NPROC, 1);
+               atomic_inc(&p->cred->user->processes);
                return 0;
-@@ -449,8 +449,8 @@ int commit_creds(struct cred *new)
+@@ -429,8 +429,8 @@ int commit_creds(struct cred *new)
        struct task_struct *task = current;
        const struct cred *old = task->real_cred;
  
@@ -152,7 +152,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(new));
  
        BUG_ON(task->cred != old);
-@@ -459,7 +459,7 @@ int commit_creds(struct cred *new)
+@@ -439,7 +439,7 @@ int commit_creds(struct cred *new)
        validate_creds(old);
        validate_creds(new);
  #endif
@@ -161,7 +161,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  
        get_cred(new); /* we will require a ref for the subj creds too */
  
-@@ -532,14 +532,14 @@ EXPORT_SYMBOL(commit_creds);
+@@ -512,14 +512,14 @@ EXPORT_SYMBOL(commit_creds);
   */
  void abort_creds(struct cred *new)
  {
@@ -179,7 +179,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        put_cred(new);
  }
  EXPORT_SYMBOL(abort_creds);
-@@ -555,8 +555,8 @@ const struct cred *override_creds(const
+@@ -535,8 +535,8 @@ const struct cred *override_creds(const
  {
        const struct cred *old = current->cred;
  
@@ -190,7 +190,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(new));
  
        validate_creds(old);
-@@ -578,8 +578,8 @@ const struct cred *override_creds(const
+@@ -558,8 +558,8 @@ const struct cred *override_creds(const
        rcu_assign_pointer(current->cred, new);
        alter_cred_subscribers(old, -1);
  
@@ -201,7 +201,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(old));
        return old;
  }
-@@ -596,8 +596,8 @@ void revert_creds(const struct cred *old
+@@ -576,8 +576,8 @@ void revert_creds(const struct cred *old
  {
        const struct cred *override = current->cred;
  
@@ -212,7 +212,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(old));
  
        validate_creds(old);
-@@ -729,7 +729,7 @@ struct cred *prepare_kernel_cred(struct
+@@ -637,7 +637,7 @@ struct cred *prepare_kernel_cred(struct
  
        *new = *old;
        new->non_rcu = 0;
@@ -221,7 +221,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        set_cred_subscribers(new, 0);
        get_uid(new->user);
        get_user_ns(new->user_ns);
-@@ -843,8 +843,8 @@ static void dump_invalid_creds(const str
+@@ -760,8 +760,8 @@ static void dump_invalid_creds(const str
               cred == tsk->cred ? "[eff]" : "");
        printk(KERN_ERR "CRED: ->magic=%x, put_addr=%p\n",
               cred->magic, cred->put_addr);
@@ -232,7 +232,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
               read_cred_subscribers(cred));
        printk(KERN_ERR "CRED: ->*uid = { %d,%d,%d,%d }\n",
                from_kuid_munged(&init_user_ns, cred->uid),
-@@ -916,9 +916,9 @@ EXPORT_SYMBOL(__validate_process_creds);
+@@ -833,9 +833,9 @@ EXPORT_SYMBOL(__validate_process_creds);
   */
  void validate_creds_for_do_exit(struct task_struct *tsk)
  {
index 9c8df7df8b9fbae852c1943c2dc1bc850dd5b9c3..5a0e9129468dfb732bc0e087f4d90bf01353e9b9 100644 (file)
@@ -40,15 +40,13 @@ Signed-off-by: Brett Raye <braye@fastmail.com>
 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- drivers/hid/hid-glorious.c | 16 ++++++++++++++--
- drivers/hid/hid-ids.h      | 11 +++++++----
+ drivers/hid/hid-glorious.c |   16 ++++++++++++++--
+ drivers/hid/hid-ids.h      |   11 +++++++----
  2 files changed, 21 insertions(+), 6 deletions(-)
 
-diff --git a/drivers/hid/hid-glorious.c b/drivers/hid/hid-glorious.c
-index 558eb08c19ef9..281b3a7187cec 100644
 --- a/drivers/hid/hid-glorious.c
 +++ b/drivers/hid/hid-glorious.c
-@@ -21,6 +21,10 @@ MODULE_DESCRIPTION("HID driver for Glorious PC Gaming Race mice");
+@@ -21,6 +21,10 @@ MODULE_DESCRIPTION("HID driver for Glori
   * Glorious Model O and O- specify the const flag in the consumer input
   * report descriptor, which leads to inputs being ignored. Fix this
   * by patching the descriptor.
@@ -59,7 +57,7 @@ index 558eb08c19ef9..281b3a7187cec 100644
   */
  static __u8 *glorious_report_fixup(struct hid_device *hdev, __u8 *rdesc,
                unsigned int *rsize)
-@@ -32,6 +36,10 @@ static __u8 *glorious_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+@@ -32,6 +36,10 @@ static __u8 *glorious_report_fixup(struc
                rdesc[85] = rdesc[113] = rdesc[141] = \
                        HID_MAIN_ITEM_VARIABLE | HID_MAIN_ITEM_RELATIVE;
        }
@@ -70,7 +68,7 @@ index 558eb08c19ef9..281b3a7187cec 100644
        return rdesc;
  }
  
-@@ -44,6 +52,8 @@ static void glorious_update_name(struct hid_device *hdev)
+@@ -44,6 +52,8 @@ static void glorious_update_name(struct
                model = "Model O"; break;
        case USB_DEVICE_ID_GLORIOUS_MODEL_D:
                model = "Model D"; break;
@@ -79,7 +77,7 @@ index 558eb08c19ef9..281b3a7187cec 100644
        }
  
        snprintf(hdev->name, sizeof(hdev->name), "%s %s", "Glorious", model);
-@@ -66,10 +76,12 @@ static int glorious_probe(struct hid_device *hdev,
+@@ -66,10 +76,12 @@ static int glorious_probe(struct hid_dev
  }
  
  static const struct hid_device_id glorious_devices[] = {
@@ -94,8 +92,6 @@ index 558eb08c19ef9..281b3a7187cec 100644
        { }
  };
  MODULE_DEVICE_TABLE(hid, glorious_devices);
-diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
-index d10ccfa17e168..c6e4e0d1f2147 100644
 --- a/drivers/hid/hid-ids.h
 +++ b/drivers/hid/hid-ids.h
 @@ -511,10 +511,6 @@
@@ -109,9 +105,9 @@ index d10ccfa17e168..c6e4e0d1f2147 100644
  #define I2C_VENDOR_ID_GOODIX          0x27c6
  #define I2C_DEVICE_ID_GOODIX_01F0     0x01f0
  
-@@ -745,6 +741,9 @@
- #define USB_VENDOR_ID_LABTEC          0x1020
+@@ -746,6 +742,9 @@
  #define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD        0x0006
+ #define USB_DEVICE_ID_LABTEC_ODDOR_HANDBRAKE  0x8888
  
 +#define USB_VENDOR_ID_LAVIEW          0x22D4
 +#define USB_DEVICE_ID_GLORIOUS_MODEL_I        0x1503
@@ -119,7 +115,7 @@ index d10ccfa17e168..c6e4e0d1f2147 100644
  #define USB_VENDOR_ID_LCPOWER         0x1241
  #define USB_DEVICE_ID_LCPOWER_LC1000  0xf767
  
-@@ -1159,6 +1158,10 @@
+@@ -1160,6 +1159,10 @@
  #define USB_VENDOR_ID_SIGMATEL                0x066F
  #define USB_DEVICE_ID_SIGMATEL_STMP3780       0x3780
  
@@ -130,6 +126,3 @@ index d10ccfa17e168..c6e4e0d1f2147 100644
  #define USB_VENDOR_ID_SIS_TOUCH               0x0457
  #define USB_DEVICE_ID_SIS9200_TOUCH   0x9200
  #define USB_DEVICE_ID_SIS817_TOUCH    0x0817
--- 
-2.43.0
-