mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
Merge efee6c7929 ("Merge tag 'tomoyo-pr-20220322' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1") into android-mainline
Steps on the way to 5.18-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ifd87c188fb6679513143ff7977e3ccc2d8e0f5e0
This commit is contained in:
@@ -152,7 +152,7 @@ struct memdesc_struct {
|
||||
unsigned long chksum;
|
||||
unsigned long optional_pa;
|
||||
unsigned long numclusters;
|
||||
struct memclust_struct cluster[0];
|
||||
struct memclust_struct cluster[];
|
||||
};
|
||||
|
||||
struct dsr_struct {
|
||||
|
||||
@@ -420,7 +420,7 @@ typedef struct sal_log_processor_info {
|
||||
* The rest of this structure consists of variable-length arrays, which can't be
|
||||
* expressed in C.
|
||||
*/
|
||||
sal_log_mod_error_info_t info[0];
|
||||
sal_log_mod_error_info_t info[];
|
||||
/*
|
||||
* This is what the rest looked like if C supported variable-length arrays:
|
||||
*
|
||||
|
||||
@@ -25,7 +25,7 @@ struct ccwgroup_device {
|
||||
unsigned int count;
|
||||
struct device dev;
|
||||
struct work_struct ungroup_work;
|
||||
struct ccw_device *cdev[0];
|
||||
struct ccw_device *cdev[];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,7 +63,7 @@ struct chsc_pnso_area {
|
||||
struct chsc_header response;
|
||||
u32:32;
|
||||
struct chsc_pnso_naihdr naihdr;
|
||||
struct chsc_pnso_naid_l2 entries[0];
|
||||
struct chsc_pnso_naid_l2 entries[];
|
||||
} __packed __aligned(PAGE_SIZE);
|
||||
|
||||
#endif /* _ASM_S390_CHSC_H */
|
||||
|
||||
@@ -78,7 +78,7 @@ struct aob {
|
||||
|
||||
struct aob_rq_header {
|
||||
struct scm_device *scmdev;
|
||||
char data[0];
|
||||
char data[];
|
||||
};
|
||||
|
||||
struct scm_device {
|
||||
|
||||
@@ -214,7 +214,7 @@ struct dcw_intrg_data {
|
||||
u32 :32;
|
||||
u64 time;
|
||||
u64 prog_id;
|
||||
u8 prog_data[0];
|
||||
u8 prog_data[];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define DCW_FLAGS_CC (1 << (7 - 1))
|
||||
@@ -241,7 +241,7 @@ struct dcw {
|
||||
u32 :8;
|
||||
u32 cd_count:8;
|
||||
u32 count;
|
||||
u8 cd[0];
|
||||
u8 cd[];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define TCCB_FORMAT_DEFAULT 0x7f
|
||||
|
||||
@@ -108,7 +108,7 @@ clear_normalized_cda(struct ccw1 * ccw)
|
||||
struct idal_buffer {
|
||||
size_t size;
|
||||
size_t page_order;
|
||||
void *data[0];
|
||||
void *data[];
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -112,7 +112,7 @@ struct zpci_report_error_header {
|
||||
* (OpenCrypto Successful Diagnostics Execution)
|
||||
*/
|
||||
u16 length; /* Length of Subsequent Data (up to 4K – SCLP header */
|
||||
u8 data[0]; /* Subsequent Data passed verbatim to SCLP ET 24 */
|
||||
u8 data[]; /* Subsequent Data passed verbatim to SCLP ET 24 */
|
||||
} __packed;
|
||||
|
||||
extern char *sclp_early_sccb;
|
||||
|
||||
@@ -67,12 +67,12 @@ struct sysinfo_1_2_2 {
|
||||
unsigned short cpus_configured;
|
||||
unsigned short cpus_standby;
|
||||
unsigned short cpus_reserved;
|
||||
unsigned short adjustment[0];
|
||||
unsigned short adjustment[];
|
||||
};
|
||||
|
||||
struct sysinfo_1_2_2_extension {
|
||||
unsigned int alt_capability;
|
||||
unsigned short alt_adjustment[0];
|
||||
unsigned short alt_adjustment[];
|
||||
};
|
||||
|
||||
struct sysinfo_2_2_1 {
|
||||
@@ -181,7 +181,7 @@ struct sysinfo_15_1_x {
|
||||
unsigned char reserved1;
|
||||
unsigned char mnest;
|
||||
unsigned char reserved2[4];
|
||||
union topology_entry tle[0];
|
||||
union topology_entry tle[];
|
||||
};
|
||||
|
||||
int stsi(void *sysinfo, int fc, int sel1, int sel2);
|
||||
|
||||
@@ -32,7 +32,7 @@ struct thread_info {
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
unsigned long previous_sp; /* sp of previous stack in case
|
||||
of nested IRQ stacks */
|
||||
__u8 supervisor_stack[0];
|
||||
__u8 supervisor_stack[];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@ struct vio_dring_register {
|
||||
#define VIO_RX_DRING_DATA 0x0004
|
||||
u16 resv;
|
||||
u32 num_cookies;
|
||||
struct ldc_trans_cookie cookies[0];
|
||||
struct ldc_trans_cookie cookies[];
|
||||
};
|
||||
|
||||
struct vio_dring_unregister {
|
||||
@@ -161,7 +161,7 @@ struct vio_disk_desc {
|
||||
u64 size;
|
||||
u32 ncookies;
|
||||
u32 resv2;
|
||||
struct ldc_trans_cookie cookies[0];
|
||||
struct ldc_trans_cookie cookies[];
|
||||
};
|
||||
|
||||
#define VIO_DISK_VNAME_LEN 8
|
||||
@@ -200,13 +200,13 @@ struct vio_disk_devid {
|
||||
u16 resv;
|
||||
u16 type;
|
||||
u32 len;
|
||||
char id[0];
|
||||
char id[];
|
||||
};
|
||||
|
||||
struct vio_disk_efi {
|
||||
u64 lba;
|
||||
u64 len;
|
||||
char data[0];
|
||||
char data[];
|
||||
};
|
||||
|
||||
/* VIO net specific structures and defines */
|
||||
@@ -246,7 +246,7 @@ struct vio_net_desc {
|
||||
struct vio_dring_hdr hdr;
|
||||
u32 size;
|
||||
u32 ncookies;
|
||||
struct ldc_trans_cookie cookies[0];
|
||||
struct ldc_trans_cookie cookies[];
|
||||
};
|
||||
|
||||
struct vio_net_dext {
|
||||
|
||||
@@ -39,7 +39,7 @@ struct uml_net_private {
|
||||
|
||||
void (*add_address)(unsigned char *, unsigned char *, void *);
|
||||
void (*delete_address)(unsigned char *, unsigned char *, void *);
|
||||
char user[0];
|
||||
char user[];
|
||||
};
|
||||
|
||||
struct net_kern_info {
|
||||
|
||||
@@ -38,7 +38,7 @@ struct microcode_header_amd {
|
||||
|
||||
struct microcode_amd {
|
||||
struct microcode_header_amd hdr;
|
||||
unsigned int mpb[0];
|
||||
unsigned int mpb[];
|
||||
};
|
||||
|
||||
#define PATCH_MAX_SIZE (3 * PAGE_SIZE)
|
||||
|
||||
@@ -19,7 +19,7 @@ struct microcode_header_intel {
|
||||
|
||||
struct microcode_intel {
|
||||
struct microcode_header_intel hdr;
|
||||
unsigned int bits[0];
|
||||
unsigned int bits[];
|
||||
};
|
||||
|
||||
/* microcode format is extended from prescott processors */
|
||||
@@ -33,7 +33,7 @@ struct extended_sigtable {
|
||||
unsigned int count;
|
||||
unsigned int cksum;
|
||||
unsigned int reserved[3];
|
||||
struct extended_signature sigs[0];
|
||||
struct extended_signature sigs[];
|
||||
};
|
||||
|
||||
#define DEFAULT_UCODE_DATASIZE (2000)
|
||||
|
||||
@@ -135,7 +135,7 @@ struct pci_setup_rom {
|
||||
unsigned long bus;
|
||||
unsigned long device;
|
||||
unsigned long function;
|
||||
uint8_t romdata[0];
|
||||
uint8_t romdata[];
|
||||
};
|
||||
|
||||
#endif /* _ASM_X86_PCI_H */
|
||||
|
||||
@@ -87,7 +87,7 @@ struct irq_routing_table {
|
||||
u32 miniport_data; /* Crap */
|
||||
u8 rfu[11];
|
||||
u8 checksum; /* Modulo 256 checksum must give 0 */
|
||||
struct irq_info slots[0];
|
||||
struct irq_info slots[];
|
||||
} __attribute__((packed));
|
||||
|
||||
extern unsigned int pcibios_irq_mask;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
typedef struct bp_tag {
|
||||
unsigned short id; /* tag id */
|
||||
unsigned short size; /* size of this record excluding the structure*/
|
||||
unsigned long data[0]; /* data */
|
||||
unsigned long data[]; /* data */
|
||||
} bp_tag_t;
|
||||
|
||||
struct bp_meminfo {
|
||||
|
||||
@@ -144,7 +144,7 @@ struct ipsec_encap_pdb {
|
||||
};
|
||||
u32 spi;
|
||||
u32 ip_hdr_len;
|
||||
u32 ip_hdr[0];
|
||||
u32 ip_hdr[];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,7 +51,7 @@ struct __guc_ads_blob {
|
||||
struct guc_gt_system_info system_info;
|
||||
struct guc_engine_usage engine_usage;
|
||||
/* From here on, location is dynamic! Refer to above diagram. */
|
||||
struct guc_mmio_reg regset[0];
|
||||
struct guc_mmio_reg regset[];
|
||||
} __packed;
|
||||
|
||||
static u32 guc_ads_regset_size(struct intel_guc *guc)
|
||||
|
||||
@@ -23,7 +23,7 @@ struct nvfw_hs_load_header {
|
||||
u32 data_dma_base;
|
||||
u32 data_size;
|
||||
u32 num_apps;
|
||||
u32 apps[0];
|
||||
u32 apps[];
|
||||
};
|
||||
|
||||
const struct nvfw_hs_load_header *
|
||||
|
||||
@@ -231,7 +231,7 @@ struct cscfg_config_csdev {
|
||||
bool enabled;
|
||||
struct list_head node;
|
||||
int nr_feat;
|
||||
struct cscfg_feature_csdev *feats_csdev[0];
|
||||
struct cscfg_feature_csdev *feats_csdev[];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -311,7 +311,7 @@ struct bcm_vk_peer_log {
|
||||
u32 wr_idx;
|
||||
u32 buf_size;
|
||||
u32 mask;
|
||||
char data[0];
|
||||
char data[];
|
||||
};
|
||||
|
||||
/* max buf size allowed */
|
||||
|
||||
@@ -540,19 +540,19 @@ struct cpucp_packet {
|
||||
struct cpucp_unmask_irq_arr_packet {
|
||||
struct cpucp_packet cpucp_pkt;
|
||||
__le32 length;
|
||||
__le32 irqs[0];
|
||||
__le32 irqs[];
|
||||
};
|
||||
|
||||
struct cpucp_nic_status_packet {
|
||||
struct cpucp_packet cpucp_pkt;
|
||||
__le32 length;
|
||||
__le32 data[0];
|
||||
__le32 data[];
|
||||
};
|
||||
|
||||
struct cpucp_array_data_packet {
|
||||
struct cpucp_packet cpucp_pkt;
|
||||
__le32 length;
|
||||
__le32 data[0];
|
||||
__le32 data[];
|
||||
};
|
||||
|
||||
enum cpucp_packet_rc {
|
||||
|
||||
@@ -54,7 +54,7 @@ struct gaudi_packet {
|
||||
/* The rest of the packet data follows. Use the corresponding
|
||||
* packet_XXX struct to deference the data, based on packet type
|
||||
*/
|
||||
u8 contents[0];
|
||||
u8 contents[];
|
||||
};
|
||||
|
||||
struct packet_nop {
|
||||
@@ -75,7 +75,7 @@ struct packet_wreg32 {
|
||||
struct packet_wreg_bulk {
|
||||
__le32 size64;
|
||||
__le32 ctl;
|
||||
__le64 values[0]; /* data starts here */
|
||||
__le64 values[]; /* data starts here */
|
||||
};
|
||||
|
||||
#define GAUDI_PKT_LONG_CTL_OP_SHIFT 20
|
||||
|
||||
@@ -62,7 +62,7 @@ struct goya_packet {
|
||||
/* The rest of the packet data follows. Use the corresponding
|
||||
* packet_XXX struct to deference the data, based on packet type
|
||||
*/
|
||||
u8 contents[0];
|
||||
u8 contents[];
|
||||
};
|
||||
|
||||
struct packet_nop {
|
||||
@@ -86,7 +86,7 @@ struct packet_wreg32 {
|
||||
struct packet_wreg_bulk {
|
||||
__le32 size64;
|
||||
__le32 ctl;
|
||||
__le64 values[0]; /* data starts here */
|
||||
__le64 values[]; /* data starts here */
|
||||
};
|
||||
|
||||
struct packet_msg_long {
|
||||
|
||||
@@ -881,7 +881,7 @@ struct sgcl_data {
|
||||
u32 bth;
|
||||
u32 ct;
|
||||
u32 cte;
|
||||
struct sgce sgcl[0];
|
||||
struct sgce sgcl[];
|
||||
};
|
||||
|
||||
#define ENETC_CBDR_FMI_MR BIT(0)
|
||||
|
||||
@@ -250,7 +250,7 @@ struct mcsetup_cmd_struct
|
||||
unsigned short cmd_cmd;
|
||||
unsigned short cmd_link;
|
||||
unsigned short mc_cnt; /* number of bytes in the MC-List */
|
||||
unsigned char mc_list[0][6]; /* pointer to 6 bytes entries */
|
||||
unsigned char mc_list[][6]; /* pointer to 6 bytes entries */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -455,7 +455,7 @@ struct npc_coalesced_kpu_prfl {
|
||||
u8 name[NPC_NAME_LEN]; /* KPU Profile name */
|
||||
u64 version; /* KPU firmware/profile version */
|
||||
u8 num_prfl; /* No of NPC profiles. */
|
||||
u16 prfl_sz[0];
|
||||
u16 prfl_sz[];
|
||||
};
|
||||
|
||||
struct npc_mcam_kex {
|
||||
@@ -482,7 +482,7 @@ struct npc_kpu_fwdata {
|
||||
* struct npc_kpu_profile_cam[entries];
|
||||
* struct npc_kpu_profile_action[entries];
|
||||
*/
|
||||
u8 data[0];
|
||||
u8 data[];
|
||||
} __packed;
|
||||
|
||||
struct npc_lt_def {
|
||||
@@ -572,7 +572,7 @@ struct npc_kpu_profile_fwdata {
|
||||
* Custom KPU CAM and ACTION configuration entries.
|
||||
* struct npc_kpu_fwdata kpu[kpus];
|
||||
*/
|
||||
u8 data[0];
|
||||
u8 data[];
|
||||
} __packed;
|
||||
|
||||
struct rvu_npc_mcam_rule {
|
||||
|
||||
@@ -2470,6 +2470,6 @@ struct nvm_meta_bin_t {
|
||||
u32 version;
|
||||
#define NVM_META_BIN_VERSION 1
|
||||
u32 num_options;
|
||||
u32 options[0];
|
||||
u32 options[];
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@ struct davinci_mdio_regs {
|
||||
#define USERACCESS_DATA (0xffff)
|
||||
|
||||
u32 physel;
|
||||
} user[0];
|
||||
} user[];
|
||||
};
|
||||
|
||||
static const struct mdio_platform_data default_pdata = {
|
||||
|
||||
@@ -123,7 +123,7 @@ struct i2o_sys_tbl
|
||||
u32 change_ind;
|
||||
u32 reserved2;
|
||||
u32 reserved3;
|
||||
struct i2o_sys_tbl_entry iops[0];
|
||||
struct i2o_sys_tbl_entry iops[];
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -609,7 +609,7 @@ struct sli4_rqst_cmn_create_cq_v2 {
|
||||
__le16 cqe_count;
|
||||
__le16 rsvd30;
|
||||
__le32 rsvd32;
|
||||
struct sli4_dmaaddr page_phys_addr[0];
|
||||
struct sli4_dmaaddr page_phys_addr[];
|
||||
};
|
||||
|
||||
enum sli4_create_cqset_e {
|
||||
@@ -634,7 +634,7 @@ struct sli4_rqst_cmn_create_cq_set_v0 {
|
||||
__le16 num_cq_req;
|
||||
__le16 dw6w1_flags;
|
||||
__le16 eq_id[16];
|
||||
struct sli4_dmaaddr page_phys_addr[0];
|
||||
struct sli4_dmaaddr page_phys_addr[];
|
||||
};
|
||||
|
||||
/* CQE count */
|
||||
@@ -764,7 +764,7 @@ struct sli4_rqst_cmn_create_mq_ext {
|
||||
__le32 dw7_val;
|
||||
__le32 dw8_flags;
|
||||
__le32 rsvd36;
|
||||
struct sli4_dmaaddr page_phys_addr[0];
|
||||
struct sli4_dmaaddr page_phys_addr[];
|
||||
};
|
||||
|
||||
struct sli4_rsp_cmn_create_mq_ext {
|
||||
@@ -802,7 +802,7 @@ struct sli4_rqst_cmn_create_cq_v0 {
|
||||
__le32 dw6_flags;
|
||||
__le32 rsvd28;
|
||||
__le32 rsvd32;
|
||||
struct sli4_dmaaddr page_phys_addr[0];
|
||||
struct sli4_dmaaddr page_phys_addr[];
|
||||
};
|
||||
|
||||
enum sli4_create_rq_e {
|
||||
@@ -887,7 +887,7 @@ struct sli4_rqst_rq_create_v2 {
|
||||
__le16 base_cq_id;
|
||||
__le16 rsvd26;
|
||||
__le32 rsvd42;
|
||||
struct sli4_dmaaddr page_phys_addr[0];
|
||||
struct sli4_dmaaddr page_phys_addr[];
|
||||
};
|
||||
|
||||
struct sli4_rsp_rq_create_v2 {
|
||||
@@ -3168,7 +3168,7 @@ struct sli4_rqst_cmn_read_object {
|
||||
__le32 read_offset;
|
||||
u8 object_name[104];
|
||||
__le32 host_buffer_descriptor_count;
|
||||
struct sli4_bde host_buffer_descriptor[0];
|
||||
struct sli4_bde host_buffer_descriptor[];
|
||||
};
|
||||
|
||||
#define RSP_COM_READ_OBJ_EOF 0x80000000
|
||||
@@ -3191,7 +3191,7 @@ struct sli4_rqst_cmn_write_object {
|
||||
__le32 write_offset;
|
||||
u8 object_name[104];
|
||||
__le32 host_buffer_descriptor_count;
|
||||
struct sli4_bde host_buffer_descriptor[0];
|
||||
struct sli4_bde host_buffer_descriptor[];
|
||||
};
|
||||
|
||||
#define RSP_CHANGE_STATUS 0xff
|
||||
@@ -3217,7 +3217,7 @@ struct sli4_rqst_cmn_read_object_list {
|
||||
__le32 read_offset;
|
||||
u8 object_name[104];
|
||||
__le32 host_buffer_descriptor_count;
|
||||
struct sli4_bde host_buffer_descriptor[0];
|
||||
struct sli4_bde host_buffer_descriptor[];
|
||||
};
|
||||
|
||||
enum sli4_rqst_set_dump_flags {
|
||||
@@ -3342,7 +3342,7 @@ struct sli4_rspource_descriptor_v1 {
|
||||
u8 descriptor_type;
|
||||
u8 descriptor_length;
|
||||
__le16 rsvd16;
|
||||
__le32 type_specific[0];
|
||||
__le32 type_specific[];
|
||||
};
|
||||
|
||||
enum sli4_pcie_desc_flags {
|
||||
@@ -3474,7 +3474,7 @@ struct sli4_rqst_post_hdr_templates {
|
||||
struct sli4_rqst_hdr hdr;
|
||||
__le16 rpi_offset;
|
||||
__le16 page_count;
|
||||
struct sli4_dmaaddr page_descriptor[0];
|
||||
struct sli4_dmaaddr page_descriptor[];
|
||||
};
|
||||
|
||||
#define SLI4_HDR_TEMPLATE_SIZE 64
|
||||
|
||||
@@ -878,7 +878,7 @@ struct mpi3mr_fwevt {
|
||||
bool process_evt;
|
||||
u32 evt_ctx;
|
||||
struct kref ref_count;
|
||||
char event_data[0] __aligned(4);
|
||||
char event_data[] __aligned(4);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ struct qla84_msg_mgmt {
|
||||
uint16_t rsrvd;
|
||||
struct qla84_mgmt_param mgmtp;/* parameters for cmd */
|
||||
uint32_t len; /* bytes in payload following this struct */
|
||||
uint8_t payload[0]; /* payload for cmd */
|
||||
uint8_t payload[]; /* payload for cmd */
|
||||
};
|
||||
|
||||
struct qla_bsg_a84_mgmt {
|
||||
@@ -216,7 +216,7 @@ struct qla_image_version {
|
||||
|
||||
struct qla_image_version_list {
|
||||
uint32_t count;
|
||||
struct qla_image_version version[0];
|
||||
struct qla_image_version version[];
|
||||
} __packed;
|
||||
|
||||
struct qla_status_reg {
|
||||
|
||||
@@ -5410,7 +5410,7 @@ struct ql_vnd_stat_entry {
|
||||
struct ql_vnd_stats {
|
||||
u64 entry_count; /* Num of entries */
|
||||
u64 rservd;
|
||||
struct ql_vnd_stat_entry entry[0]; /* Place holder of entries */
|
||||
struct ql_vnd_stat_entry entry[]; /* Place holder of entries */
|
||||
} __packed;
|
||||
|
||||
struct ql_vnd_host_stats_resp {
|
||||
|
||||
@@ -121,7 +121,7 @@ struct app_pinfo {
|
||||
struct app_pinfo_reply {
|
||||
uint8_t port_count;
|
||||
uint8_t reserved[VND_CMD_APP_RESERVED_SIZE];
|
||||
struct app_pinfo ports[0];
|
||||
struct app_pinfo ports[];
|
||||
} __packed;
|
||||
|
||||
struct app_sinfo_req {
|
||||
@@ -140,7 +140,7 @@ struct app_sinfo {
|
||||
|
||||
struct app_stats_reply {
|
||||
uint8_t elem_count;
|
||||
struct app_sinfo elem[0];
|
||||
struct app_sinfo elem[];
|
||||
} __packed;
|
||||
|
||||
struct qla_sa_update_frame {
|
||||
|
||||
@@ -1706,7 +1706,7 @@ struct qla_flt_header {
|
||||
__le16 length;
|
||||
__le16 checksum;
|
||||
__le16 unused;
|
||||
struct qla_flt_region region[0];
|
||||
struct qla_flt_region region[];
|
||||
};
|
||||
|
||||
#define FLT_REGION_SIZE 16
|
||||
|
||||
@@ -1028,7 +1028,7 @@ struct crash_record {
|
||||
|
||||
uint8_t out_RISC_reg_dump[256]; /* 80 -17F */
|
||||
uint8_t in_RISC_reg_dump[256]; /*180 -27F */
|
||||
uint8_t in_out_RISC_stack_dump[0]; /*280 - ??? */
|
||||
uint8_t in_out_RISC_stack_dump[]; /*280 - ??? */
|
||||
};
|
||||
|
||||
struct conn_event_log_entry {
|
||||
|
||||
@@ -73,7 +73,7 @@ struct c2h_evt_hdr {
|
||||
u8 id:4;
|
||||
u8 plen:4;
|
||||
u8 seq;
|
||||
u8 payload[0];
|
||||
u8 payload[];
|
||||
};
|
||||
|
||||
#define c2h_evt_exist(c2h_evt) ((c2h_evt)->id || (c2h_evt)->plen)
|
||||
@@ -662,25 +662,25 @@ struct getcurtxpwrlevel_rspi {
|
||||
struct setprobereqextraie_parm {
|
||||
unsigned char e_id;
|
||||
unsigned char ie_len;
|
||||
unsigned char ie[0];
|
||||
unsigned char ie[];
|
||||
};
|
||||
|
||||
struct setassocreqextraie_parm {
|
||||
unsigned char e_id;
|
||||
unsigned char ie_len;
|
||||
unsigned char ie[0];
|
||||
unsigned char ie[];
|
||||
};
|
||||
|
||||
struct setproberspextraie_parm {
|
||||
unsigned char e_id;
|
||||
unsigned char ie_len;
|
||||
unsigned char ie[0];
|
||||
unsigned char ie[];
|
||||
};
|
||||
|
||||
struct setassocrspextraie_parm {
|
||||
unsigned char e_id;
|
||||
unsigned char ie_len;
|
||||
unsigned char ie[0];
|
||||
unsigned char ie[];
|
||||
};
|
||||
|
||||
struct addBaReq_parm {
|
||||
|
||||
@@ -657,25 +657,25 @@ struct setra_parm {
|
||||
struct setprobereqextraie_parm {
|
||||
unsigned char e_id;
|
||||
unsigned char ie_len;
|
||||
unsigned char ie[0];
|
||||
unsigned char ie[];
|
||||
};
|
||||
|
||||
struct setassocreqextraie_parm {
|
||||
unsigned char e_id;
|
||||
unsigned char ie_len;
|
||||
unsigned char ie[0];
|
||||
unsigned char ie[];
|
||||
};
|
||||
|
||||
struct setproberspextraie_parm {
|
||||
unsigned char e_id;
|
||||
unsigned char ie_len;
|
||||
unsigned char ie[0];
|
||||
unsigned char ie[];
|
||||
};
|
||||
|
||||
struct setassocrspextraie_parm {
|
||||
unsigned char e_id;
|
||||
unsigned char ie_len;
|
||||
unsigned char ie[0];
|
||||
unsigned char ie[];
|
||||
};
|
||||
|
||||
struct addBaReq_parm {
|
||||
|
||||
@@ -204,7 +204,7 @@ struct ieee_param {
|
||||
struct ieee_param_ex {
|
||||
u32 cmd;
|
||||
u8 sta_addr[ETH_ALEN];
|
||||
u8 data[0];
|
||||
u8 data[];
|
||||
};
|
||||
|
||||
struct sta_data {
|
||||
|
||||
@@ -94,7 +94,7 @@ struct c2h_evt_hdr {
|
||||
u8 id:4;
|
||||
u8 plen:4;
|
||||
u8 seq;
|
||||
u8 payload[0];
|
||||
u8 payload[];
|
||||
};
|
||||
|
||||
struct c2h_evt_hdr_88xx {
|
||||
|
||||
@@ -45,7 +45,7 @@ struct vchiq_header {
|
||||
/* Size of message data. */
|
||||
unsigned int size;
|
||||
|
||||
char data[0]; /* message */
|
||||
char data[]; /* message */
|
||||
};
|
||||
|
||||
struct vchiq_element {
|
||||
|
||||
@@ -89,7 +89,7 @@ struct visor_vbus_channel {
|
||||
struct visor_vbus_headerinfo hdr_info;
|
||||
struct visor_vbus_deviceinfo chp_info;
|
||||
struct visor_vbus_deviceinfo bus_info;
|
||||
struct visor_vbus_deviceinfo dev_info[0];
|
||||
struct visor_vbus_deviceinfo dev_info[];
|
||||
} __packed;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -107,7 +107,7 @@ struct negotiate_message {
|
||||
SECURITY_BUFFER WorkstationName; /* RFC 1001 and ASCII */
|
||||
struct ntlmssp_version Version;
|
||||
/* SECURITY_BUFFER */
|
||||
char DomainString[0];
|
||||
char DomainString[];
|
||||
/* followed by WorkstationString */
|
||||
} __packed;
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@ struct ext4_fc_del_range {
|
||||
struct ext4_fc_dentry_info {
|
||||
__le32 fc_parent_ino;
|
||||
__le32 fc_ino;
|
||||
__u8 fc_dname[0];
|
||||
__u8 fc_dname[];
|
||||
};
|
||||
|
||||
/* Value structure for EXT4_FC_TAG_INODE and EXT4_FC_TAG_INODE_PARTIAL. */
|
||||
struct ext4_fc_inode {
|
||||
__le32 fc_ino;
|
||||
__u8 fc_raw_inode[0];
|
||||
__u8 fc_raw_inode[];
|
||||
};
|
||||
|
||||
/* Value structure for tag EXT4_FC_TAG_TAIL. */
|
||||
|
||||
@@ -241,7 +241,7 @@ struct ksmbd_rpc_command {
|
||||
struct ksmbd_spnego_authen_request {
|
||||
__u32 handle;
|
||||
__u16 spnego_blob_len; /* the length of spnego_blob */
|
||||
__u8 spnego_blob[0]; /*
|
||||
__u8 spnego_blob[]; /*
|
||||
* the GSS token from SecurityBuffer of
|
||||
* SMB2 SESSION SETUP request
|
||||
*/
|
||||
|
||||
@@ -95,7 +95,7 @@ struct security_buffer {
|
||||
struct target_info {
|
||||
__le16 Type;
|
||||
__le16 Length;
|
||||
__u8 Content[0];
|
||||
__u8 Content[];
|
||||
} __packed;
|
||||
|
||||
struct negotiate_message {
|
||||
@@ -108,7 +108,7 @@ struct negotiate_message {
|
||||
* struct security_buffer for version info not present since we
|
||||
* do not set the version is present flag
|
||||
*/
|
||||
char DomainString[0];
|
||||
char DomainString[];
|
||||
/* followed by WorkstationString */
|
||||
} __packed;
|
||||
|
||||
@@ -140,7 +140,7 @@ struct authenticate_message {
|
||||
* struct security_buffer for version info not present since we
|
||||
* do not set the version is present flag
|
||||
*/
|
||||
char UserString[0];
|
||||
char UserString[];
|
||||
} __packed;
|
||||
|
||||
struct ntlmv2_resp {
|
||||
|
||||
@@ -759,7 +759,7 @@ struct smb2_file_rename_info { /* encoding of request for level 10 */
|
||||
__u8 Reserved[7];
|
||||
__u64 RootDirectory; /* MBZ for network operations (why says spec?) */
|
||||
__le32 FileNameLength;
|
||||
char FileName[0]; /* New name to be assigned */
|
||||
char FileName[]; /* New name to be assigned */
|
||||
} __packed; /* level 10 Set */
|
||||
|
||||
struct smb2_file_link_info { /* encoding of request for level 11 */
|
||||
@@ -768,7 +768,7 @@ struct smb2_file_link_info { /* encoding of request for level 11 */
|
||||
__u8 Reserved[7];
|
||||
__u64 RootDirectory; /* MBZ for network operations (why says spec?) */
|
||||
__le32 FileNameLength;
|
||||
char FileName[0]; /* Name to be assigned to new link */
|
||||
char FileName[]; /* Name to be assigned to new link */
|
||||
} __packed; /* level 11 Set */
|
||||
|
||||
/*
|
||||
@@ -810,7 +810,7 @@ struct smb2_file_basic_info { /* data block encoding of response to level 18 */
|
||||
|
||||
struct smb2_file_alt_name_info {
|
||||
__le32 FileNameLength;
|
||||
char FileName[0];
|
||||
char FileName[];
|
||||
} __packed;
|
||||
|
||||
struct smb2_file_stream_info {
|
||||
@@ -818,7 +818,7 @@ struct smb2_file_stream_info {
|
||||
__le32 StreamNameLength;
|
||||
__le64 StreamSize;
|
||||
__le64 StreamAllocationSize;
|
||||
char StreamName[0];
|
||||
char StreamName[];
|
||||
} __packed;
|
||||
|
||||
struct smb2_file_eof_info { /* encoding of request for level 10 */
|
||||
|
||||
@@ -211,7 +211,7 @@ struct smb_direct_rdma_rw_msg {
|
||||
struct completion *completion;
|
||||
struct rdma_rw_ctx rw_ctx;
|
||||
struct sg_table sgt;
|
||||
struct scatterlist sg_list[0];
|
||||
struct scatterlist sg_list[];
|
||||
};
|
||||
|
||||
static inline int get_buf_page_count(void *buf, int size)
|
||||
|
||||
@@ -76,7 +76,7 @@ struct xattr_acl_entry {
|
||||
struct xattr_smb_acl {
|
||||
int count;
|
||||
int next;
|
||||
struct xattr_acl_entry entries[0];
|
||||
struct xattr_acl_entry entries[];
|
||||
};
|
||||
|
||||
/* 64bytes hash in xattr_ntacl is computed with sha256 */
|
||||
|
||||
176
fs/namespace.c
176
fs/namespace.c
@@ -344,8 +344,24 @@ int __mnt_want_write(struct vfsmount *m)
|
||||
* incremented count after it has set MNT_WRITE_HOLD.
|
||||
*/
|
||||
smp_mb();
|
||||
while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD)
|
||||
cpu_relax();
|
||||
might_lock(&mount_lock.lock);
|
||||
while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) {
|
||||
if (!IS_ENABLED(CONFIG_PREEMPT_RT)) {
|
||||
cpu_relax();
|
||||
} else {
|
||||
/*
|
||||
* This prevents priority inversion, if the task
|
||||
* setting MNT_WRITE_HOLD got preempted on a remote
|
||||
* CPU, and it prevents life lock if the task setting
|
||||
* MNT_WRITE_HOLD has a lower priority and is bound to
|
||||
* the same CPU as the task that is spinning here.
|
||||
*/
|
||||
preempt_enable();
|
||||
lock_mount_hash();
|
||||
unlock_mount_hash();
|
||||
preempt_disable();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will
|
||||
* be set to match its requirements. So we must not load that until
|
||||
@@ -563,12 +579,9 @@ int sb_prepare_remount_readonly(struct super_block *sb)
|
||||
lock_mount_hash();
|
||||
list_for_each_entry(mnt, &sb->s_mounts, mnt_instance) {
|
||||
if (!(mnt->mnt.mnt_flags & MNT_READONLY)) {
|
||||
mnt->mnt.mnt_flags |= MNT_WRITE_HOLD;
|
||||
smp_mb();
|
||||
if (mnt_get_writers(mnt) > 0) {
|
||||
err = -EBUSY;
|
||||
err = mnt_hold_writers(mnt);
|
||||
if (err)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!err && atomic_long_read(&sb->s_remove_count))
|
||||
@@ -4000,46 +4013,57 @@ static int can_idmap_mount(const struct mount_kattr *kattr, struct mount *mnt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct mount *mount_setattr_prepare(struct mount_kattr *kattr,
|
||||
struct mount *mnt, int *err)
|
||||
/**
|
||||
* mnt_allow_writers() - check whether the attribute change allows writers
|
||||
* @kattr: the new mount attributes
|
||||
* @mnt: the mount to which @kattr will be applied
|
||||
*
|
||||
* Check whether thew new mount attributes in @kattr allow concurrent writers.
|
||||
*
|
||||
* Return: true if writers need to be held, false if not
|
||||
*/
|
||||
static inline bool mnt_allow_writers(const struct mount_kattr *kattr,
|
||||
const struct mount *mnt)
|
||||
{
|
||||
struct mount *m = mnt, *last = NULL;
|
||||
return !(kattr->attr_set & MNT_READONLY) ||
|
||||
(mnt->mnt.mnt_flags & MNT_READONLY);
|
||||
}
|
||||
|
||||
if (!is_mounted(&m->mnt)) {
|
||||
*err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
static int mount_setattr_prepare(struct mount_kattr *kattr, struct mount *mnt)
|
||||
{
|
||||
struct mount *m;
|
||||
int err;
|
||||
|
||||
if (!(mnt_has_parent(m) ? check_mnt(m) : is_anon_ns(m->mnt_ns))) {
|
||||
*err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
do {
|
||||
unsigned int flags;
|
||||
|
||||
flags = recalc_flags(kattr, m);
|
||||
if (!can_change_locked_flags(m, flags)) {
|
||||
*err = -EPERM;
|
||||
goto out;
|
||||
for (m = mnt; m; m = next_mnt(m, mnt)) {
|
||||
if (!can_change_locked_flags(m, recalc_flags(kattr, m))) {
|
||||
err = -EPERM;
|
||||
break;
|
||||
}
|
||||
|
||||
*err = can_idmap_mount(kattr, m);
|
||||
if (*err)
|
||||
goto out;
|
||||
err = can_idmap_mount(kattr, m);
|
||||
if (err)
|
||||
break;
|
||||
|
||||
last = m;
|
||||
|
||||
if ((kattr->attr_set & MNT_READONLY) &&
|
||||
!(m->mnt.mnt_flags & MNT_READONLY)) {
|
||||
*err = mnt_hold_writers(m);
|
||||
if (*err)
|
||||
goto out;
|
||||
if (!mnt_allow_writers(kattr, m)) {
|
||||
err = mnt_hold_writers(m);
|
||||
if (err)
|
||||
break;
|
||||
}
|
||||
} while (kattr->recurse && (m = next_mnt(m, mnt)));
|
||||
|
||||
out:
|
||||
return last;
|
||||
if (!kattr->recurse)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
struct mount *p;
|
||||
|
||||
for (p = mnt; p != m; p = next_mnt(p, mnt)) {
|
||||
/* If we had to hold writers unblock them. */
|
||||
if (p->mnt.mnt_flags & MNT_WRITE_HOLD)
|
||||
mnt_unhold_writers(p);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static void do_idmap_mount(const struct mount_kattr *kattr, struct mount *mnt)
|
||||
@@ -4067,48 +4091,32 @@ static void do_idmap_mount(const struct mount_kattr *kattr, struct mount *mnt)
|
||||
put_user_ns(old_mnt_userns);
|
||||
}
|
||||
|
||||
static void mount_setattr_commit(struct mount_kattr *kattr,
|
||||
struct mount *mnt, struct mount *last,
|
||||
int err)
|
||||
static void mount_setattr_commit(struct mount_kattr *kattr, struct mount *mnt)
|
||||
{
|
||||
struct mount *m = mnt;
|
||||
struct mount *m;
|
||||
|
||||
do {
|
||||
if (!err) {
|
||||
unsigned int flags;
|
||||
for (m = mnt; m; m = next_mnt(m, mnt)) {
|
||||
unsigned int flags;
|
||||
|
||||
do_idmap_mount(kattr, m);
|
||||
flags = recalc_flags(kattr, m);
|
||||
WRITE_ONCE(m->mnt.mnt_flags, flags);
|
||||
}
|
||||
do_idmap_mount(kattr, m);
|
||||
flags = recalc_flags(kattr, m);
|
||||
WRITE_ONCE(m->mnt.mnt_flags, flags);
|
||||
|
||||
/*
|
||||
* We either set MNT_READONLY above so make it visible
|
||||
* before ~MNT_WRITE_HOLD or we failed to recursively
|
||||
* apply mount options.
|
||||
*/
|
||||
if ((kattr->attr_set & MNT_READONLY) &&
|
||||
(m->mnt.mnt_flags & MNT_WRITE_HOLD))
|
||||
/* If we had to hold writers unblock them. */
|
||||
if (m->mnt.mnt_flags & MNT_WRITE_HOLD)
|
||||
mnt_unhold_writers(m);
|
||||
|
||||
if (!err && kattr->propagation)
|
||||
if (kattr->propagation)
|
||||
change_mnt_propagation(m, kattr->propagation);
|
||||
|
||||
/*
|
||||
* On failure, only cleanup until we found the first mount
|
||||
* we failed to handle.
|
||||
*/
|
||||
if (err && m == last)
|
||||
if (!kattr->recurse)
|
||||
break;
|
||||
} while (kattr->recurse && (m = next_mnt(m, mnt)));
|
||||
|
||||
if (!err)
|
||||
touch_mnt_namespace(mnt->mnt_ns);
|
||||
}
|
||||
touch_mnt_namespace(mnt->mnt_ns);
|
||||
}
|
||||
|
||||
static int do_mount_setattr(struct path *path, struct mount_kattr *kattr)
|
||||
{
|
||||
struct mount *mnt = real_mount(path->mnt), *last = NULL;
|
||||
struct mount *mnt = real_mount(path->mnt);
|
||||
int err = 0;
|
||||
|
||||
if (path->dentry != mnt->mnt.mnt_root)
|
||||
@@ -4129,16 +4137,32 @@ static int do_mount_setattr(struct path *path, struct mount_kattr *kattr)
|
||||
}
|
||||
}
|
||||
|
||||
err = -EINVAL;
|
||||
lock_mount_hash();
|
||||
|
||||
/*
|
||||
* Get the mount tree in a shape where we can change mount
|
||||
* properties without failure.
|
||||
*/
|
||||
last = mount_setattr_prepare(kattr, mnt, &err);
|
||||
if (last) /* Commit all changes or revert to the old state. */
|
||||
mount_setattr_commit(kattr, mnt, last, err);
|
||||
/* Ensure that this isn't anything purely vfs internal. */
|
||||
if (!is_mounted(&mnt->mnt))
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* If this is an attached mount make sure it's located in the callers
|
||||
* mount namespace. If it's not don't let the caller interact with it.
|
||||
* If this is a detached mount make sure it has an anonymous mount
|
||||
* namespace attached to it, i.e. we've created it via OPEN_TREE_CLONE.
|
||||
*/
|
||||
if (!(mnt_has_parent(mnt) ? check_mnt(mnt) : is_anon_ns(mnt->mnt_ns)))
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* First, we get the mount tree in a shape where we can change mount
|
||||
* properties without failure. If we succeeded to do so we commit all
|
||||
* changes and if we failed we clean up.
|
||||
*/
|
||||
err = mount_setattr_prepare(kattr, mnt);
|
||||
if (!err)
|
||||
mount_setattr_commit(kattr, mnt);
|
||||
|
||||
out:
|
||||
unlock_mount_hash();
|
||||
|
||||
if (kattr->propagation) {
|
||||
|
||||
@@ -24,7 +24,7 @@ struct xchk_xattr_buf {
|
||||
* space bitmap follows immediately after; and we have a third buffer
|
||||
* for storing intermediate bitmap results.
|
||||
*/
|
||||
uint8_t buf[0];
|
||||
uint8_t buf[];
|
||||
};
|
||||
|
||||
/* A place to store attribute values. */
|
||||
|
||||
@@ -180,7 +180,7 @@ struct mmu_table_batch {
|
||||
struct rcu_head rcu;
|
||||
#endif
|
||||
unsigned int nr;
|
||||
void *tables[0];
|
||||
void *tables[];
|
||||
};
|
||||
|
||||
#define MAX_TABLE_BATCH \
|
||||
@@ -227,7 +227,7 @@ struct mmu_gather_batch {
|
||||
struct mmu_gather_batch *next;
|
||||
unsigned int nr;
|
||||
unsigned int max;
|
||||
struct page *pages[0];
|
||||
struct page *pages[];
|
||||
};
|
||||
|
||||
#define MAX_GATHER_BATCH \
|
||||
|
||||
@@ -100,7 +100,7 @@ enum {
|
||||
struct greybus_descriptor_string {
|
||||
__u8 length;
|
||||
__u8 id;
|
||||
__u8 string[0];
|
||||
__u8 string[];
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
@@ -175,7 +175,7 @@ struct greybus_manifest_header {
|
||||
|
||||
struct greybus_manifest {
|
||||
struct greybus_manifest_header header;
|
||||
struct greybus_descriptor descriptors[0];
|
||||
struct greybus_descriptor descriptors[];
|
||||
} __packed;
|
||||
|
||||
#endif /* __GREYBUS_MANIFEST_H */
|
||||
|
||||
@@ -58,7 +58,7 @@ struct gb_host_device {
|
||||
|
||||
struct gb_svc *svc;
|
||||
/* Private data for the host driver */
|
||||
unsigned long hd_priv[0] __aligned(sizeof(s64));
|
||||
unsigned long hd_priv[] __aligned(sizeof(s64));
|
||||
};
|
||||
#define to_gb_host_device(d) container_of(d, struct gb_host_device, dev)
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ struct gb_module {
|
||||
|
||||
bool disconnected;
|
||||
|
||||
struct gb_interface *interfaces[0];
|
||||
struct gb_interface *interfaces[];
|
||||
};
|
||||
#define to_gb_module(d) container_of(d, struct gb_module, dev)
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ struct i3c_ccc_dev_desc {
|
||||
struct i3c_ccc_defslvs {
|
||||
u8 count;
|
||||
struct i3c_ccc_dev_desc master;
|
||||
struct i3c_ccc_dev_desc slaves[0];
|
||||
struct i3c_ccc_dev_desc slaves[];
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
@@ -240,7 +240,7 @@ struct i3c_ccc_bridged_slave_desc {
|
||||
*/
|
||||
struct i3c_ccc_setbrgtgt {
|
||||
u8 count;
|
||||
struct i3c_ccc_bridged_slave_desc bslaves[0];
|
||||
struct i3c_ccc_bridged_slave_desc bslaves[];
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
@@ -318,7 +318,7 @@ enum i3c_ccc_setxtime_subcmd {
|
||||
*/
|
||||
struct i3c_ccc_setxtime {
|
||||
u8 subcmd;
|
||||
u8 data[0];
|
||||
u8 data[];
|
||||
} __packed;
|
||||
|
||||
#define I3C_CCC_GETXTIME_SYNC_MODE BIT(0)
|
||||
|
||||
@@ -178,7 +178,7 @@ struct brcmfmac_platform_data {
|
||||
void (*power_off)(void);
|
||||
char *fw_alternative_path;
|
||||
int device_count;
|
||||
struct brcmfmac_pd_device devices[0];
|
||||
struct brcmfmac_pd_device devices[];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5644,7 +5644,7 @@ struct ec_response_typec_discovery {
|
||||
uint8_t svid_count; /* Number of SVIDs partner sent */
|
||||
uint16_t reserved;
|
||||
uint32_t discovery_vdo[6]; /* Max VDOs allowed after VDM header is 6 */
|
||||
struct svid_mode_info svids[0];
|
||||
struct svid_mode_info svids[];
|
||||
} __ec_align1;
|
||||
|
||||
/* USB Type-C commands for AP-controlled device policy. */
|
||||
|
||||
@@ -253,7 +253,7 @@ void posix_cpu_timers_exit_group(struct task_struct *task);
|
||||
void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,
|
||||
u64 *newval, u64 *oldval);
|
||||
|
||||
void update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new);
|
||||
int update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new);
|
||||
|
||||
void posixtimer_rearm(struct kernel_siginfo *info);
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,5 @@
|
||||
struct task_struct;
|
||||
|
||||
void getrusage(struct task_struct *p, int who, struct rusage *ru);
|
||||
int do_prlimit(struct task_struct *tsk, unsigned int resource,
|
||||
struct rlimit *new_rlim, struct rlimit *old_rlim);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -696,7 +696,7 @@ struct mgmt_cp_set_blocked_keys {
|
||||
#define MGMT_READ_CONTROLLER_CAP_SIZE 0
|
||||
struct mgmt_rp_read_controller_cap {
|
||||
__le16 cap_len;
|
||||
__u8 cap[0];
|
||||
__u8 cap[];
|
||||
} __packed;
|
||||
|
||||
#define MGMT_OP_READ_EXP_FEATURES_INFO 0x0049
|
||||
|
||||
@@ -35,7 +35,7 @@ struct ioam6_schema {
|
||||
int len;
|
||||
__be32 hdr;
|
||||
|
||||
u8 data[0];
|
||||
u8 data[];
|
||||
};
|
||||
|
||||
struct ioam6_pernet_data {
|
||||
|
||||
@@ -39,7 +39,7 @@ struct sof_ipc_channel_map {
|
||||
uint32_t ext_id;
|
||||
uint32_t ch_mask;
|
||||
uint32_t reserved;
|
||||
int32_t ch_coeffs[0];
|
||||
int32_t ch_coeffs[];
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
@@ -55,7 +55,7 @@ struct sof_ipc_stream_map {
|
||||
struct sof_ipc_cmd_hdr hdr;
|
||||
uint32_t num_ch_map;
|
||||
uint32_t reserved[3];
|
||||
struct sof_ipc_channel_map ch_map[0];
|
||||
struct sof_ipc_channel_map ch_map[];
|
||||
} __packed;
|
||||
|
||||
#endif /* __IPC_CHANNEL_MAP_H__ */
|
||||
|
||||
119
kernel/sys.c
119
kernel/sys.c
@@ -1426,6 +1426,68 @@ SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
|
||||
return errno;
|
||||
}
|
||||
|
||||
/* make sure you are allowed to change @tsk limits before calling this */
|
||||
static int do_prlimit(struct task_struct *tsk, unsigned int resource,
|
||||
struct rlimit *new_rlim, struct rlimit *old_rlim)
|
||||
{
|
||||
struct rlimit *rlim;
|
||||
int retval = 0;
|
||||
|
||||
if (resource >= RLIM_NLIMITS)
|
||||
return -EINVAL;
|
||||
if (new_rlim) {
|
||||
if (new_rlim->rlim_cur > new_rlim->rlim_max)
|
||||
return -EINVAL;
|
||||
if (resource == RLIMIT_NOFILE &&
|
||||
new_rlim->rlim_max > sysctl_nr_open)
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
/* Holding a refcount on tsk protects tsk->signal from disappearing. */
|
||||
rlim = tsk->signal->rlim + resource;
|
||||
task_lock(tsk->group_leader);
|
||||
if (new_rlim) {
|
||||
/*
|
||||
* Keep the capable check against init_user_ns until cgroups can
|
||||
* contain all limits.
|
||||
*/
|
||||
if (new_rlim->rlim_max > rlim->rlim_max &&
|
||||
!capable(CAP_SYS_RESOURCE))
|
||||
retval = -EPERM;
|
||||
if (!retval)
|
||||
retval = security_task_setrlimit(tsk, resource, new_rlim);
|
||||
}
|
||||
if (!retval) {
|
||||
if (old_rlim)
|
||||
*old_rlim = *rlim;
|
||||
if (new_rlim)
|
||||
*rlim = *new_rlim;
|
||||
}
|
||||
task_unlock(tsk->group_leader);
|
||||
|
||||
/*
|
||||
* RLIMIT_CPU handling. Arm the posix CPU timer if the limit is not
|
||||
* infinite. In case of RLIM_INFINITY the posix CPU timer code
|
||||
* ignores the rlimit.
|
||||
*/
|
||||
if (!retval && new_rlim && resource == RLIMIT_CPU &&
|
||||
new_rlim->rlim_cur != RLIM_INFINITY &&
|
||||
IS_ENABLED(CONFIG_POSIX_TIMERS)) {
|
||||
/*
|
||||
* update_rlimit_cpu can fail if the task is exiting, but there
|
||||
* may be other tasks in the thread group that are not exiting,
|
||||
* and they need their cpu timers adjusted.
|
||||
*
|
||||
* The group_leader is the last task to be released, so if we
|
||||
* cannot update_rlimit_cpu on it, then the entire process is
|
||||
* exiting and we do not need to update at all.
|
||||
*/
|
||||
update_rlimit_cpu(tsk->group_leader, new_rlim->rlim_cur);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim)
|
||||
{
|
||||
struct rlimit value;
|
||||
@@ -1569,63 +1631,6 @@ static void rlim64_to_rlim(const struct rlimit64 *rlim64, struct rlimit *rlim)
|
||||
rlim->rlim_max = (unsigned long)rlim64->rlim_max;
|
||||
}
|
||||
|
||||
/* make sure you are allowed to change @tsk limits before calling this */
|
||||
int do_prlimit(struct task_struct *tsk, unsigned int resource,
|
||||
struct rlimit *new_rlim, struct rlimit *old_rlim)
|
||||
{
|
||||
struct rlimit *rlim;
|
||||
int retval = 0;
|
||||
|
||||
if (resource >= RLIM_NLIMITS)
|
||||
return -EINVAL;
|
||||
if (new_rlim) {
|
||||
if (new_rlim->rlim_cur > new_rlim->rlim_max)
|
||||
return -EINVAL;
|
||||
if (resource == RLIMIT_NOFILE &&
|
||||
new_rlim->rlim_max > sysctl_nr_open)
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
/* protect tsk->signal and tsk->sighand from disappearing */
|
||||
read_lock(&tasklist_lock);
|
||||
if (!tsk->sighand) {
|
||||
retval = -ESRCH;
|
||||
goto out;
|
||||
}
|
||||
|
||||
rlim = tsk->signal->rlim + resource;
|
||||
task_lock(tsk->group_leader);
|
||||
if (new_rlim) {
|
||||
/* Keep the capable check against init_user_ns until
|
||||
cgroups can contain all limits */
|
||||
if (new_rlim->rlim_max > rlim->rlim_max &&
|
||||
!capable(CAP_SYS_RESOURCE))
|
||||
retval = -EPERM;
|
||||
if (!retval)
|
||||
retval = security_task_setrlimit(tsk, resource, new_rlim);
|
||||
}
|
||||
if (!retval) {
|
||||
if (old_rlim)
|
||||
*old_rlim = *rlim;
|
||||
if (new_rlim)
|
||||
*rlim = *new_rlim;
|
||||
}
|
||||
task_unlock(tsk->group_leader);
|
||||
|
||||
/*
|
||||
* RLIMIT_CPU handling. Arm the posix CPU timer if the limit is not
|
||||
* infinite. In case of RLIM_INFINITY the posix CPU timer code
|
||||
* ignores the rlimit.
|
||||
*/
|
||||
if (!retval && new_rlim && resource == RLIMIT_CPU &&
|
||||
new_rlim->rlim_cur != RLIM_INFINITY &&
|
||||
IS_ENABLED(CONFIG_POSIX_TIMERS))
|
||||
update_rlimit_cpu(tsk, new_rlim->rlim_cur);
|
||||
out:
|
||||
read_unlock(&tasklist_lock);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* rcu lock must be held */
|
||||
static int check_prlimit_permission(struct task_struct *task,
|
||||
unsigned int flags)
|
||||
|
||||
@@ -34,14 +34,20 @@ void posix_cputimers_group_init(struct posix_cputimers *pct, u64 cpu_limit)
|
||||
* tsk->signal->posix_cputimers.bases[clock].nextevt expiration cache if
|
||||
* necessary. Needs siglock protection since other code may update the
|
||||
* expiration cache as well.
|
||||
*
|
||||
* Returns 0 on success, -ESRCH on failure. Can fail if the task is exiting and
|
||||
* we cannot lock_task_sighand. Cannot fail if task is current.
|
||||
*/
|
||||
void update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new)
|
||||
int update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new)
|
||||
{
|
||||
u64 nsecs = rlim_new * NSEC_PER_SEC;
|
||||
unsigned long irq_fl;
|
||||
|
||||
spin_lock_irq(&task->sighand->siglock);
|
||||
if (!lock_task_sighand(task, &irq_fl))
|
||||
return -ESRCH;
|
||||
set_process_cpu_timer(task, CPUCLOCK_PROF, &nsecs, NULL);
|
||||
spin_unlock_irq(&task->sighand->siglock);
|
||||
unlock_task_sighand(task, &irq_fl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -35,14 +35,14 @@ struct fdt_reserve_entry {
|
||||
|
||||
struct fdt_node_header {
|
||||
fdt32_t tag;
|
||||
char name[0];
|
||||
char name[];
|
||||
};
|
||||
|
||||
struct fdt_property {
|
||||
fdt32_t tag;
|
||||
fdt32_t len;
|
||||
fdt32_t nameoff;
|
||||
char data[0];
|
||||
char data[];
|
||||
};
|
||||
|
||||
#endif /* !__ASSEMBLY */
|
||||
|
||||
@@ -24,7 +24,7 @@ static const char *tomoyo_loader;
|
||||
static int __init tomoyo_loader_setup(char *str)
|
||||
{
|
||||
tomoyo_loader = str;
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("TOMOYO_loader=", tomoyo_loader_setup);
|
||||
@@ -64,7 +64,7 @@ static const char *tomoyo_trigger;
|
||||
static int __init tomoyo_trigger_setup(char *str)
|
||||
{
|
||||
tomoyo_trigger = str;
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("TOMOYO_trigger=", tomoyo_trigger_setup);
|
||||
|
||||
@@ -427,7 +427,7 @@ struct snd_sst_drop_response {
|
||||
|
||||
struct snd_sst_async_msg {
|
||||
u32 msg_id; /* Async msg id */
|
||||
u32 payload[0];
|
||||
u32 payload[];
|
||||
};
|
||||
|
||||
struct snd_sst_async_err_msg {
|
||||
@@ -514,7 +514,7 @@ struct snd_sst_bytes_v2 {
|
||||
u8 pipe_id;
|
||||
u8 rsvd;
|
||||
u16 len;
|
||||
char bytes[0];
|
||||
char bytes[];
|
||||
};
|
||||
|
||||
#define MAX_VTSV_FILES 2
|
||||
|
||||
@@ -164,7 +164,7 @@ struct skl_base_cfg_ext {
|
||||
u8 reserved[8];
|
||||
u32 priv_param_length;
|
||||
/* Input pin formats followed by output ones. */
|
||||
struct skl_pin_format pins_fmt[0];
|
||||
struct skl_pin_format pins_fmt[];
|
||||
} __packed;
|
||||
|
||||
struct skl_algo_cfg {
|
||||
|
||||
@@ -240,7 +240,7 @@ struct id_index_entry {
|
||||
struct perf_record_id_index {
|
||||
struct perf_event_header header;
|
||||
__u64 nr;
|
||||
struct id_index_entry entries[0];
|
||||
struct id_index_entry entries[];
|
||||
};
|
||||
|
||||
struct perf_record_auxtrace_info {
|
||||
|
||||
Reference in New Issue
Block a user