]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cgroup: Fix sock_cgroup_data on big-endian.
authorCong Wang <xiyou.wangcong@gmail.com>
Thu, 9 Jul 2020 23:28:44 +0000 (16:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:22:21 +0000 (09:22 +0200)
[ Upstream commit 14b032b8f8fce03a546dcf365454bec8c4a58d7d ]

In order for no_refcnt and is_data to be the lowest order two
bits in the 'val' we have to pad out the bitfield of the u8.

Fixes: ad0f75e5f57c ("cgroup: fix cgroup_sk_alloc() for sk_clone_lock()")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/cgroup-defs.h

index 26e74349f0003b2d99266f1cddce6f3b89aa807d..9e1ff02d6c4e4bec96c6331f17e71eeb860b27ca 100644 (file)
@@ -683,6 +683,7 @@ struct sock_cgroup_data {
                struct {
                        u8      is_data : 1;
                        u8      no_refcnt : 1;
+                       u8      unused : 6;
                        u8      padding;
                        u16     prioidx;
                        u32     classid;
@@ -692,6 +693,7 @@ struct sock_cgroup_data {
                        u32     classid;
                        u16     prioidx;
                        u8      padding;
+                       u8      unused : 6;
                        u8      no_refcnt : 1;
                        u8      is_data : 1;
                } __packed;