* [PATCH] powerpc/audit: Fix syscall_get_arch()
@ 2022-01-13 18:07 ` Christophe Leroy
0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy @ 2022-01-13 18:07 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: Christophe Leroy, linux-kernel, linuxppc-dev, Dmitry V . Levin, stable
Commit 770cec16cdc9 ("powerpc/audit: Simplify syscall_get_arch()")
replaced test_tsk_thread_flag(task, TIF_32BIT)) by is_32bit_task().
But is_32bit_task() applies on current task while be want the test
done on task 'task'
So re-use test_tsk_thread_flag() instead.
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: 770cec16cdc9 ("powerpc/audit: Simplify syscall_get_arch()")
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/include/asm/syscall.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
index 52d05b465e3e..32f76833b736 100644
--- a/arch/powerpc/include/asm/syscall.h
+++ b/arch/powerpc/include/asm/syscall.h
@@ -105,7 +105,9 @@ static inline void syscall_get_arguments(struct task_struct *task,
static inline int syscall_get_arch(struct task_struct *task)
{
- if (is_32bit_task())
+ if (IS_ENABLED(CONFIG_PPC32))
+ return AUDIT_ARCH_PPC;
+ else if (IS_ENABLED(CONFIG_COMPAT) && test_tsk_thread_flag(task, TIF_32BIT))
return AUDIT_ARCH_PPC;
else if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
return AUDIT_ARCH_PPC64LE;
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] powerpc/audit: Fix syscall_get_arch()
@ 2022-01-13 18:07 ` Christophe Leroy
0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy @ 2022-01-13 18:07 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: stable, linuxppc-dev, linux-kernel, Dmitry V . Levin
Commit 770cec16cdc9 ("powerpc/audit: Simplify syscall_get_arch()")
replaced test_tsk_thread_flag(task, TIF_32BIT)) by is_32bit_task().
But is_32bit_task() applies on current task while be want the test
done on task 'task'
So re-use test_tsk_thread_flag() instead.
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: 770cec16cdc9 ("powerpc/audit: Simplify syscall_get_arch()")
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/include/asm/syscall.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
index 52d05b465e3e..32f76833b736 100644
--- a/arch/powerpc/include/asm/syscall.h
+++ b/arch/powerpc/include/asm/syscall.h
@@ -105,7 +105,9 @@ static inline void syscall_get_arguments(struct task_struct *task,
static inline int syscall_get_arch(struct task_struct *task)
{
- if (is_32bit_task())
+ if (IS_ENABLED(CONFIG_PPC32))
+ return AUDIT_ARCH_PPC;
+ else if (IS_ENABLED(CONFIG_COMPAT) && test_tsk_thread_flag(task, TIF_32BIT))
return AUDIT_ARCH_PPC;
else if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
return AUDIT_ARCH_PPC64LE;
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-13 18:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 18:07 [PATCH] powerpc/audit: Fix syscall_get_arch() Christophe Leroy
2022-01-13 18:07 ` Christophe Leroy
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.