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: <20240711-b4-fault-injection-reverts-v1-0-9e2651945d68@suse.cz>
Date: Thu, 11 Jul 2024 18:35:29 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Mateusz Guzik <mjguzik@...il.com>, 
 Akinobu Mita <akinobu.mita@...il.com>, Alexei Starovoitov <ast@...nel.org>, 
 Daniel Borkmann <daniel@...earbox.net>, 
 John Fastabend <john.fastabend@...il.com>, 
 Andrii Nakryiko <andrii@...nel.org>, 
 Martin KaFai Lau <martin.lau@...ux.dev>, 
 Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>, 
 Yonghong Song <yonghong.song@...ux.dev>, KP Singh <kpsingh@...nel.org>, 
 Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>, 
 Jiri Olsa <jolsa@...nel.org>, Christoph Lameter <cl@...ux.com>, 
 David Rientjes <rientjes@...gle.com>, 
 Roman Gushchin <roman.gushchin@...ux.dev>, 
 Hyeonggon Yoo <42.hyeyoo@...il.com>, linux-kernel@...r.kernel.org, 
 bpf@...r.kernel.org, linux-mm@...ck.org, Vlastimil Babka <vbabka@...e.cz>
Subject: [PATCH 0/2] revert unconditional slab and page allocator fault
 injection calls

These two patches largely revert commits that added function call
overhead into slab and page allocation hotpaths and that cannot be
currently disabled even though related CONFIG_ options do exist.

A much more involved solution that can keep the callsites always
existing but hidden behind a static key if unused, is possible [1] and
can be pursued by anyone who believes it's necessary. Meanwhile the fact
the should_failslab() error injection is already not functional on
kernels built with current gcc without anyone noticing [2], and lukewarm
response to [1] suggests the need is not there. I believe it will be
more fair to have the state after this series as a baseline for possible
further optimisation, instead of the unconditional overhead.

For example a possible compromise for anyone who's fine with an empty
function call overhead but not the full CONFIG_FAILSLAB /
CONFIG_FAIL_PAGE_ALLOC overhead is to reuse patch 1 from [1] but insert
a static key check only inside should_failslab() and
should_fail_alloc_page() before performing the more expensive checks.

[1] https://lore.kernel.org/all/20240620-fault-injection-statickeys-v2-0-e23947d3d84b@suse.cz/#t
[2] https://github.com/bpftrace/bpftrace/issues/3258

Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
---
Vlastimil Babka (2):
      mm, slab: put should_failslab() back behind CONFIG_SHOULD_FAILSLAB
      mm, page_alloc: put should_fail_alloc_page() back behing CONFIG_FAIL_PAGE_ALLOC

 include/linux/fault-inject.h | 11 ++++-------
 kernel/bpf/verifier.c        |  4 ++++
 mm/fail_page_alloc.c         |  4 +++-
 mm/failslab.c                | 14 ++++++++------
 mm/page_alloc.c              |  6 ------
 mm/slub.c                    |  8 --------
 6 files changed, 19 insertions(+), 28 deletions(-)
---
base-commit: 256abd8e550ce977b728be79a74e1729438b4948
change-id: 20240711-b4-fault-injection-reverts-e4d099e620f5

Best regards,
-- 
Vlastimil Babka <vbabka@...e.cz>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ