Re: [PATCH] libkmod: Avoid calling syscall() with -1

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

 



Hi Jan,

On Thu, May 2, 2013 at 11:47 AM, Jan Luebbe <jlu@xxxxxxxxxxxxxx> wrote:
> At least in qemu 1.4.1 for vexpress/arm-cortexa9, this resulted in an
> illegal instruction error. Solve that by returning an error when
> __NR_finit_module is -1.
> ---
>  libkmod/missing.h |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/libkmod/missing.h b/libkmod/missing.h
> index edb88b9..ac24a35 100644
> --- a/libkmod/missing.h
> +++ b/libkmod/missing.h
> @@ -20,8 +20,15 @@
>  #endif
>
>  #ifndef HAVE_FINIT_MODULE
> +#include <errno.h>
> +
>  static inline int finit_module(int fd, const char *uargs, int flags)
>  {
> -       return syscall(__NR_finit_module, fd, uargs, flags);
> +       if (__NR_finit_module == -1) {
> +               errno = ENOSYS;
> +               return -1;
> +       } else {
> +               return syscall(__NR_finit_module, fd, uargs, flags);
> +       }
>  }
>  #endif
> --

Indeed. But I had already a patch for that, just waiting the bug
reporter to test it:

http://bugs.funtoo.org/browse/FL-534

And the patch:
http://bugs.funtoo.org/secure/attachment/11098/dont-call-libc.diff

I prefer doing it at compile time rather than runtime.

Lucas De Marchi
--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux