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-next>] [day] [month] [year] [list]
Date:   Wed, 28 Oct 2020 18:15:04 +0100
From:   Ard Biesheuvel <ardb@...nel.org>
To:     linux-kernel@...r.kernel.org
Cc:     netdev@...r.kernel.org, bpf@...r.kernel.org, arnd@...db.de,
        Ard Biesheuvel <ardb@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Arvind Sankar <nivedita@...m.mit.edu>,
        Randy Dunlap <rdunlap@...radead.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Peter Zijlstra <peterz@...radead.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Kees Cook <keescook@...omium.org>
Subject: [PATCH v2 0/2] get rid of GCC __attribute__((optimize)) for BPF

This is a followup to [0]:
[PATCH] bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE[0]

Changes since v1:
- only use -fno-gcse when CONFIG_BPF_JIT_ALWAYS_ON=y and CONFIG_CC_IS_GCC=y
  (but ignore CONFIG_RETPOLINE since we want to avoid GCSE in all cases)
- to avoid potential impact of disabling GCSE on other code, put the
  interpreter in a separate file (patch #2)

Note that patch #1 is intended for backporting, as function scope GCC
optimization attributes are really quite broken.

I don't have a strong opinion on whether the interpreter code should be
split off or not, but it looks like it can be done fairly painlessly,
so it is probably a good idea to do it anyway.

[0] https://lore.kernel.org/bpf/20201027205723.12514-1-ardb@kernel.org/

Cc: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Arvind Sankar <nivedita@...m.mit.edu>
Cc: Randy Dunlap <rdunlap@...radead.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Daniel Borkmann <daniel@...earbox.net>
Cc: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Kees Cook <keescook@...omium.org>

Ard Biesheuvel (2):
  bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE
  bpf: move interpreter into separate source file

 include/linux/compiler-gcc.h   |   2 -
 include/linux/compiler_types.h |   4 -
 include/linux/filter.h         |   1 +
 kernel/bpf/Makefile            |   7 +-
 kernel/bpf/core.c              | 567 ------------------
 kernel/bpf/interp.c            | 601 ++++++++++++++++++++
 6 files changed, 607 insertions(+), 575 deletions(-)
 create mode 100644 kernel/bpf/interp.c

-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ