Re: [asm-generic:compat-alloc-user-space-9 6/41] net/ethtool/ioctl.c:815:9: error: implicit declaration of function 'in_ia32_syscall'; did you mean 'in_compat_syscall'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 19, 2021 at 10:33 PM Arnd Bergmann <arnd@xxxxxxxx> wrote:
>
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -810,7 +810,7 @@ static noinline_for_stack int
> ethtool_get_sset_info(struct net_device *dev,
>
>  static bool ethtool_translate_compat(void)
>  {
> -#ifdef CONFIG_X86_64
> +#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
>         /* On x86, translation is needed for i386 but not x32 */
>         return in_ia32_syscall();
>  #else

No, that wouldn't work either, as that triggers the BUILD_BUG_ON() for UML.

This is getting rather ugly but hopefully covers all cases:

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index dd09e6aceae1..c323bbfa97b3 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -811,8 +811,10 @@ static noinline_for_stack int
ethtool_get_sset_info(struct net_device *dev,
 static bool ethtool_translate_compat(void)
 {
 #ifdef CONFIG_X86_64
+#ifdef CONFIG_COMPAT
        /* On x86, translation is needed for i386 but not x32 */
        return in_ia32_syscall();
+#endif
 #else
        BUILD_BUG_ON(sizeof(struct compat_ethtool_rxnfc) !=
                     sizeof(struct ethtool_rxnfc));

       Arnd



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux