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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 11 Feb 2009 09:34:09 -0500
From:	Brian Gerst <brgerst@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] x86: Use pt_regs pointer in do_device_not_available()

On Wed, Feb 11, 2009 at 2:43 AM, Tejun Heo <tj@...nel.org> wrote:
> Hello, Brian.
>
> Brian Gerst wrote:
>> The generic exception handler (error_code) passes in the pt_regs
>> pointer and the error code (unused in this case).  The commit
>> "x86: fix math_emu register frame access" changed this to pass by
>> value, which doesn't work correctly with stack protector enabled.
>> Change it back to use the pt_regs pointer.
>>
>> Signed-off-by: Brian Gerst <brgerst@...il.com>
>> ---
>>  arch/x86/include/asm/traps.h |    2 +-
>>  arch/x86/kernel/traps.c      |    9 +++++----
>>  2 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
>> index cf3bb05..0d53425 100644
>> --- a/arch/x86/include/asm/traps.h
>> +++ b/arch/x86/include/asm/traps.h
>> @@ -41,7 +41,7 @@ dotraplinkage void do_int3(struct pt_regs *, long);
>>  dotraplinkage void do_overflow(struct pt_regs *, long);
>>  dotraplinkage void do_bounds(struct pt_regs *, long);
>>  dotraplinkage void do_invalid_op(struct pt_regs *, long);
>> -dotraplinkage void do_device_not_available(struct pt_regs);
>> +dotraplinkage void do_device_not_available(struct pt_regs *, long);
>>  dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long);
>>  dotraplinkage void do_invalid_TSS(struct pt_regs *, long);
>>  dotraplinkage void do_segment_not_present(struct pt_regs *, long);
>> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
>> index 3b7b2e1..71a8f87 100644
>> --- a/arch/x86/kernel/traps.c
>> +++ b/arch/x86/kernel/traps.c
>> @@ -905,19 +905,20 @@ void math_emulate(struct math_emu_info *info)
>>  }
>>  #endif /* CONFIG_MATH_EMULATION */
>>
>> -dotraplinkage void __kprobes do_device_not_available(struct pt_regs regs)
>> +dotraplinkage void __kprobes
>> +do_device_not_available(struct pt_regs *regs, long error_code)
>
> What do you think about just taking pt_regs and accessing
> regs->orig_eax instead of having separate call convention for pt_regs
> ones and trap ones?  Too much work without enough benefit?

I don't quite follow what you are trying to say here.  Are you saying
use the same calling convention for the exception handlers (anything
called from error_code) and system calls?

--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ