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]
Message-Id: <20230407191904.gonna.522-kees@kernel.org>
Date:   Fri,  7 Apr 2023 12:27:06 -0700
From:   Kees Cook <keescook@...omium.org>
To:     linux-hardening@...r.kernel.org
Cc:     Kees Cook <keescook@...omium.org>,
        "Andy Shevchenko" <andy@...nel.org>,
        "Cezary Rojewski" <cezary.rojewski@...el.com>,
        "Puyou Lu" <puyou.lu@...il.com>, "Mark Brown" <broonie@...nel.org>,
        "Josh Poimboeuf" <jpoimboe@...nel.org>,
        "Peter Zijlstra" <peterz@...radead.org>,
        "Brendan Higgins" <brendan.higgins@...ux.dev>,
        "David Gow" <davidgow@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "Nathan Chancellor" <nathan@...nel.org>,
        "Alexander Potapenko" <glider@...gle.com>,
        "Zhaoyang Huang" <zhaoyang.huang@...soc.com>,
        "Randy Dunlap" <rdunlap@...radead.org>,
        "Geert Uytterhoeven" <geert+renesas@...der.be>,
        "Miguel Ojeda" <ojeda@...nel.org>,
        Alexander Lobakin <aleksander.lobakin@...el.com>,
        "Nick Desaulniers" <ndesaulniers@...gle.com>,
        "Liam Howlett" <liam.howlett@...cle.com>,
        "Vlastimil Babka" <vbabka@...e.cz>,
        "Dan Williams" <dan.j.williams@...el.com>,
        "Rasmus Villemoes" <linux@...musvillemoes.dk>,
        "Yury Norov" <yury.norov@...il.com>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        "Sander Vanheule" <sander@...nheule.net>,
        "Eric Biggers" <ebiggers@...gle.com>,
        "Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
        "Andrey Konovalov" <andreyknvl@...il.com>,
        "Linus Walleij" <linus.walleij@...aro.org>,
        "Daniel Latypov" <dlatypov@...gle.com>,
        José Expósito <jose.exposito89@...il.com>,
        linux-kernel@...r.kernel.org, kunit-dev@...glegroups.com
Subject: [PATCH v2 00/10] fortify: Add KUnit tests for runtime overflows

Hi,

This series adds KUnit tests for the CONFIG_FORTIFY_SOURCE behavior of the
standard C string functions, and for the strcat() family of functions,
as those were updated during refactoring. Finally, fortification error
messages are improved to give more context for the failure condition.

-Kees

v2:
- fix From/SoB
- strcat: force non-const length arguments (lkp)
- fix x86 and arm fortify_panic prototypes (lkp)
- move test-skip to init function (dlatypov)
- constify p_size, q_size everywhere (miguel)
- enum-ify, string-ify, bit-ify function name passing (aleksander & andy)
v1: https://lore.kernel.org/lkml/20230405235832.never.487-kees@kernel.org/

Kees Cook (10):
  kunit: tool: Enable CONFIG_FORTIFY_SOURCE under UML
  fortify: Allow KUnit test to build without FORTIFY
  string: Add Kunit tests for strcat() family
  fortify: Use const variables for __member_size tracking
  fortify: Add protection for strlcat()
  fortify: strcat: Move definition to use fortified strlcat()
  fortify: Split reporting and avoid passing string pointer
  fortify: Provide KUnit counters for failure testing
  fortify: Add KUnit tests for runtime overflows
  fortify: Improve buffer overflow reporting

 MAINTAINERS                                  |   1 +
 arch/arm/boot/compressed/misc.c              |   2 +-
 arch/x86/boot/compressed/misc.c              |   2 +-
 include/linux/fortify-string.h               | 257 +++++--
 lib/Kconfig.debug                            |   7 +-
 lib/Makefile                                 |   1 +
 lib/fortify_kunit.c                          | 731 +++++++++++++++++++
 lib/strcat_kunit.c                           | 104 +++
 lib/string_helpers.c                         |  26 +-
 tools/objtool/check.c                        |   2 +-
 tools/testing/kunit/configs/all_tests.config |   2 +
 tools/testing/kunit/configs/arch_uml.config  |   3 +
 12 files changed, 1059 insertions(+), 79 deletions(-)
 create mode 100644 lib/strcat_kunit.c

-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ