Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "Dmitry V. Levin" <ldv@xxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Eric Paris <eparis@xxxxxxxxxx>, Paul Moore <paul@xxxxxxxxxxxxxx>
- Subject: Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument
- From: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
- Date: Tue, 27 Nov 2018 21:34:29 +1100
- Cc: linux-mips@xxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-c6x-dev@xxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, Eugene Syromyatnikov <esyr@xxxxxxxxxx>, Elvira Khabirova <lineprinter@xxxxxxxxxxxx>, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, uclinux-h8-devel@xxxxxxxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, Oleg Nesterov <oleg@xxxxxxxxxx>, linux-audit@xxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, nios2-dev@xxxxxxxxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx
- In-reply-to: <20181121004422.GA29053@altlinux.org>
- References: <20181107042751.3b519062@akathisia> <CALCETrV1v-DPRfDRwiH=xn29bxWxiHdZtAH1nw=dsmDtnT0YGQ@mail.gmail.com> <20181120001128.GA11300@altlinux.org> <20181121004422.GA29053@altlinux.org>
"Dmitry V. Levin" <ldv@xxxxxxxxxxxx> writes:
> diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
> index ab9f3f0a8637..d88b34179118 100644
> --- a/arch/powerpc/include/asm/syscall.h
> +++ b/arch/powerpc/include/asm/syscall.h
> @@ -100,9 +100,15 @@ static inline void syscall_set_arguments(struct task_struct *task,
> regs->orig_gpr3 = args[0];
> }
>
> -static inline int syscall_get_arch(void)
> +static inline int syscall_get_arch(struct task_struct *task)
> {
> - int arch = is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
> + int arch;
> +
> + if (IS_ENABLED(CONFIG_PPC64) && !test_tsk_thread_flag(task, TIF_32BIT))
> + arch = AUDIT_ARCH_PPC64;
> + else
> + arch = AUDIT_ARCH_PPC;
> +
> #ifdef __LITTLE_ENDIAN__
> arch |= __AUDIT_ARCH_LE;
> #endif
LGTM.
Acked-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> (powerpc)
cheers
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]