Skip to content

Commit d2980d8

Browse files
committed
Merge tag 'mm-nonmm-stable-2023-02-20-15-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull non-MM updates from Andrew Morton: "There is no particular theme here - mainly quick hits all over the tree. Most notable is a set of zlib changes from Mikhail Zaslonko which enhances and fixes zlib's use of S390 hardware support: 'lib/zlib: Set of s390 DFLTCC related patches for kernel zlib'" * tag 'mm-nonmm-stable-2023-02-20-15-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (55 commits) Update CREDITS file entry for Jesper Juhl sparc: allow PM configs for sparc32 COMPILE_TEST hung_task: print message when hung_task_warnings gets down to zero. arch/Kconfig: fix indentation scripts/tags.sh: fix the Kconfig tags generation when using latest ctags nilfs2: prevent WARNING in nilfs_dat_commit_end() lib/zlib: remove redundation assignement of avail_in dfltcc_gdht() lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default lib/zlib: DFLTCC always switch to software inflate for Z_PACKET_FLUSH option lib/zlib: DFLTCC support inflate with small window lib/zlib: Split deflate and inflate states for DFLTCC lib/zlib: DFLTCC not writing header bits when avail_out == 0 lib/zlib: fix DFLTCC ignoring flush modes when avail_in == 0 lib/zlib: fix DFLTCC not flushing EOBS when creating raw streams lib/zlib: implement switching between DFLTCC and software lib/zlib: adjust offset calculation for dfltcc_state nilfs2: replace WARN_ONs for invalid DAT metadata block requests scripts/spelling.txt: add "exsits" pattern and fix typo instances fs: gracefully handle ->get_block not mapping bh in __mpage_writepage cramfs: Kconfig: fix spelling & punctuation ...
2 parents 3822a7c + 8170138 commit d2980d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1779
-298
lines changed

CREDITS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,11 +1852,11 @@ E: [email protected]
18521852
D: fbdev hacking
18531853

18541854
N: Jesper Juhl
1855-
1855+
18561856
D: Various fixes, cleanups and minor features all over the tree.
18571857
D: Wrote initial version of the hdaps driver (since passed on to others).
1858-
S: Lemnosvej 1, 3.tv
1859-
S: 2300 Copenhagen S.
1858+
S: Titangade 5G, 2.tv
1859+
S: 2200 Copenhagen N.
18601860
S: Denmark
18611861

18621862
N: Jozsef Kadlecsik

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,16 +453,35 @@ this allows system administrators to override the
453453
kexec_load_disabled
454454
===================
455455

456-
A toggle indicating if the ``kexec_load`` syscall has been disabled.
457-
This value defaults to 0 (false: ``kexec_load`` enabled), but can be
458-
set to 1 (true: ``kexec_load`` disabled).
456+
A toggle indicating if the syscalls ``kexec_load`` and
457+
``kexec_file_load`` have been disabled.
458+
This value defaults to 0 (false: ``kexec_*load`` enabled), but can be
459+
set to 1 (true: ``kexec_*load`` disabled).
459460
Once true, kexec can no longer be used, and the toggle cannot be set
460461
back to false.
461462
This allows a kexec image to be loaded before disabling the syscall,
462463
allowing a system to set up (and later use) an image without it being
463464
altered.
464465
Generally used together with the `modules_disabled`_ sysctl.
465466

467+
kexec_load_limit_panic
468+
======================
469+
470+
This parameter specifies a limit to the number of times the syscalls
471+
``kexec_load`` and ``kexec_file_load`` can be called with a crash
472+
image. It can only be set with a more restrictive value than the
473+
current one.
474+
475+
== ======================================================
476+
-1 Unlimited calls to kexec. This is the default setting.
477+
N Number of calls left.
478+
== ======================================================
479+
480+
kexec_load_limit_reboot
481+
=======================
482+
483+
Similar functionality as ``kexec_load_limit_panic``, but for a normal
484+
image.
466485

467486
kptr_restrict
468487
=============

Documentation/fault-injection/fault-injection.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,71 @@ proc entries
231231
This feature is intended for systematic testing of faults in a single
232232
system call. See an example below.
233233

234+
235+
Error Injectable Functions
236+
--------------------------
237+
238+
This part is for the kenrel developers considering to add a function to
239+
ALLOW_ERROR_INJECTION() macro.
240+
241+
Requirements for the Error Injectable Functions
242+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
243+
244+
Since the function-level error injection forcibly changes the code path
245+
and returns an error even if the input and conditions are proper, this can
246+
cause unexpected kernel crash if you allow error injection on the function
247+
which is NOT error injectable. Thus, you (and reviewers) must ensure;
248+
249+
- The function returns an error code if it fails, and the callers must check
250+
it correctly (need to recover from it).
251+
252+
- The function does not execute any code which can change any state before
253+
the first error return. The state includes global or local, or input
254+
variable. For example, clear output address storage (e.g. `*ret = NULL`),
255+
increments/decrements counter, set a flag, preempt/irq disable or get
256+
a lock (if those are recovered before returning error, that will be OK.)
257+
258+
The first requirement is important, and it will result in that the release
259+
(free objects) functions are usually harder to inject errors than allocate
260+
functions. If errors of such release functions are not correctly handled
261+
it will cause a memory leak easily (the caller will confuse that the object
262+
has been released or corrupted.)
263+
264+
The second one is for the caller which expects the function should always
265+
does something. Thus if the function error injection skips whole of the
266+
function, the expectation is betrayed and causes an unexpected error.
267+
268+
Type of the Error Injectable Functions
269+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
270+
271+
Each error injectable functions will have the error type specified by the
272+
ALLOW_ERROR_INJECTION() macro. You have to choose it carefully if you add
273+
a new error injectable function. If the wrong error type is chosen, the
274+
kernel may crash because it may not be able to handle the error.
275+
There are 4 types of errors defined in include/asm-generic/error-injection.h
276+
277+
EI_ETYPE_NULL
278+
This function will return `NULL` if it fails. e.g. return an allocateed
279+
object address.
280+
281+
EI_ETYPE_ERRNO
282+
This function will return an `-errno` error code if it fails. e.g. return
283+
-EINVAL if the input is wrong. This will include the functions which will
284+
return an address which encodes `-errno` by ERR_PTR() macro.
285+
286+
EI_ETYPE_ERRNO_NULL
287+
This function will return an `-errno` or `NULL` if it fails. If the caller
288+
of this function checks the return value with IS_ERR_OR_NULL() macro, this
289+
type will be appropriate.
290+
291+
EI_ETYPE_TRUE
292+
This function will return `true` (non-zero positive value) if it fails.
293+
294+
If you specifies a wrong type, for example, EI_TYPE_ERRNO for the function
295+
which returns an allocated object, it may cause a problem because the returned
296+
value is not an object address and the caller can not access to the address.
297+
298+
234299
How to add new fault injection capability
235300
-----------------------------------------
236301

arch/Kconfig

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ config HOTPLUG_SMT
3535
bool
3636

3737
config GENERIC_ENTRY
38-
bool
38+
bool
3939

4040
config KPROBES
4141
bool "Kprobes"
@@ -55,26 +55,26 @@ config JUMP_LABEL
5555
depends on HAVE_ARCH_JUMP_LABEL
5656
select OBJTOOL if HAVE_JUMP_LABEL_HACK
5757
help
58-
This option enables a transparent branch optimization that
59-
makes certain almost-always-true or almost-always-false branch
60-
conditions even cheaper to execute within the kernel.
58+
This option enables a transparent branch optimization that
59+
makes certain almost-always-true or almost-always-false branch
60+
conditions even cheaper to execute within the kernel.
6161

62-
Certain performance-sensitive kernel code, such as trace points,
63-
scheduler functionality, networking code and KVM have such
64-
branches and include support for this optimization technique.
62+
Certain performance-sensitive kernel code, such as trace points,
63+
scheduler functionality, networking code and KVM have such
64+
branches and include support for this optimization technique.
6565

66-
If it is detected that the compiler has support for "asm goto",
67-
the kernel will compile such branches with just a nop
68-
instruction. When the condition flag is toggled to true, the
69-
nop will be converted to a jump instruction to execute the
70-
conditional block of instructions.
66+
If it is detected that the compiler has support for "asm goto",
67+
the kernel will compile such branches with just a nop
68+
instruction. When the condition flag is toggled to true, the
69+
nop will be converted to a jump instruction to execute the
70+
conditional block of instructions.
7171

72-
This technique lowers overhead and stress on the branch prediction
73-
of the processor and generally makes the kernel faster. The update
74-
of the condition is slower, but those are always very rare.
72+
This technique lowers overhead and stress on the branch prediction
73+
of the processor and generally makes the kernel faster. The update
74+
of the condition is slower, but those are always very rare.
7575

76-
( On 32-bit x86, the necessary options added to the compiler
77-
flags may increase the size of the kernel slightly. )
76+
( On 32-bit x86, the necessary options added to the compiler
77+
flags may increase the size of the kernel slightly. )
7878

7979
config STATIC_KEYS_SELFTEST
8080
bool "Static key selftest"
@@ -98,9 +98,9 @@ config KPROBES_ON_FTRACE
9898
depends on KPROBES && HAVE_KPROBES_ON_FTRACE
9999
depends on DYNAMIC_FTRACE_WITH_REGS
100100
help
101-
If function tracer is enabled and the arch supports full
102-
passing of pt_regs to function tracing, then kprobes can
103-
optimize on top of function tracing.
101+
If function tracer is enabled and the arch supports full
102+
passing of pt_regs to function tracing, then kprobes can
103+
optimize on top of function tracing.
104104

105105
config UPROBES
106106
def_bool n
@@ -154,21 +154,21 @@ config HAVE_EFFICIENT_UNALIGNED_ACCESS
154154
config ARCH_USE_BUILTIN_BSWAP
155155
bool
156156
help
157-
Modern versions of GCC (since 4.4) have builtin functions
158-
for handling byte-swapping. Using these, instead of the old
159-
inline assembler that the architecture code provides in the
160-
__arch_bswapXX() macros, allows the compiler to see what's
161-
happening and offers more opportunity for optimisation. In
162-
particular, the compiler will be able to combine the byteswap
163-
with a nearby load or store and use load-and-swap or
164-
store-and-swap instructions if the architecture has them. It
165-
should almost *never* result in code which is worse than the
166-
hand-coded assembler in <asm/swab.h>. But just in case it
167-
does, the use of the builtins is optional.
157+
Modern versions of GCC (since 4.4) have builtin functions
158+
for handling byte-swapping. Using these, instead of the old
159+
inline assembler that the architecture code provides in the
160+
__arch_bswapXX() macros, allows the compiler to see what's
161+
happening and offers more opportunity for optimisation. In
162+
particular, the compiler will be able to combine the byteswap
163+
with a nearby load or store and use load-and-swap or
164+
store-and-swap instructions if the architecture has them. It
165+
should almost *never* result in code which is worse than the
166+
hand-coded assembler in <asm/swab.h>. But just in case it
167+
does, the use of the builtins is optional.
168168

169-
Any architecture with load-and-swap or store-and-swap
170-
instructions should set this. And it shouldn't hurt to set it
171-
on architectures that don't have such instructions.
169+
Any architecture with load-and-swap or store-and-swap
170+
instructions should set this. And it shouldn't hurt to set it
171+
on architectures that don't have such instructions.
172172

173173
config KRETPROBES
174174
def_bool y
@@ -720,13 +720,13 @@ config LTO_CLANG_FULL
720720
depends on !COMPILE_TEST
721721
select LTO_CLANG
722722
help
723-
This option enables Clang's full Link Time Optimization (LTO), which
724-
allows the compiler to optimize the kernel globally. If you enable
725-
this option, the compiler generates LLVM bitcode instead of ELF
726-
object files, and the actual compilation from bitcode happens at
727-
the LTO link step, which may take several minutes depending on the
728-
kernel configuration. More information can be found from LLVM's
729-
documentation:
723+
This option enables Clang's full Link Time Optimization (LTO), which
724+
allows the compiler to optimize the kernel globally. If you enable
725+
this option, the compiler generates LLVM bitcode instead of ELF
726+
object files, and the actual compilation from bitcode happens at
727+
the LTO link step, which may take several minutes depending on the
728+
kernel configuration. More information can be found from LLVM's
729+
documentation:
730730

731731
https://llvm.org/docs/LinkTimeOptimization.html
732732

@@ -1330,9 +1330,9 @@ config ARCH_HAS_CC_PLATFORM
13301330
bool
13311331

13321332
config HAVE_SPARSE_SYSCALL_NR
1333-
bool
1334-
help
1335-
An architecture should select this if its syscall numbering is sparse
1333+
bool
1334+
help
1335+
An architecture should select this if its syscall numbering is sparse
13361336
to save space. For example, MIPS architecture has a syscall array with
13371337
entries at 4000, 5000 and 6000 locations. This option turns on syscall
13381338
related optimizations for a given architecture.
@@ -1356,35 +1356,35 @@ config HAVE_PREEMPT_DYNAMIC_CALL
13561356
depends on HAVE_STATIC_CALL
13571357
select HAVE_PREEMPT_DYNAMIC
13581358
help
1359-
An architecture should select this if it can handle the preemption
1360-
model being selected at boot time using static calls.
1359+
An architecture should select this if it can handle the preemption
1360+
model being selected at boot time using static calls.
13611361

1362-
Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
1363-
preemption function will be patched directly.
1362+
Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
1363+
preemption function will be patched directly.
13641364

1365-
Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
1366-
call to a preemption function will go through a trampoline, and the
1367-
trampoline will be patched.
1365+
Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
1366+
call to a preemption function will go through a trampoline, and the
1367+
trampoline will be patched.
13681368

1369-
It is strongly advised to support inline static call to avoid any
1370-
overhead.
1369+
It is strongly advised to support inline static call to avoid any
1370+
overhead.
13711371

13721372
config HAVE_PREEMPT_DYNAMIC_KEY
13731373
bool
13741374
depends on HAVE_ARCH_JUMP_LABEL
13751375
select HAVE_PREEMPT_DYNAMIC
13761376
help
1377-
An architecture should select this if it can handle the preemption
1378-
model being selected at boot time using static keys.
1377+
An architecture should select this if it can handle the preemption
1378+
model being selected at boot time using static keys.
13791379

1380-
Each preemption function will be given an early return based on a
1381-
static key. This should have slightly lower overhead than non-inline
1382-
static calls, as this effectively inlines each trampoline into the
1383-
start of its callee. This may avoid redundant work, and may
1384-
integrate better with CFI schemes.
1380+
Each preemption function will be given an early return based on a
1381+
static key. This should have slightly lower overhead than non-inline
1382+
static calls, as this effectively inlines each trampoline into the
1383+
start of its callee. This may avoid redundant work, and may
1384+
integrate better with CFI schemes.
13851385

1386-
This will have greater overhead than using inline static calls as
1387-
the call to the preemption function cannot be entirely elided.
1386+
This will have greater overhead than using inline static calls as
1387+
the call to the preemption function cannot be entirely elided.
13881388

13891389
config ARCH_WANT_LD_ORPHAN_WARN
13901390
bool
@@ -1407,8 +1407,8 @@ config ARCH_SUPPORTS_PAGE_TABLE_CHECK
14071407
config ARCH_SPLIT_ARG64
14081408
bool
14091409
help
1410-
If a 32-bit architecture requires 64-bit arguments to be split into
1411-
pairs of 32-bit arguments, select this option.
1410+
If a 32-bit architecture requires 64-bit arguments to be split into
1411+
pairs of 32-bit arguments, select this option.
14121412

14131413
config ARCH_HAS_ELFCORE_COMPAT
14141414
bool

arch/alpha/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct halt_info {
7373
static void
7474
common_shutdown_1(void *generic_ptr)
7575
{
76-
struct halt_info *how = (struct halt_info *)generic_ptr;
76+
struct halt_info *how = generic_ptr;
7777
struct percpu_struct *cpup;
7878
unsigned long *pflags, flags;
7979
int cpuid = smp_processor_id();

arch/alpha/kernel/smp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ flush_tlb_all(void)
628628
static void
629629
ipi_flush_tlb_mm(void *x)
630630
{
631-
struct mm_struct *mm = (struct mm_struct *) x;
631+
struct mm_struct *mm = x;
632632
if (mm == current->active_mm && !asn_locked())
633633
flush_tlb_current(mm);
634634
else
@@ -670,7 +670,7 @@ struct flush_tlb_page_struct {
670670
static void
671671
ipi_flush_tlb_page(void *x)
672672
{
673-
struct flush_tlb_page_struct *data = (struct flush_tlb_page_struct *)x;
673+
struct flush_tlb_page_struct *data = x;
674674
struct mm_struct * mm = data->mm;
675675

676676
if (mm == current->active_mm && !asn_locked())

arch/sparc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ config ARCH_FORCE_MAX_ORDER
283283
This config option is actually maximum order plus one. For example,
284284
a value of 13 means that the largest free memory block is 2^12 pages.
285285

286-
if SPARC64
286+
if SPARC64 || COMPILE_TEST
287287
source "kernel/power/Kconfig"
288288
endif
289289

arch/x86/kvm/emulate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2615,8 +2615,8 @@ static bool emulator_io_port_access_allowed(struct x86_emulate_ctxt *ctxt,
26152615
return true;
26162616
}
26172617

2618-
static bool emulator_io_permited(struct x86_emulate_ctxt *ctxt,
2619-
u16 port, u16 len)
2618+
static bool emulator_io_permitted(struct x86_emulate_ctxt *ctxt,
2619+
u16 port, u16 len)
26202620
{
26212621
if (ctxt->perm_ok)
26222622
return true;
@@ -3961,7 +3961,7 @@ static int check_rdpmc(struct x86_emulate_ctxt *ctxt)
39613961
static int check_perm_in(struct x86_emulate_ctxt *ctxt)
39623962
{
39633963
ctxt->dst.bytes = min(ctxt->dst.bytes, 4u);
3964-
if (!emulator_io_permited(ctxt, ctxt->src.val, ctxt->dst.bytes))
3964+
if (!emulator_io_permitted(ctxt, ctxt->src.val, ctxt->dst.bytes))
39653965
return emulate_gp(ctxt, 0);
39663966

39673967
return X86EMUL_CONTINUE;
@@ -3970,7 +3970,7 @@ static int check_perm_in(struct x86_emulate_ctxt *ctxt)
39703970
static int check_perm_out(struct x86_emulate_ctxt *ctxt)
39713971
{
39723972
ctxt->src.bytes = min(ctxt->src.bytes, 4u);
3973-
if (!emulator_io_permited(ctxt, ctxt->dst.val, ctxt->src.bytes))
3973+
if (!emulator_io_permitted(ctxt, ctxt->dst.val, ctxt->src.bytes))
39743974
return emulate_gp(ctxt, 0);
39753975

39763976
return X86EMUL_CONTINUE;

drivers/infiniband/ulp/iser/iscsi_iser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ iscsi_iser_conn_create(struct iscsi_cls_session *cls_session,
446446
* @is_leading: indicate if this is the session leading connection (MCS)
447447
*
448448
* Return: zero on success, $error if iscsi_conn_bind fails and
449-
* -EINVAL in case end-point doesn't exsits anymore or iser connection
449+
* -EINVAL in case end-point doesn't exists anymore or iser connection
450450
* state is not UP (teardown already started).
451451
*/
452452
static int iscsi_iser_conn_bind(struct iscsi_cls_session *cls_session,

0 commit comments

Comments
 (0)