From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
"H . J . Lu" <hjl.tools@gmail.com>,
"H . Peter Anvin" <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
linux-arch@vger.kernel.org
Subject: Re: [PATCH v06 08/36] uapi asm-generic/shmbuf.h: include fixes
Date: Wed, 9 Aug 2017 01:42:53 +0300 [thread overview]
Message-ID: <20170808224253.GB10552@altlinux.org> (raw)
In-Reply-To: <20170806164428.2273-9-mikko.rapeli@iki.fi>
[-- Attachment #1: Type: text/plain, Size: 1867 bytes --]
On Sun, Aug 06, 2017 at 06:43:59PM +0200, Mikko Rapeli wrote:
> Include linux/types.h and asm/msgbuf.h and use __kernel_size_t instead
> of size_t.
>
> Fixes userspace compilation errors like:
>
> error: field ‘shm_perm’ has incomplete type
> struct ipc64_perm shm_perm; /* operation perms */
> error: unknown type name ‘size_t’
> error: unknown type name ‘__kernel_time_t’
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Cc: H.J. Lu <hjl.tools@gmail.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> ---
> include/uapi/asm-generic/shmbuf.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
> index 7e9fb2f0853b..ae867ad1e5e4 100644
> --- a/include/uapi/asm-generic/shmbuf.h
> +++ b/include/uapi/asm-generic/shmbuf.h
> @@ -1,7 +1,9 @@
> #ifndef __ASM_GENERIC_SHMBUF_H
> #define __ASM_GENERIC_SHMBUF_H
>
> +#include <linux/types.h>
> #include <asm/bitsperlong.h>
> +#include <asm/msgbuf.h>
>
> /*
> * The shmid64_ds structure for x86 architecture.
> @@ -24,7 +26,7 @@
>
> struct shmid64_ds {
> struct ipc64_perm shm_perm; /* operation perms */
> - size_t shm_segsz; /* size of segment (bytes) */
> + __kernel_size_t shm_segsz; /* size of segment (bytes) */
> __kernel_time_t shm_atime; /* last attach time */
> #if __BITS_PER_LONG != 64
> unsigned long __unused1;
Surprisingly enough, this replacement of size_t with __kernel_size_t
is not just correct, it's a fix for a more subtle bug on x32, see
http://lkml.kernel.org/r/20170302004607.GE27132@altlinux.org
I recommend splitting the change into "include" fix and "size_t" fix
like I did some time ago, see
http://lkml.kernel.org/r/20170302002253.GC27132@altlinux.org
--
ldv
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2017-08-08 22:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170806164428.2273-1-mikko.rapeli@iki.fi>
2017-08-06 16:43 ` [PATCH v06 06/36] uapi asm-generic/ipcbuf.h: include linux/posix_types.h Mikko Rapeli
2017-08-06 16:43 ` Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 07/36] uapi asm-generic/msgbuf.h: include asm/ipcbuf.h Mikko Rapeli
2017-08-06 16:43 ` Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 08/36] uapi asm-generic/shmbuf.h: include fixes Mikko Rapeli
2017-08-06 16:43 ` Mikko Rapeli
2017-08-08 22:42 ` Dmitry V. Levin [this message]
2017-08-08 22:42 ` Dmitry V. Levin
[not found] ` <20170808223420.GA10552@altlinux.org>
2017-08-09 7:18 ` [PATCH v06 05/36] uapi linux/sysctl.h: use __kernel_size_t instead of size_t Mikko Rapeli
2017-08-09 7:18 ` Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 09/36] uapi asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h Mikko Rapeli
2017-08-06 16:44 ` Mikko Rapeli
2017-08-08 22:45 ` Dmitry V. Levin
2017-08-06 16:44 ` [PATCH v06 10/36] uapi asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli
2017-08-06 16:44 ` Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 11/36] uapi asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h Mikko Rapeli
[not found] <20170808231711.GJ10552@altlinux.org>
[not found] ` <20170808231543.GI10552@altlinux.org>
[not found] ` <20170808225739.GF10552@altlinux.org>
[not found] ` <20170808225417.GE10552@altlinux.org>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170808224253.GB10552@altlinux.org \
--to=ldv@altlinux.org \
--cc=arnd@arndb.de \
--cc=hjl.tools@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikko.rapeli@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).