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:   Fri, 19 Nov 2021 09:15:43 -0800
From:   Kees Cook <keescook@...omium.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org, hjl.tools@...il.com,
        andrew.cooper3@...rix.com, mark.rutland@....com, will@...nel.org,
        ndesaulniers@...gle.com
Subject: Re: [PATCH 3/3] x86: Add straight-line-speculation mitigation

On Fri, Nov 19, 2021 at 05:50:26PM +0100, Peter Zijlstra wrote:
> This little patch makes use of an upcomming GCC feature to mitigate
> straight-line-speculation for x86:
> 
>   https://gcc.gnu.org/g:53a643f8568067d7700a9f2facc8ba39974973d3
>   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952
>   https://bugs.llvm.org/show_bug.cgi?id=52323
> 
> It's built tested on x86_64-allyesconfig using GCC-12 and GCC-11.
> It's also been boot tested on x86_64-defconfig+kvm_guest.config using
> GCC-12.
> 
> Maintenace overhead of this should be fairly low due to objtool
> validation.
> 
> Size overhead of all these additional int3 instructions comes to:
> 
>    text	   data	    bss	    dec	    hex	filename
> 22267751	6933356	2011368	31212475	1dc43bb	defconfig-build/vmlinux
> 22804126	6933356	1470696	31208178	1dc32f2	defconfig-build/vmlinux.sls
> 
> Or roughly 2.4% additional text.

Thanks for adding the size details. (I remain surprised it's so much.)

> [...]
>  125 files changed, 441 insertions(+), 386 deletions(-)

I wonder if this patch should be split into a few pieces:

- objtool validation
- asm macro definitions
- mechanical ret/RET replacement
- Kconfig & Makefile

Personally I'd find that much easier to review, but either way:

Reviewed-by: Kees Cook <keescook@...omium.org>

Thanks!

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ