Skip to content

Commit 8702f2c

Browse files
committed
Merge tag 'mm-nonmm-stable-2022-12-12' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull non-MM updates from Andrew Morton: - A ptrace API cleanup series from Sergey Shtylyov - Fixes and cleanups for kexec from ye xingchen - nilfs2 updates from Ryusuke Konishi - squashfs feature work from Xiaoming Ni: permit configuration of the filesystem's compression concurrency from the mount command line - A series from Akinobu Mita which addresses bound checking errors when writing to debugfs files - A series from Yang Yingliang to address rapidio memory leaks - A series from Zheng Yejian to address possible overflow errors in encode_comp_t() - And a whole shower of singleton patches all over the place * tag 'mm-nonmm-stable-2022-12-12' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (79 commits) ipc: fix memory leak in init_mqueue_fs() hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount rapidio: devices: fix missing put_device in mport_cdev_open kcov: fix spelling typos in comments hfs: Fix OOB Write in hfs_asc2mac hfs: fix OOB Read in __hfs_brec_find relay: fix type mismatch when allocating memory in relay_create_buf() ocfs2: always read both high and low parts of dinode link count io-mapping: move some code within the include guarded section kernel: kcsan: kcsan_test: build without structleak plugin mailmap: update email for Iskren Chernev eventfd: change int to __u64 in eventfd_signal() ifndef CONFIG_EVENTFD rapidio: fix possible UAF when kfifo_alloc() fails relay: use strscpy() is more robust and safer cpumask: limit visibility of FORCE_NR_CPUS acct: fix potential integer overflow in encode_comp_t() acct: fix accuracy loss for input value of encode_comp_t() linux/init.h: include <linux/build_bug.h> and <linux/stringify.h> rapidio: rio: fix possible name leak in rio_register_mport() rapidio: fix possible name leaks when rio_add_device() fails ...
2 parents a7cacfb + 12b677f commit 8702f2c

Some content is hidden

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

100 files changed

+750
-302
lines changed

.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ Juha Yrjola <at solidboot.com>
228228
Juha Yrjola <juha.yrjola@nokia.com>
229229
Juha Yrjola <juha.yrjola@solidboot.com>
230230
Julien Thierry <julien.thierry.kdev@gmail.com> <julien.thierry@arm.com>
231+
Iskren Chernev <me@iskren.info> <iskren.chernev@gmail.com>
231232
Kalle Valo <kvalo@kernel.org> <kvalo@codeaurora.org>
232233
Kalyan Thota <quic_kalyant@quicinc.com> <kalyan_t@codeaurora.org>
233234
Kay Sievers <kay.sievers@vrfy.org>

Documentation/admin-guide/sysctl/kernel.rst

+1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ core_pattern
176176
%f executable filename
177177
%E executable path
178178
%c maximum size of core file by resource limit RLIMIT_CORE
179+
%C CPU the task ran on
179180
%<OTHER> both are dropped
180181
======== ==========================================
181182

Documentation/fault-injection/fault-injection.rst

+4-6
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ configuration of fault-injection capabilities.
8383
- /sys/kernel/debug/fail*/times:
8484

8585
specifies how many times failures may happen at most. A value of -1
86-
means "no limit". Note, though, that this file only accepts unsigned
87-
values. So, if you want to specify -1, you better use 'printf' instead
88-
of 'echo', e.g.: $ printf %#x -1 > times
86+
means "no limit".
8987

9088
- /sys/kernel/debug/fail*/space:
9189

@@ -284,7 +282,7 @@ Application Examples
284282
echo Y > /sys/kernel/debug/$FAILTYPE/task-filter
285283
echo 10 > /sys/kernel/debug/$FAILTYPE/probability
286284
echo 100 > /sys/kernel/debug/$FAILTYPE/interval
287-
printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times
285+
echo -1 > /sys/kernel/debug/$FAILTYPE/times
288286
echo 0 > /sys/kernel/debug/$FAILTYPE/space
289287
echo 2 > /sys/kernel/debug/$FAILTYPE/verbose
290288
echo Y > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
@@ -338,7 +336,7 @@ Application Examples
338336
echo N > /sys/kernel/debug/$FAILTYPE/task-filter
339337
echo 10 > /sys/kernel/debug/$FAILTYPE/probability
340338
echo 100 > /sys/kernel/debug/$FAILTYPE/interval
341-
printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times
339+
echo -1 > /sys/kernel/debug/$FAILTYPE/times
342340
echo 0 > /sys/kernel/debug/$FAILTYPE/space
343341
echo 2 > /sys/kernel/debug/$FAILTYPE/verbose
344342
echo Y > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
@@ -369,7 +367,7 @@ Application Examples
369367
echo N > /sys/kernel/debug/$FAILTYPE/task-filter
370368
echo 100 > /sys/kernel/debug/$FAILTYPE/probability
371369
echo 0 > /sys/kernel/debug/$FAILTYPE/interval
372-
printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times
370+
echo -1 > /sys/kernel/debug/$FAILTYPE/times
373371
echo 0 > /sys/kernel/debug/$FAILTYPE/space
374372
echo 1 > /sys/kernel/debug/$FAILTYPE/verbose
375373

Documentation/filesystems/proc.rst

+17
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fixes/update part 1.1 Stefani Seibold <stefani@seibold.net> June 9 2009
4747
3.10 /proc/<pid>/timerslack_ns - Task timerslack value
4848
3.11 /proc/<pid>/patch_state - Livepatch patch operation state
4949
3.12 /proc/<pid>/arch_status - Task architecture specific information
50+
3.13 /proc/<pid>/fd - List of symlinks to open files
5051
5152
4 Configuring procfs
5253
4.1 Mount options
@@ -2150,6 +2151,22 @@ AVX512_elapsed_ms
21502151
the task is unlikely an AVX512 user, but depends on the workload and the
21512152
scheduling scenario, it also could be a false negative mentioned above.
21522153

2154+
3.13 /proc/<pid>/fd - List of symlinks to open files
2155+
-------------------------------------------------------
2156+
This directory contains symbolic links which represent open files
2157+
the process is maintaining. Example output::
2158+
2159+
lr-x------ 1 root root 64 Sep 20 17:53 0 -> /dev/null
2160+
l-wx------ 1 root root 64 Sep 20 17:53 1 -> /dev/null
2161+
lrwx------ 1 root root 64 Sep 20 17:53 10 -> 'socket:[12539]'
2162+
lrwx------ 1 root root 64 Sep 20 17:53 11 -> 'socket:[12540]'
2163+
lrwx------ 1 root root 64 Sep 20 17:53 12 -> 'socket:[12542]'
2164+
2165+
The number of open files for the process is stored in 'size' member
2166+
of stat() output for /proc/<pid>/fd for fast access.
2167+
-------------------------------------------------------
2168+
2169+
21532170
Chapter 4: Configuring procfs
21542171
=============================
21552172

MAINTAINERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -12126,7 +12126,7 @@ M: Alexey Kodanev <alexey.kodanev@oracle.com>
1212612126
L: ltp@lists.linux.it (subscribers-only)
1212712127
S: Maintained
1212812128
W: http://linux-test-project.github.io/
12129-
T: git git://github.com/linux-test-project/ltp.git
12129+
T: git https://github.com/linux-test-project/ltp.git
1213012130

1213112131
LYNX 28G SERDES PHY DRIVER
1213212132
M: Ioana Ciornei <ioana.ciornei@nxp.com>

arch/arc/kernel/ptrace.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static int genregs_set(struct task_struct *target,
185185

186186
#define REG_IGNORE_ONE(LOC) \
187187
if (!ret) \
188-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \
188+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \
189189
offsetof(struct user_regs_struct, LOC), \
190190
offsetof(struct user_regs_struct, LOC) + 4);
191191

arch/arm/kernel/machine_kexec.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void machine_kexec_cleanup(struct kimage *image)
7373
{
7474
}
7575

76-
void machine_crash_nonpanic_core(void *unused)
76+
static void machine_crash_nonpanic_core(void *unused)
7777
{
7878
struct pt_regs regs;
7979

arch/arm/kernel/ptrace.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,9 @@ static int vfp_set(struct task_struct *target,
651651
if (ret)
652652
return ret;
653653

654-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
655-
user_fpregs_offset + sizeof(new_vfp.fpregs),
656-
user_fpscr_offset);
657-
if (ret)
658-
return ret;
654+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
655+
user_fpregs_offset + sizeof(new_vfp.fpregs),
656+
user_fpscr_offset);
659657

660658
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
661659
&new_vfp.fpscr,

arch/arm64/kernel/ptrace.c

+4-12
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,7 @@ static int hw_break_set(struct task_struct *target,
514514

515515
/* Resource info and pad */
516516
offset = offsetof(struct user_hwdebug_state, dbg_regs);
517-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset);
518-
if (ret)
519-
return ret;
517+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset);
520518

521519
/* (address, ctrl) registers */
522520
limit = regset->n * regset->size;
@@ -543,11 +541,8 @@ static int hw_break_set(struct task_struct *target,
543541
return ret;
544542
offset += PTRACE_HBP_CTRL_SZ;
545543

546-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
547-
offset,
548-
offset + PTRACE_HBP_PAD_SZ);
549-
if (ret)
550-
return ret;
544+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
545+
offset, offset + PTRACE_HBP_PAD_SZ);
551546
offset += PTRACE_HBP_PAD_SZ;
552547
idx++;
553548
}
@@ -955,10 +950,7 @@ static int sve_set_common(struct task_struct *target,
955950

956951
start = end;
957952
end = SVE_PT_SVE_FPSR_OFFSET(vq);
958-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
959-
start, end);
960-
if (ret)
961-
goto out;
953+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, start, end);
962954

963955
/*
964956
* Copy fpsr, and fpcr which must follow contiguously in

arch/hexagon/kernel/ptrace.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,9 @@ static int genregs_set(struct task_struct *target,
115115

116116
/* Ignore the rest, if needed */
117117
if (!ret)
118-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
119-
offsetof(struct user_regs_struct, pad1), -1);
120-
121-
if (ret)
118+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
119+
offsetof(struct user_regs_struct, pad1), -1);
120+
else
122121
return ret;
123122

124123
/*

arch/ia64/include/asm/io.h

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
#include <asm/unaligned.h>
2424
#include <asm/early_ioremap.h>
2525

26-
/* We don't use IO slowdowns on the ia64, but.. */
27-
#define __SLOW_DOWN_IO do { } while (0)
28-
#define SLOW_DOWN_IO do { } while (0)
29-
3026
#define __IA64_UNCACHED_OFFSET RGN_BASE(RGN_UNCACHED)
3127

3228
/*

arch/ia64/include/asm/kprobes.h

-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
110110
extern int kprobe_exceptions_notify(struct notifier_block *self,
111111
unsigned long val, void *data);
112112

113-
extern void invalidate_stacked_regs(void);
114-
extern void flush_register_stack(void);
115113
extern void arch_remove_kprobe(struct kprobe *p);
116114

117115
#endif /* CONFIG_KPROBES */

arch/ia64/kernel/ptrace.c

+9-11
Original file line numberDiff line numberDiff line change
@@ -1481,12 +1481,10 @@ static void do_gpregs_set(struct unw_frame_info *info, void *arg)
14811481
return;
14821482
/* Skip r0 */
14831483
if (dst->pos < ELF_GR_OFFSET(1)) {
1484-
dst->ret = user_regset_copyin_ignore(&dst->pos, &dst->count,
1485-
&dst->u.set.kbuf,
1486-
&dst->u.set.ubuf,
1487-
0, ELF_GR_OFFSET(1));
1488-
if (dst->ret)
1489-
return;
1484+
user_regset_copyin_ignore(&dst->pos, &dst->count,
1485+
&dst->u.set.kbuf, &dst->u.set.ubuf,
1486+
0, ELF_GR_OFFSET(1));
1487+
dst->ret = 0;
14901488
}
14911489

14921490
while (dst->count && dst->pos < ELF_AR_END_OFFSET) {
@@ -1560,11 +1558,11 @@ static void do_fpregs_set(struct unw_frame_info *info, void *arg)
15601558

15611559
/* Skip pos 0 and 1 */
15621560
if (dst->count > 0 && dst->pos < ELF_FP_OFFSET(2)) {
1563-
dst->ret = user_regset_copyin_ignore(&dst->pos, &dst->count,
1564-
&dst->u.set.kbuf,
1565-
&dst->u.set.ubuf,
1566-
0, ELF_FP_OFFSET(2));
1567-
if (dst->count == 0 || dst->ret)
1561+
user_regset_copyin_ignore(&dst->pos, &dst->count,
1562+
&dst->u.set.kbuf, &dst->u.set.ubuf,
1563+
0, ELF_FP_OFFSET(2));
1564+
dst->ret = 0;
1565+
if (dst->count == 0)
15681566
return;
15691567
}
15701568

arch/ia64/kernel/sys_ia64.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ asmlinkage unsigned long
140140
sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff)
141141
{
142142
addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
143-
if (!IS_ERR((void *) addr))
143+
if (!IS_ERR_VALUE(addr))
144144
force_successful_syscall_return();
145145
return addr;
146146
}
@@ -152,7 +152,7 @@ sys_mmap (unsigned long addr, unsigned long len, int prot, int flags, int fd, lo
152152
return -EINVAL;
153153

154154
addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
155-
if (!IS_ERR((void *) addr))
155+
if (!IS_ERR_VALUE(addr))
156156
force_successful_syscall_return();
157157
return addr;
158158
}
@@ -162,7 +162,7 @@ ia64_mremap (unsigned long addr, unsigned long old_len, unsigned long new_len, u
162162
unsigned long new_addr)
163163
{
164164
addr = sys_mremap(addr, old_len, new_len, flags, new_addr);
165-
if (!IS_ERR((void *) addr))
165+
if (!IS_ERR_VALUE(addr))
166166
force_successful_syscall_return();
167167
return addr;
168168
}

arch/mips/kernel/ptrace.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,11 @@ static int fpr_set(struct task_struct *target,
531531
ptrace_setfcr31(target, fcr31);
532532
}
533533

534-
if (count > 0)
535-
err = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
536-
fir_pos,
537-
fir_pos + sizeof(u32));
534+
if (count > 0) {
535+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
536+
fir_pos, fir_pos + sizeof(u32));
537+
return 0;
538+
}
538539

539540
return err;
540541
}

arch/nios2/kernel/ptrace.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static int genregs_set(struct task_struct *target,
5454

5555
#define REG_IGNORE_RANGE(START, END) \
5656
if (!ret) \
57-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \
57+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \
5858
START * 4, (END * 4) + 4);
5959

6060
#define REG_IN_ONE(PTR, LOC) \
@@ -80,8 +80,8 @@ static int genregs_set(struct task_struct *target,
8080
REG_IN_ONE(&regs->ra, PTR_RA);
8181
REG_IN_ONE(&regs->ea, PTR_PC); /* use ea for PC */
8282
if (!ret)
83-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
84-
PTR_STATUS * 4, -1);
83+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
84+
PTR_STATUS * 4, -1);
8585

8686
return ret;
8787
}

arch/openrisc/kernel/ptrace.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ static int genregs_set(struct task_struct *target,
6666
int ret;
6767

6868
/* ignore r0 */
69-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, 4);
69+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, 4);
7070
/* r1 - r31 */
71-
if (!ret)
72-
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
71+
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
7372
regs->gpr+1, 4, 4*32);
7473
/* PC */
7574
if (!ret)
@@ -80,8 +79,7 @@ static int genregs_set(struct task_struct *target,
8079
* the Supervision register
8180
*/
8281
if (!ret)
83-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
84-
4*33, -1);
82+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 4*33, -1);
8583

8684
return ret;
8785
}

arch/parisc/kernel/ptrace.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,9 @@ static int fpr_set(struct task_struct *target,
424424
ubuf = u;
425425
pos *= sizeof(reg);
426426
count *= sizeof(reg);
427-
return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
428-
ELF_NFPREG * sizeof(reg), -1);
427+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
428+
ELF_NFPREG * sizeof(reg), -1);
429+
return 0;
429430
}
430431

431432
#define RI(reg) (offsetof(struct user_regs_struct,reg) / sizeof(long))
@@ -543,8 +544,9 @@ static int gpr_set(struct task_struct *target,
543544
ubuf = u;
544545
pos *= sizeof(reg);
545546
count *= sizeof(reg);
546-
return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
547-
ELF_NGREG * sizeof(reg), -1);
547+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
548+
ELF_NGREG * sizeof(reg), -1);
549+
return 0;
548550
}
549551

550552
static const struct user_regset native_regsets[] = {
@@ -606,8 +608,9 @@ static int gpr32_set(struct task_struct *target,
606608
ubuf = u;
607609
pos *= sizeof(reg);
608610
count *= sizeof(reg);
609-
return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
610-
ELF_NGREG * sizeof(reg), -1);
611+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
612+
ELF_NGREG * sizeof(reg), -1);
613+
return 0;
611614
}
612615

613616
/*

arch/powerpc/kernel/ptrace/ptrace-tm.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset,
170170
(PT_MAX_PUT_REG + 1) * sizeof(reg));
171171

172172
if (PT_MAX_PUT_REG + 1 < PT_TRAP && !ret)
173-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
174-
(PT_MAX_PUT_REG + 1) * sizeof(reg),
175-
PT_TRAP * sizeof(reg));
173+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
174+
(PT_MAX_PUT_REG + 1) * sizeof(reg),
175+
PT_TRAP * sizeof(reg));
176176

177177
if (!ret && count > 0) {
178178
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &reg,
@@ -183,8 +183,8 @@ int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset,
183183
}
184184

185185
if (!ret)
186-
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
187-
(PT_TRAP + 1) * sizeof(reg), -1);
186+
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
187+
(PT_TRAP + 1) * sizeof(reg), -1);
188188

189189
return ret;
190190
}

0 commit comments

Comments
 (0)