https://github.com/torvalds/linux
Revision a4412fdd49dc011bcc2c0d81ac4cab7457092650 authored by Steven Rostedt (Google) on 21 November 2022, 15:44:03 UTC, committed by Linus Torvalds on 01 December 2022, 21:14:21 UTC
The config to be able to inject error codes into any function annotated
with ALLOW_ERROR_INJECTION() is enabled when FUNCTION_ERROR_INJECTION is
enabled.  But unfortunately, this is always enabled on x86 when KPROBES
is enabled, and there's no way to turn it off.

As kprobes is useful for observability of the kernel, it is useful to
have it enabled in production environments.  But error injection should
be avoided.  Add a prompt to the config to allow it to be disabled even
when kprobes is enabled, and get rid of the "def_bool y".

This is a kernel debug feature (it's in Kconfig.debug), and should have
never been something enabled by default.

Cc: stable@vger.kernel.org
Fixes: 540adea3809f6 ("error-injection: Separate error-injection from kprobe")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 355479c
Raw File
Tip revision: a4412fdd49dc011bcc2c0d81ac4cab7457092650 authored by Steven Rostedt (Google) on 21 November 2022, 15:44:03 UTC
error-injection: Add prompt for function error injection
Tip revision: a4412fd
Kconfig
# SPDX-License-Identifier: GPL-2.0-only
config ROMFS_FS
	tristate "ROM file system support"
	depends on BLOCK || MTD
	help
	  This is a very small read-only file system mainly intended for
	  initial ram disks of installation disks, but it could be used for
	  other read-only media as well.  Read
	  <file:Documentation/filesystems/romfs.rst> for details.

	  To compile this file system support as a module, choose M here: the
	  module will be called romfs.  Note that the file system of your
	  root partition (the one containing the directory /) cannot be a
	  module.

	  If you don't know whether you need it, then you don't need it:
	  answer N.

#
# Select the backing stores to be supported
#
choice
	prompt "RomFS backing stores"
	depends on ROMFS_FS
	default ROMFS_BACKED_BY_BLOCK
	help
	  Select the backing stores to be supported.

config ROMFS_BACKED_BY_BLOCK
	bool "Block device-backed ROM file system support"
	depends on BLOCK
	help
	  This permits ROMFS to use block devices buffered through the page
	  cache as the medium from which to retrieve data.  It does not allow
	  direct mapping of the medium.

	  If unsure, answer Y.

config ROMFS_BACKED_BY_MTD
	bool "MTD-backed ROM file system support"
	depends on MTD=y || (ROMFS_FS=m && MTD)
	help
	  This permits ROMFS to use MTD based devices directly, without the
	  intercession of the block layer (which may have been disabled).  It
	  also allows direct mapping of MTD devices through romfs files under
	  NOMMU conditions if the underlying device is directly addressable by
	  the CPU.

	  If unsure, answer Y.

config ROMFS_BACKED_BY_BOTH
	bool "Both the above"
	depends on BLOCK && (MTD=y || (ROMFS_FS=m && MTD))
endchoice


config ROMFS_ON_BLOCK
	bool
	default y if ROMFS_BACKED_BY_BLOCK || ROMFS_BACKED_BY_BOTH

config ROMFS_ON_MTD
	bool
	default y if ROMFS_BACKED_BY_MTD || ROMFS_BACKED_BY_BOTH
back to top