unsigned char d_namlen; /* Length of the file name. */
/* Only this member is in the POSIX standard. */
- char d_name[1]; /* File name (actually longer). */
+ char d_name[1] __attribute__((bnd_variable_size)); /* File name (actually longer). */
};
#ifdef __USE_LARGEFILE64
unsigned char d_type;
unsigned char d_namlen;
- char d_name[1];
+ char d_name[1] __attribute__((bnd_variable_size));
};
#endif
/* Data structure to describe CPU mask. */
typedef struct
{
- __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
+ __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS] __attribute__((bnd_variable_size));
} cpu_set_t;
/* Access functions for CPU masks. */
}
setenv ("LIBC_FATAL_STDERR_", "1", 1);
- struct A { char buf1[9]; char buf2[1]; } a;
- struct wA { wchar_t buf1[9]; wchar_t buf2[1]; } wa;
+ struct A { char buf1[9] __attribute__((bnd_variable_size)); char buf2[1]; } a;
+ struct wA { wchar_t buf1[9] __attribute__((bnd_variable_size)); wchar_t buf2[1]; } wa;
printf ("Test checking routines at fortify level %d\n",
#ifdef __USE_FORTIFY_LEVEL
{
size_t dls_size; /* Size in bytes of the whole buffer. */
unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */
- Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */
+ Dl_serpath dls_serpath[1] __attribute__((bnd_variable_size)); /* Actually longer, dls_cnt elements. */
} Dl_serinfo;
#endif /* __USE_GNU */
{
uintptr_t cookie;
unsigned int bindflags;
- } l_audit[0];
+ } l_audit[0] __attribute__((bnd_variable_size));
};
/* Number of source addresses. */
uint32_t imsf_numsrc;
/* Source addresses. */
- struct in_addr imsf_slist[1];
+ struct in_addr imsf_slist[1] __attribute__((bnd_variable_size));
};
#define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
/* Number of source addresses. */
uint32_t gf_numsrc;
/* Source addresses. */
- struct sockaddr_storage gf_slist[1];
+ struct sockaddr_storage gf_slist[1] __attribute__((bnd_variable_size));
};
#define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
u_char rip_vers; /* protocol version # */
u_char rip_res1[2]; /* pad to 32-bit boundary */
union {
- struct netinfo ru_nets[1]; /* variable length... */
- char ru_tracefile[1]; /* ditto ... */
+ struct netinfo ru_nets[1] __attribute__((bnd_variable_size)); /* variable length... */
+ char ru_tracefile[1] __attribute__((bnd_variable_size)); /* ditto ... */
} ripun;
#define rip_nets ripun.ru_nets
#define rip_tracefile ripun.ru_tracefile
/* Pointer to the string in question. */
union
{
- char appended[ZERO]; /* used if domain != NULL */
+ char appended[ZERO] __attribute__((bnd_variable_size)); /* used if domain != NULL */
const char *ptr; /* used if domain == NULL */
}
msgid;
typedef struct transmem_list
{
struct transmem_list *next;
- char data[ZERO];
+ char data[ZERO] __attribute__((bnd_variable_size));
} transmem_block_t;
static struct transmem_list *transmem_list;
#else
struct binding *next;
char *dirname;
char *codeset;
- char domainname[ZERO];
+ char domainname[ZERO] __attribute__((bnd_variable_size));
};
/* A counter which is incremented each time some previous translations
nls_uint32 segsize;
/* Reference to system dependent string segment, or ~0 at the end. */
nls_uint32 sysdepref;
- } segments[1];
+ } segments[1] __attribute__((bnd_variable_size));
};
/* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF,
const void *data;
struct loaded_l10nfile *next;
- struct loaded_l10nfile *successor[1];
+ struct loaded_l10nfile *successor[1] __attribute__((bnd_variable_size));
};
u_short fts_instr; /* fts_set() instructions */
struct stat *fts_statp; /* stat(2) information */
- char fts_name[1]; /* file name */
+ char fts_name[1] __attribute__((bnd_variable_size)); /* file name */
} FTSENT;
__BEGIN_DECLS
const char *string;
unsigned int word; /* Note endian issues vs 64-bit pointers. */
}
- values __flexarr; /* Items, usually pointers into `filedata'. */
+ values __flexarr __attribute__((bnd_variable_size)); /* Items, usually pointers into `filedata'. */
};
/* We know three kinds of collation sorting rules. */
#include "categories.def"
#undef DEFINE_CATEGORY
};
- char str[0];
+ char str[0] __attribute__((bnd_variable_size));
} _nl_category_names attribute_hidden;
extern const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden;
extern const uint8_t _nl_category_name_sizes[__LC_LAST] attribute_hidden;
{
struct qelem *q_forw;
struct qelem *q_back;
- char q_data[1];
+ char q_data[1] __attribute__((bnd_variable_size));
};
# endif
};
/* This descriptor's link on the `stack_used' or `__stack_user' list. */
- list_t list;
+ list_t list __attribute__((bnd_variable_size));
/* Thread ID - which is also a 'is this thread descriptor (and
therefore stack) used' flag. */
/* List of robust mutexes the thread is holding. */
#ifdef __PTHREAD_MUTEX_HAVE_PREV
void *robust_prev;
- struct robust_list_head robust_head;
+ struct robust_list_head robust_head __attribute__((bnd_variable_size));
+ /* sometimes we want to cast pair {robust_prev (void *) and the
+ * first field of struct robust_list_head (void *)}
+ * to __pthread_list_t (struct consists of two pointers: __prev, __next) */
/* The list above is strange. It is basically a double linked list
but the pointer to the next/previous element of the list points
# define ENQUEUE_MUTEX_BOTH(mutex, val) \
do { \
__pthread_list_t *next = (__pthread_list_t *) \
- ((((uintptr_t) THREAD_GETMEM (THREAD_SELF, robust_head.list)) & ~1ul) \
+ ((char *)(((uintptr_t) THREAD_GETMEM (THREAD_SELF, robust_head.list)) & ~1ul) \
- QUEUE_PTR_ADJUST); \
next->__prev = (void *) &mutex->__data.__list.__next; \
mutex->__data.__list.__next = THREAD_GETMEM (THREAD_SELF, \
typedef struct __pthread_internal_list
{
struct __pthread_internal_list *__prev;
- struct __pthread_internal_list *__next;
+ struct __pthread_internal_list *__next __attribute__((bnd_variable_size));
} __pthread_list_t;
#else
typedef struct __pthread_internal_slist
#define P(n, s) char MF(__LINE__)[sizeof (s)];
#include "psiginfo-data.h"
};
- char str[0];
+ char str[0] __attribute__((bnd_variable_size));
} C(codestrs_, NOW) = { {
#define P(n, s) s,
#include "psiginfo-data.h"
u_int cu_sendsz;
char *cu_outbuf;
u_int cu_recvsz;
- char cu_inbuf[1];
+ char cu_inbuf[1] __attribute__((bnd_variable_size)) ;
};
/*
} id_ip;
struct icmp_ra_addr id_radv;
u_int32_t id_mask;
- u_int8_t id_data[1];
+ u_int8_t id_data[1] __attribute__((bnd_variable_size));
} icmp_dun;
#define icmp_otime icmp_dun.id_ts.its_otime
#define icmp_rtime icmp_dun.id_ts.its_rtime
/* Data structure to describe CPU mask. */
typedef struct
{
- __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
+ __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS] __attribute__((bnd_variable_size));
} cpu_set_t;
/* Access functions for CPU masks. */
struct msgbuf
{
__syscall_slong_t mtype; /* type of received/sent message */
- char mtext[1]; /* text of the message */
+ char mtext[1] __attribute__((bnd_variable_size)); /* text of the message */
};
#endif