All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Masahiro Yamada <masahiroy@kernel.org>, Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3] uapi: fix asm/signal.h userspace compilation errors
Date: Tue, 28 Dec 2021 18:54:30 +0300	[thread overview]
Message-ID: <20211228155429.GA11957@altlinux.org> (raw)
In-Reply-To: <20170302001853.GA27097@altlinux.org>

Userspace cannot compile <asm/signal.h> due to missing type definitions.
For example, compiling it for x86_64 fails with the following diagnostics
when the exception for asm/signal.h is removed from usr/include/Makefile:

$ make usr CONFIG_HEADERS_INSTALL=y CONFIG_UAPI_HEADER_TEST=y
...
  HDRTEST usr/include/asm/signal.h
In file included from <command-line>:
./usr/include/asm/signal.h:103:9: error: unknown type name 'size_t'
  103 |         size_t ss_size;
      |         ^~~~~~

Replace size_t with __kernel_size_t to make asm/signal.h self-contained,
also add it to the compile-test coverage.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---

This was submitted almost 5 years ago, so I was under impression that
it was applied among others of this kind, but, apparently, it's still
relevant.

v3: update commit message, remove usr/include/Makefile exception for
asm/signal.h.

 arch/alpha/include/uapi/asm/signal.h   | 2 +-
 arch/arm/include/uapi/asm/signal.h     | 2 +-
 arch/h8300/include/uapi/asm/signal.h   | 2 +-
 arch/ia64/include/uapi/asm/signal.h    | 2 +-
 arch/m68k/include/uapi/asm/signal.h    | 2 +-
 arch/mips/include/uapi/asm/signal.h    | 2 +-
 arch/parisc/include/uapi/asm/signal.h  | 2 +-
 arch/powerpc/include/uapi/asm/signal.h | 2 +-
 arch/s390/include/uapi/asm/signal.h    | 2 +-
 arch/sparc/include/uapi/asm/signal.h   | 2 +-
 arch/x86/include/uapi/asm/signal.h     | 2 +-
 arch/xtensa/include/uapi/asm/signal.h  | 2 +-
 include/uapi/asm-generic/signal.h      | 2 +-
 usr/include/Makefile                   | 1 -
 14 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/arch/alpha/include/uapi/asm/signal.h b/arch/alpha/include/uapi/asm/signal.h
index a69dd8d080a8..1413075f7616 100644
--- a/arch/alpha/include/uapi/asm/signal.h
+++ b/arch/alpha/include/uapi/asm/signal.h
@@ -100,7 +100,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 /* sigstack(2) is deprecated, and will be withdrawn in a future version
diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h
index c9a3ea1d8d41..9e2178420db2 100644
--- a/arch/arm/include/uapi/asm/signal.h
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -93,7 +93,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 
diff --git a/arch/h8300/include/uapi/asm/signal.h b/arch/h8300/include/uapi/asm/signal.h
index 2cd0dce2b6a6..1165481f80f6 100644
--- a/arch/h8300/include/uapi/asm/signal.h
+++ b/arch/h8300/include/uapi/asm/signal.h
@@ -85,7 +85,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 
diff --git a/arch/ia64/include/uapi/asm/signal.h b/arch/ia64/include/uapi/asm/signal.h
index 38166a88e4c9..63d574e802a2 100644
--- a/arch/ia64/include/uapi/asm/signal.h
+++ b/arch/ia64/include/uapi/asm/signal.h
@@ -90,7 +90,7 @@ struct siginfo;
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 
diff --git a/arch/m68k/include/uapi/asm/signal.h b/arch/m68k/include/uapi/asm/signal.h
index 4619291df601..80f520b9b10b 100644
--- a/arch/m68k/include/uapi/asm/signal.h
+++ b/arch/m68k/include/uapi/asm/signal.h
@@ -83,7 +83,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 #endif /* _UAPI_M68K_SIGNAL_H */
diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h
index e6c78a15cb2f..94a00f82e373 100644
--- a/arch/mips/include/uapi/asm/signal.h
+++ b/arch/mips/include/uapi/asm/signal.h
@@ -100,7 +100,7 @@ struct sigaction {
 /* IRIX compatible stack_t  */
 typedef struct sigaltstack {
 	void __user *ss_sp;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 	int ss_flags;
 } stack_t;
 
diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
index e5a2657477ac..8e4895c5ea5d 100644
--- a/arch/parisc/include/uapi/asm/signal.h
+++ b/arch/parisc/include/uapi/asm/signal.h
@@ -67,7 +67,7 @@ struct siginfo;
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 #endif /* !__ASSEMBLY */
diff --git a/arch/powerpc/include/uapi/asm/signal.h b/arch/powerpc/include/uapi/asm/signal.h
index 04873dd311c2..37d41d87c45b 100644
--- a/arch/powerpc/include/uapi/asm/signal.h
+++ b/arch/powerpc/include/uapi/asm/signal.h
@@ -86,7 +86,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 
diff --git a/arch/s390/include/uapi/asm/signal.h b/arch/s390/include/uapi/asm/signal.h
index 0189f326aac5..5c776e1f2cbd 100644
--- a/arch/s390/include/uapi/asm/signal.h
+++ b/arch/s390/include/uapi/asm/signal.h
@@ -108,7 +108,7 @@ struct sigaction {
 typedef struct sigaltstack {
         void __user *ss_sp;
         int ss_flags;
-        size_t ss_size;
+        __kernel_size_t ss_size;
 } stack_t;
 
 
diff --git a/arch/sparc/include/uapi/asm/signal.h b/arch/sparc/include/uapi/asm/signal.h
index 53758d53ac0e..d3faa3bfce3d 100644
--- a/arch/sparc/include/uapi/asm/signal.h
+++ b/arch/sparc/include/uapi/asm/signal.h
@@ -171,7 +171,7 @@ struct __old_sigaction {
 typedef struct sigaltstack {
 	void			__user *ss_sp;
 	int			ss_flags;
-	size_t			ss_size;
+	__kernel_size_t			ss_size;
 } stack_t;
 
 
diff --git a/arch/x86/include/uapi/asm/signal.h b/arch/x86/include/uapi/asm/signal.h
index 164a22a72984..777c3a0f4e23 100644
--- a/arch/x86/include/uapi/asm/signal.h
+++ b/arch/x86/include/uapi/asm/signal.h
@@ -104,7 +104,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/xtensa/include/uapi/asm/signal.h b/arch/xtensa/include/uapi/asm/signal.h
index 79ddabaa4e5d..b8c824dd4b74 100644
--- a/arch/xtensa/include/uapi/asm/signal.h
+++ b/arch/xtensa/include/uapi/asm/signal.h
@@ -103,7 +103,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 #endif	/* __ASSEMBLY__ */
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index f634822906e4..0eb69dc8e572 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -85,7 +85,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 #endif /* __ASSEMBLY__ */
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 129d13e71691..8ac2c33a59e7 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -20,7 +20,6 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include
 # Please consider to fix the header first.
 #
 # Sorted alphabetically.
-no-header-test += asm/signal.h
 no-header-test += asm/ucontext.h
 no-header-test += drm/vmwgfx_drm.h
 no-header-test += linux/am437x-vpfe.h


-- 
ldv

  parent reply	other threads:[~2021-12-28 15:54 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-26  1:01 [PATCH] uapi: fix asm/signal.h userspace compilation errors Dmitry V. Levin
2017-02-26  1:01 ` Dmitry V. Levin
2017-02-26  1:01 ` Dmitry V. Levin
2017-02-26  1:01 ` Dmitry V. Levin
2017-02-26  1:01 ` Dmitry V. Levin
2017-02-26  1:01 ` Dmitry V. Levin
2017-02-26  1:01 ` Dmitry V. Levin
2017-02-26  1:01 ` Dmitry V. Levin
2017-03-01 16:20 ` Arnd Bergmann
2017-03-01 16:20 ` Arnd Bergmann
2017-03-01 16:20   ` Arnd Bergmann
2017-03-01 16:20   ` Arnd Bergmann
2017-03-01 16:20   ` Arnd Bergmann
2017-03-01 16:20   ` Arnd Bergmann
2017-03-01 16:20   ` Arnd Bergmann
2017-03-01 16:20   ` Arnd Bergmann
2017-03-01 16:20   ` Arnd Bergmann
2017-03-02  0:18   ` [PATCH v2] x86/uapi: fix asm/signal.h userspace compilation error Dmitry V. Levin
2017-03-02  0:26     ` hpa
2017-03-02  0:33       ` Dmitry V. Levin
2017-03-03  0:59         ` [PATCH 1/2] uapi: introduce __kernel_uapi_size_t Dmitry V. Levin
2017-03-03  0:59         ` [PATCH v3 2/2] x86/uapi: fix asm/signal.h userspace compilation error Dmitry V. Levin
2021-12-28 15:54     ` Dmitry V. Levin [this message]
2017-03-02  0:20   ` [PATCH v2] uapi: fix asm/signal.h userspace compilation errors Dmitry V. Levin
2017-03-02  0:20     ` Dmitry V. Levin
2017-03-02  0:20     ` Dmitry V. Levin
2017-03-02  0:20     ` Dmitry V. Levin
2017-03-02  0:20     ` Dmitry V. Levin
2017-03-02  0:20     ` Dmitry V. Levin
2017-03-02  0:20     ` Dmitry V. Levin
2017-03-02  0:20     ` Dmitry V. Levin
2017-03-02 15:22   ` [PATCH] " Carlos O'Donell
2017-03-02 15:22   ` Carlos O'Donell
2017-03-02 15:22     ` Carlos O'Donell
2017-03-02 15:22     ` Carlos O'Donell
2017-03-02 15:22     ` Carlos O'Donell
2017-03-02 15:22     ` Carlos O'Donell
2017-03-02 15:22     ` Carlos O'Donell
2017-03-02 15:22     ` Carlos O'Donell
2017-03-02 15:22     ` Carlos O'Donell
2017-03-02 15:48     ` Dmitry V. Levin
2017-03-02 15:48     ` Dmitry V. Levin
2017-03-02 15:48       ` Dmitry V. Levin
2017-03-02 15:48       ` Dmitry V. Levin
2017-03-02 15:48       ` Dmitry V. Levin
2017-03-02 15:48       ` Dmitry V. Levin
2017-03-02 15:48       ` Dmitry V. Levin
2017-03-04  1:23       ` Carlos O'Donell
2017-03-04  1:23         ` Carlos O'Donell
2017-03-04  1:23         ` Carlos O'Donell
2017-03-04  1:23         ` Carlos O'Donell
2017-03-04  1:23         ` Carlos O'Donell
2017-03-04  1:23         ` Carlos O'Donell
2017-03-06 15:10         ` Carlos O'Donell
2017-03-06 15:10         ` Carlos O'Donell
2017-03-06 15:10           ` Carlos O'Donell
2017-03-06 15:10           ` Carlos O'Donell
2017-03-06 15:10           ` Carlos O'Donell
2017-03-06 15:10           ` Carlos O'Donell
2017-03-06 15:10           ` Carlos O'Donell
2017-03-04  1:23       ` Carlos O'Donell

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=20211228155429.GA11957@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.