All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] uapi: fix definition of struct sockaddr_nfc_llcp on x32 and mips n32
@ 2017-02-20 18:15 Dmitry V. Levin
  2017-02-20 21:28 ` Dmitry V. Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry V. Levin @ 2017-02-20 18:15 UTC (permalink / raw)
  To: Lauro Ramos Venancio, Aloisio Almeida Jr, Samuel Ortiz,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: linux-wireless, x86, linux-mips, linux-kernel

Replace size_t with __kernel_size_t to fix definition of struct
sockaddr_nfc_llcp on architectures like x32 and mips n32 where
sizeof(size_t) < sizeof(__kernel_size_t).

This also fixes the following linux/nfc.h userspace compilation error:

/usr/include/linux/nfc.h:279:2: error: unknown type name 'size_t'
  size_t service_name_len;

Cc: stable@vger.kernel.org
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 include/uapi/linux/nfc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 399f39f..f8ccc12 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -276,7 +276,7 @@ struct sockaddr_nfc_llcp {
 	__u8 dsap; /* Destination SAP, if known */
 	__u8 ssap; /* Source SAP to be bound to */
 	char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */;
-	size_t service_name_len;
+	__kernel_size_t service_name_len;
 };
 
 /* NFC socket protocols */
-- 
ldv

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] uapi: fix definition of struct sockaddr_nfc_llcp on x32 and mips n32
  2017-02-20 18:15 [PATCH 1/2] uapi: fix definition of struct sockaddr_nfc_llcp on x32 and mips n32 Dmitry V. Levin
@ 2017-02-20 21:28 ` Dmitry V. Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry V. Levin @ 2017-02-20 21:28 UTC (permalink / raw)
  To: Lauro Ramos Venancio, Aloisio Almeida Jr, Samuel Ortiz,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: linux-wireless, x86, linux-mips, linux-kernel

On Mon, Feb 20, 2017 at 09:15:33PM +0300, Dmitry V. Levin wrote:
> Replace size_t with __kernel_size_t to fix definition of struct
> sockaddr_nfc_llcp on architectures like x32 and mips n32 where
> sizeof(size_t) < sizeof(__kernel_size_t).
> 
> This also fixes the following linux/nfc.h userspace compilation error:
> 
> /usr/include/linux/nfc.h:279:2: error: unknown type name 'size_t'
>   size_t service_name_len;
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  include/uapi/linux/nfc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
> index 399f39f..f8ccc12 100644
> --- a/include/uapi/linux/nfc.h
> +++ b/include/uapi/linux/nfc.h
> @@ -276,7 +276,7 @@ struct sockaddr_nfc_llcp {
>  	__u8 dsap; /* Destination SAP, if known */
>  	__u8 ssap; /* Source SAP to be bound to */
>  	char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */;
> -	size_t service_name_len;
> +	__kernel_size_t service_name_len;
>  };
>  
>  /* NFC socket protocols */

Unfortunately, this is not the right fix for the problem.

It was definitely a bad idea to use architecture dependent types
in the definition of struct sockaddr_nfc_llcp.  Somebody will have
to implement a compat layer to make it work properly with x86, x32,
and other compat personalities.


-- 
ldv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-20 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 18:15 [PATCH 1/2] uapi: fix definition of struct sockaddr_nfc_llcp on x32 and mips n32 Dmitry V. Levin
2017-02-20 21:28 ` Dmitry V. Levin

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.