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]
Message-Id: <dad7b36f-2e37-44db-939e-cdb454875e2a@app.fastmail.com>
Date: Sun, 14 Jul 2024 11:11:05 +0800
From: "Jiaxun Yang" <jiaxun.yang@...goat.com>
To: "Maciej W. Rozycki" <macro@...am.me.uk>
Cc: "Thomas Bogendoerfer" <tsbogend@...ha.franken.de>,
 "Jonathan Corbet" <corbet@....net>, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org,
 "linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
 Philippe Mathieu-Daudé <philmd@...aro.org>
Subject: Re: [PATCH v3] MIPS: Implement ieee754 NAN2008 emulation mode



在2024年7月12日七月 下午8:22,Maciej W. Rozycki写道:
> On Fri, 12 Jul 2024, Jiaxun Yang wrote:
>
>> >> >  It would be good to check with hard-float QEMU configured for writable 
>> >> > FCSR.NAN2008 (which is one way original code was verified) that things 
>> >> > have not regressed.  And also what happens if once our emulation has 
>> >> > triggered for the unsupported FCSR.NAN2008 mode, an attempt is made to 
>> >> > flip the mode bit via ptrace(2), e.g. under GDB, which I reckon our 
>> >> > emulation permits for non-legacy CPUs (and which I think should not be 
>> >> > allowed under the new setting).
>> >> 
>> >> PTrace is working as expected (reflects emulated value).
>> >
>> >  Yes, sure for reads, but how about *writing* to the bit?
>> 
>> Tested flipping nan2008 bits with ieee754=emulated with ptrace, it works on some extent.
>> (flipping the bit to unsupported value immediately triggered emulation).
>
>  What about the other way round?

It works on both side (NaN2008 binary with ptrace flipped back to legacy and legacy flipped
back to NaN2008).

>
>  Anyway I think we need to prevent it from happening, matching runtime 
> behaviour, i.e. if the program itself cannot flip FCSR.NAN2008 via CTC1, 
> then ptrace(2) must not either.  And the same for the emulator in the 
> "ieee754=emulated" mode (but not for the emulator modes where the flipping 
> is currently permitted), as it would be a one-way switch.

It is out of the scope of this patch I think. Maybe we need a prctl to set NaN2008 status.

We are unable to prevent user applications write NAN2008 bits for the "switchable
QEMU" as well. So I'd perfer leave it as is, and let this feature go into 6.11 so people
can start to use it.

This is actually a request from Debian MIPS team so they can get glibc tests run on
mismatched NaN hardware.

Thanks
>
>  In other words we need to be consistent and the NaN mode of operation has 
> to be strapped in "ieee754=emulated" mode according to ELF file header's 
> EF_MIPS_NAN2008 bit for the duration of execution of a given program.
>
>  Likewise FCSR.ABS2008.
>
[...]
-- 
- Jiaxun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ