Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

uapi: revert flexible-array conversions

These structures can get embedded in other structures in user-space
and cause all sorts of warnings and problems. So, we better don't take
any chances and keep the zero-length arrays in place for now.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

+12 -12
+1 -1
include/uapi/linux/bpf.h
··· 73 73 /* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */ 74 74 struct bpf_lpm_trie_key { 75 75 __u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */ 76 - __u8 data[]; /* Arbitrary size */ 76 + __u8 data[0]; /* Arbitrary size */ 77 77 }; 78 78 79 79 struct bpf_cgroup_storage_key {
+2 -2
include/uapi/linux/dlm_device.h
··· 45 45 void __user *bastaddr; 46 46 struct dlm_lksb __user *lksb; 47 47 char lvb[DLM_USER_LVB_LEN]; 48 - char name[]; 48 + char name[0]; 49 49 }; 50 50 51 51 struct dlm_lspace_params { 52 52 __u32 flags; 53 53 __u32 minor; 54 - char name[]; 54 + char name[0]; 55 55 }; 56 56 57 57 struct dlm_purge_params {
+1 -1
include/uapi/linux/fiemap.h
··· 34 34 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */ 35 35 __u32 fm_extent_count; /* size of fm_extents array (in) */ 36 36 __u32 fm_reserved; 37 - struct fiemap_extent fm_extents[]; /* array of mapped extents (out) */ 37 + struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */ 38 38 }; 39 39 40 40 #define FIEMAP_MAX_OFFSET (~0ULL)
+3 -3
include/uapi/linux/if_arcnet.h
··· 60 60 __u8 proto; /* protocol ID field - varies */ 61 61 __u8 split_flag; /* for use with split packets */ 62 62 __be16 sequence; /* sequence number */ 63 - __u8 payload[]; /* space remaining in packet (504 bytes)*/ 63 + __u8 payload[0]; /* space remaining in packet (504 bytes)*/ 64 64 }; 65 65 #define RFC1201_HDR_SIZE 4 66 66 ··· 69 69 */ 70 70 struct arc_rfc1051 { 71 71 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */ 72 - __u8 payload[]; /* 507 bytes */ 72 + __u8 payload[0]; /* 507 bytes */ 73 73 }; 74 74 #define RFC1051_HDR_SIZE 1 75 75 ··· 80 80 struct arc_eth_encap { 81 81 __u8 proto; /* Always ARC_P_ETHER */ 82 82 struct ethhdr eth; /* standard ethernet header (yuck!) */ 83 - __u8 payload[]; /* 493 bytes */ 83 + __u8 payload[0]; /* 493 bytes */ 84 84 }; 85 85 #define ETH_ENCAP_HDR_SIZE 14 86 86
+1 -1
include/uapi/linux/mmc/ioctl.h
··· 57 57 */ 58 58 struct mmc_ioc_multi_cmd { 59 59 __u64 num_of_cmds; 60 - struct mmc_ioc_cmd cmds[]; 60 + struct mmc_ioc_cmd cmds[0]; 61 61 }; 62 62 63 63 #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
+2 -2
include/uapi/linux/net_dropmon.h
··· 29 29 30 30 struct net_dm_config_msg { 31 31 __u32 entries; 32 - struct net_dm_config_entry options[]; 32 + struct net_dm_config_entry options[0]; 33 33 }; 34 34 35 35 struct net_dm_alert_msg { 36 36 __u32 entries; 37 - struct net_dm_drop_point points[]; 37 + struct net_dm_drop_point points[0]; 38 38 }; 39 39 40 40 struct net_dm_user_msg {
+1 -1
include/uapi/linux/netfilter_bridge/ebt_among.h
··· 40 40 struct ebt_mac_wormhash { 41 41 int table[257]; 42 42 int poolsize; 43 - struct ebt_mac_wormhash_tuple pool[]; 43 + struct ebt_mac_wormhash_tuple pool[0]; 44 44 }; 45 45 46 46 #define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
+1 -1
include/uapi/scsi/scsi_bsg_fc.h
··· 209 209 __u64 vendor_id; 210 210 211 211 /* start of vendor command area */ 212 - __u32 vendor_cmd[]; 212 + __u32 vendor_cmd[0]; 213 213 }; 214 214 215 215 /* Response: