On 09/05, Jiri Olsa wrote:
>
> Currently uprobe syscall handles all errors with forcing SIGILL to current
> process. As suggested by Andrii it'd be helpful for uprobe syscall detection
> to return error value for the !in_uprobe_trampoline check.
>
> This way we could just call uprobe syscall and based on return value we will
> find out if the kernel has it.
>
> Suggested-by: Andrii Nakryiko <[email protected]>
> Acked-by: Andrii Nakryiko <[email protected]>
> Signed-off-by: Jiri Olsa <[email protected]>
> ---
>  arch/x86/kernel/uprobes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
> index 0a8c0a4a5423..845aeaf36b8d 100644
> --- a/arch/x86/kernel/uprobes.c
> +++ b/arch/x86/kernel/uprobes.c
> @@ -810,7 +810,7 @@ SYSCALL_DEFINE0(uprobe)
>
>       /* Allow execution only from uprobe trampolines. */
>       if (!in_uprobe_trampoline(regs->ip))
> -             goto sigill;
> +             return -ENXIO;

I agree.

Acked-by: Oleg Nesterov <[email protected]>


Reply via email to