This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] linux: Clear mode_t padding bits (BZ#25623)
- From: Florian Weimer <fweimer at redhat dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 03 Mar 2020 22:51:46 +0100
- Subject: Re: [PATCH] linux: Clear mode_t padding bits (BZ#25623)
- References: <20200303192725.16847-1-adhemerval.zanella@linaro.org>
* Adhemerval Zanella:
> diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
> index 27879e76cd..48801a3fba 100644
> --- a/sysdeps/unix/sysv/linux/msgctl.c
> +++ b/sysdeps/unix/sysv/linux/msgctl.c
> +#else
> + /* Old Linux kernel versions might not clear the mode padding. */
> + if (sizeof ((struct msqid_ds){0}.msg_perm.mode
> + != sizeof ((struct __old_ipc_perm){0}.mode)))
> + buf->msg_perm.mode &= 0xFFFF;
> +#endif
The condition always evaluates to true becaduse the first sizeof is
applied to the result of the != operator.
Thanks,
Florian