Skip to content

Commit 14b032b

Browse files
congwangdavem330
authored andcommitted
cgroup: Fix sock_cgroup_data on big-endian.
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: ad0f75e ("cgroup: fix cgroup_sk_alloc() for sk_clone_lock()") Reported-by: Guenter Roeck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ce69e56 commit 14b032b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/linux/cgroup-defs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ struct sock_cgroup_data {
792792
struct {
793793
u8 is_data : 1;
794794
u8 no_refcnt : 1;
795+
u8 unused : 6;
795796
u8 padding;
796797
u16 prioidx;
797798
u32 classid;
@@ -801,6 +802,7 @@ struct sock_cgroup_data {
801802
u32 classid;
802803
u16 prioidx;
803804
u8 padding;
805+
u8 unused : 6;
804806
u8 no_refcnt : 1;
805807
u8 is_data : 1;
806808
} __packed;

0 commit comments

Comments
 (0)