lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 19 Jun 2019 13:18:48 +0100
From:   Will Deacon <will.deacon@....com>
To:     jinho lim <jordan.lim@...sung.com>
Cc:     mark.rutland@....com, ebiederm@...ssion.com, marc.zyngier@....com,
        anshuman.khandual@....com, andreyknvl@...gle.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        seroto7@...il.com
Subject: Re: [PATCH] arm64: remove useless condition

On Wed, Jun 19, 2019 at 08:38:57PM +0900, jinho lim wrote:
> dump_instr function checks user_mode internally.
> 
> Signed-off-by: jinho lim <jordan.lim@...sung.com>
> ---
>  arch/arm64/kernel/traps.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index ccc13b45d9b1..694e78b950ca 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -182,8 +182,7 @@ static int __die(const char *str, int err, struct pt_regs *regs)
>  	print_modules();
>  	show_regs(regs);
>  
> -	if (!user_mode(regs))
> -		dump_instr(KERN_EMERG, regs);
> +	dump_instr(KERN_EMERG, regs);

I don't think this is right, because it means we'll now dump the current
user instruction on the die() path.

Instead, we should probably rename dump_instr to dump_kernel_instr(),
and have it return immediately if user_mode(regs). We can also kill
__dump_instr completely.

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ