Patchwork [09/24] x86_64: Use _CET_NOTRACK in strcmp.S

login
register
mail settings
Submitter H.J. Lu
Date June 13, 2018, 3:31 p.m.
Message ID <20180613153207.57232-10-hjl.tools@gmail.com>
Download mbox | patch
Permalink /patch/27789/
State New
Headers show

Comments

H.J. Lu - June 13, 2018, 3:31 p.m.
* sysdeps/x86_64/strcmp.S (STRCMP): Add _CET_NOTRACK before
	indirect jump to jump table.
---
 sysdeps/x86_64/strcmp.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
H.J. Lu - July 18, 2018, 3:17 a.m.
On Wed, Jun 13, 2018 at 8:31 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>         * sysdeps/x86_64/strcmp.S (STRCMP): Add _CET_NOTRACK before
>         indirect jump to jump table.
> ---
>  sysdeps/x86_64/strcmp.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/x86_64/strcmp.S b/sysdeps/x86_64/strcmp.S
> index de54fce647..e16945b961 100644
> --- a/sysdeps/x86_64/strcmp.S
> +++ b/sysdeps/x86_64/strcmp.S
> @@ -233,7 +233,7 @@ LABEL(bigger):
>         lea     LABEL(unaligned_table)(%rip), %r10
>         movslq  (%r10, %r9,4), %r9
>         lea     (%r10, %r9), %r10
> -       jmp     *%r10                           /* jump to corresponding case */
> +       _CET_NOTRACK jmp *%r10                  /* jump to corresponding case */
>
>  /*
>   * The following cases will be handled by ashr_0
> --
> 2.17.1
>

I am going to check in the rest of _CET_NOTRACK  patches:

https://sourceware.org/ml/libc-alpha/2018-06/msg00322.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00342.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00335.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00334.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00332.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00326.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00331.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00338.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00330.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00340.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00339.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00343.html
https://sourceware.org/ml/libc-alpha/2018-06/msg00336.html

Patch

diff --git a/sysdeps/x86_64/strcmp.S b/sysdeps/x86_64/strcmp.S
index de54fce647..e16945b961 100644
--- a/sysdeps/x86_64/strcmp.S
+++ b/sysdeps/x86_64/strcmp.S
@@ -233,7 +233,7 @@  LABEL(bigger):
 	lea	LABEL(unaligned_table)(%rip), %r10
 	movslq	(%r10, %r9,4), %r9
 	lea	(%r10, %r9), %r10
-	jmp	*%r10				/* jump to corresponding case */
+	_CET_NOTRACK jmp *%r10			/* jump to corresponding case */
 
 /*
  * The following cases will be handled by ashr_0