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:   Mon, 25 Jan 2021 23:03:18 -0800
From:   Krzysztof Olędzki <ole@....pl>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, Andy Lutomirski <luto@...nel.org>
Cc:     stable@...r.kernel.org, Krzysztof Mazur <krzysiek@...lesie.net>,
        Borislav Petkov <bp@...e.de>
Subject: Re: [PATCH 5.4 55/86] x86/mmx: Use KFPU_387 for MMX string operations

On 2021-01-25 at 10:39, Greg Kroah-Hartman wrote:
> From: Andy Lutomirski <luto@...nel.org>
> 
> commit 67de8dca50c027ca0fa3b62a488ee5035036a0da upstream.
> 
> The default kernel_fpu_begin() doesn't work on systems that support XMM but
> haven't yet enabled CR4.OSFXSR.  This causes crashes when _mmx_memcpy() is
> called too early because LDMXCSR generates #UD when the aforementioned bit
> is clear.
> 
> Fix it by using kernel_fpu_begin_mask(KFPU_387) explicitly.
> 
> Fixes: 7ad816762f9b ("x86/fpu: Reset MXCSR to default in kernel_fpu_begin()")
> Reported-by: Krzysztof Mazur <krzysiek@...lesie.net>
> Signed-off-by: Andy Lutomirski <luto@...nel.org>
> Signed-off-by: Borislav Petkov <bp@...e.de>
> Tested-by: Krzysztof Piotr Olędzki <ole@....pl>
> Tested-by: Krzysztof Mazur <krzysiek@...lesie.net>
> Cc: <stable@...r.kernel.org>
> Link: https://lkml.kernel.org/r/e7bf21855fe99e5f3baa27446e32623358f69e8d.1611205691.git.luto@kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

Similar to 5.10.11, we also need 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e45122893a9870813f9bd7b4add4f613e6f29008 
in 5.4.93:

Otherwise, the kernel will fail to compile if CONFIG_X86_USE_3DNOW=y

arch/x86/lib/mmx_32.c: In function '_mmx_memcpy':
arch/x86/lib/mmx_32.c:50:2: error: implicit declaration of function 
'kernel_fpu_begin_mask'; did you mean 'kernel_fpu_begin'? 
[-Werror=implicit-function-declaration]
    50 |  kernel_fpu_begin_mask(KFPU_387);
       |  ^~~~~~~~~~~~~~~~~~~~~
       |  kernel_fpu_begin
arch/x86/lib/mmx_32.c:50:24: error: 'KFPU_387' undeclared (first use in 
this function)
    50 |  kernel_fpu_begin_mask(KFPU_387);
       |                        ^~~~~~~~
arch/x86/lib/mmx_32.c:50:24: note: each undeclared identifier is 
reported only once for each function it appears in
arch/x86/lib/mmx_32.c: In function 'fast_clear_page':
arch/x86/lib/mmx_32.c:140:24: error: 'KFPU_387' undeclared (first use in 
this function)
   140 |  kernel_fpu_begin_mask(KFPU_387);
       |                        ^~~~~~~~
arch/x86/lib/mmx_32.c: In function 'fast_copy_page':
arch/x86/lib/mmx_32.c:173:24: error: 'KFPU_387' undeclared (first use in 
this function)
   173 |  kernel_fpu_begin_mask(KFPU_387);
       |                        ^~~~~~~~

Thanks,
  Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ