Skip to content

Commit

Permalink
Merge tag 'mm-nonmm-stable-2022-12-12' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/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
  ...
  • Loading branch information
torvalds committed Dec 13, 2022
2 parents a7cacfb + 12b677f commit 8702f2c
Show file tree
Hide file tree
Showing 100 changed files with 750 additions and 302 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ Juha Yrjola <at solidboot.com>
Juha Yrjola <[email protected]>
Juha Yrjola <[email protected]>
Julien Thierry <[email protected]> <[email protected]>
Iskren Chernev <[email protected]> <[email protected]>
Kalle Valo <[email protected]> <[email protected]>
Kalyan Thota <[email protected]> <[email protected]>
Kay Sievers <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions Documentation/admin-guide/sysctl/kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ core_pattern
%f executable filename
%E executable path
%c maximum size of core file by resource limit RLIMIT_CORE
%C CPU the task ran on
%<OTHER> both are dropped
======== ==========================================

Expand Down
10 changes: 4 additions & 6 deletions Documentation/fault-injection/fault-injection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ configuration of fault-injection capabilities.
- /sys/kernel/debug/fail*/times:

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

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

Expand Down Expand Up @@ -284,7 +282,7 @@ Application Examples
echo Y > /sys/kernel/debug/$FAILTYPE/task-filter
echo 10 > /sys/kernel/debug/$FAILTYPE/probability
echo 100 > /sys/kernel/debug/$FAILTYPE/interval
printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times
echo -1 > /sys/kernel/debug/$FAILTYPE/times
echo 0 > /sys/kernel/debug/$FAILTYPE/space
echo 2 > /sys/kernel/debug/$FAILTYPE/verbose
echo Y > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
Expand Down Expand Up @@ -338,7 +336,7 @@ Application Examples
echo N > /sys/kernel/debug/$FAILTYPE/task-filter
echo 10 > /sys/kernel/debug/$FAILTYPE/probability
echo 100 > /sys/kernel/debug/$FAILTYPE/interval
printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times
echo -1 > /sys/kernel/debug/$FAILTYPE/times
echo 0 > /sys/kernel/debug/$FAILTYPE/space
echo 2 > /sys/kernel/debug/$FAILTYPE/verbose
echo Y > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
Expand Down Expand Up @@ -369,7 +367,7 @@ Application Examples
echo N > /sys/kernel/debug/$FAILTYPE/task-filter
echo 100 > /sys/kernel/debug/$FAILTYPE/probability
echo 0 > /sys/kernel/debug/$FAILTYPE/interval
printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times
echo -1 > /sys/kernel/debug/$FAILTYPE/times
echo 0 > /sys/kernel/debug/$FAILTYPE/space
echo 1 > /sys/kernel/debug/$FAILTYPE/verbose

Expand Down
17 changes: 17 additions & 0 deletions Documentation/filesystems/proc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fixes/update part 1.1 Stefani Seibold <[email protected]> June 9 2009
3.10 /proc/<pid>/timerslack_ns - Task timerslack value
3.11 /proc/<pid>/patch_state - Livepatch patch operation state
3.12 /proc/<pid>/arch_status - Task architecture specific information
3.13 /proc/<pid>/fd - List of symlinks to open files
4 Configuring procfs
4.1 Mount options
Expand Down Expand Up @@ -2150,6 +2151,22 @@ AVX512_elapsed_ms
the task is unlikely an AVX512 user, but depends on the workload and the
scheduling scenario, it also could be a false negative mentioned above.

3.13 /proc/<pid>/fd - List of symlinks to open files
-------------------------------------------------------
This directory contains symbolic links which represent open files
the process is maintaining. Example output::

lr-x------ 1 root root 64 Sep 20 17:53 0 -> /dev/null
l-wx------ 1 root root 64 Sep 20 17:53 1 -> /dev/null
lrwx------ 1 root root 64 Sep 20 17:53 10 -> 'socket:[12539]'
lrwx------ 1 root root 64 Sep 20 17:53 11 -> 'socket:[12540]'
lrwx------ 1 root root 64 Sep 20 17:53 12 -> 'socket:[12542]'

The number of open files for the process is stored in 'size' member
of stat() output for /proc/<pid>/fd for fast access.
-------------------------------------------------------


Chapter 4: Configuring procfs
=============================

Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -12126,7 +12126,7 @@ M: Alexey Kodanev <[email protected]>
L: [email protected] (subscribers-only)
S: Maintained
W: http://linux-test-project.github.io/
T: git git://github.com/linux-test-project/ltp.git
T: git https://github.com/linux-test-project/ltp.git

LYNX 28G SERDES PHY DRIVER
M: Ioana Ciornei <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static int genregs_set(struct task_struct *target,

#define REG_IGNORE_ONE(LOC) \
if (!ret) \
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \
offsetof(struct user_regs_struct, LOC), \
offsetof(struct user_regs_struct, LOC) + 4);

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void machine_kexec_cleanup(struct kimage *image)
{
}

void machine_crash_nonpanic_core(void *unused)
static void machine_crash_nonpanic_core(void *unused)
{
struct pt_regs regs;

Expand Down
8 changes: 3 additions & 5 deletions arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,9 @@ static int vfp_set(struct task_struct *target,
if (ret)
return ret;

ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
user_fpregs_offset + sizeof(new_vfp.fpregs),
user_fpscr_offset);
if (ret)
return ret;
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
user_fpregs_offset + sizeof(new_vfp.fpregs),
user_fpscr_offset);

ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&new_vfp.fpscr,
Expand Down
16 changes: 4 additions & 12 deletions arch/arm64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,7 @@ static int hw_break_set(struct task_struct *target,

/* Resource info and pad */
offset = offsetof(struct user_hwdebug_state, dbg_regs);
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset);
if (ret)
return ret;
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, offset);

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

ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
offset,
offset + PTRACE_HBP_PAD_SZ);
if (ret)
return ret;
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
offset, offset + PTRACE_HBP_PAD_SZ);
offset += PTRACE_HBP_PAD_SZ;
idx++;
}
Expand Down Expand Up @@ -955,10 +950,7 @@ static int sve_set_common(struct task_struct *target,

start = end;
end = SVE_PT_SVE_FPSR_OFFSET(vq);
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
start, end);
if (ret)
goto out;
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, start, end);

/*
* Copy fpsr, and fpcr which must follow contiguously in
Expand Down
7 changes: 3 additions & 4 deletions arch/hexagon/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,9 @@ static int genregs_set(struct task_struct *target,

/* Ignore the rest, if needed */
if (!ret)
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
offsetof(struct user_regs_struct, pad1), -1);

if (ret)
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
offsetof(struct user_regs_struct, pad1), -1);
else
return ret;

/*
Expand Down
4 changes: 0 additions & 4 deletions arch/ia64/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#include <asm/unaligned.h>
#include <asm/early_ioremap.h>

/* We don't use IO slowdowns on the ia64, but.. */
#define __SLOW_DOWN_IO do { } while (0)
#define SLOW_DOWN_IO do { } while (0)

#define __IA64_UNCACHED_OFFSET RGN_BASE(RGN_UNCACHED)

/*
Expand Down
2 changes: 0 additions & 2 deletions arch/ia64/include/asm/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
extern int kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data);

extern void invalidate_stacked_regs(void);
extern void flush_register_stack(void);
extern void arch_remove_kprobe(struct kprobe *p);

#endif /* CONFIG_KPROBES */
Expand Down
20 changes: 9 additions & 11 deletions arch/ia64/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1481,12 +1481,10 @@ static void do_gpregs_set(struct unw_frame_info *info, void *arg)
return;
/* Skip r0 */
if (dst->pos < ELF_GR_OFFSET(1)) {
dst->ret = user_regset_copyin_ignore(&dst->pos, &dst->count,
&dst->u.set.kbuf,
&dst->u.set.ubuf,
0, ELF_GR_OFFSET(1));
if (dst->ret)
return;
user_regset_copyin_ignore(&dst->pos, &dst->count,
&dst->u.set.kbuf, &dst->u.set.ubuf,
0, ELF_GR_OFFSET(1));
dst->ret = 0;
}

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

/* Skip pos 0 and 1 */
if (dst->count > 0 && dst->pos < ELF_FP_OFFSET(2)) {
dst->ret = user_regset_copyin_ignore(&dst->pos, &dst->count,
&dst->u.set.kbuf,
&dst->u.set.ubuf,
0, ELF_FP_OFFSET(2));
if (dst->count == 0 || dst->ret)
user_regset_copyin_ignore(&dst->pos, &dst->count,
&dst->u.set.kbuf, &dst->u.set.ubuf,
0, ELF_FP_OFFSET(2));
dst->ret = 0;
if (dst->count == 0)
return;
}

Expand Down
6 changes: 3 additions & 3 deletions arch/ia64/kernel/sys_ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ asmlinkage unsigned long
sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff)
{
addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
if (!IS_ERR((void *) addr))
if (!IS_ERR_VALUE(addr))
force_successful_syscall_return();
return addr;
}
Expand All @@ -152,7 +152,7 @@ sys_mmap (unsigned long addr, unsigned long len, int prot, int flags, int fd, lo
return -EINVAL;

addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
if (!IS_ERR((void *) addr))
if (!IS_ERR_VALUE(addr))
force_successful_syscall_return();
return addr;
}
Expand All @@ -162,7 +162,7 @@ ia64_mremap (unsigned long addr, unsigned long old_len, unsigned long new_len, u
unsigned long new_addr)
{
addr = sys_mremap(addr, old_len, new_len, flags, new_addr);
if (!IS_ERR((void *) addr))
if (!IS_ERR_VALUE(addr))
force_successful_syscall_return();
return addr;
}
Expand Down
9 changes: 5 additions & 4 deletions arch/mips/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,11 @@ static int fpr_set(struct task_struct *target,
ptrace_setfcr31(target, fcr31);
}

if (count > 0)
err = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
fir_pos,
fir_pos + sizeof(u32));
if (count > 0) {
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
fir_pos, fir_pos + sizeof(u32));
return 0;
}

return err;
}
Expand Down
6 changes: 3 additions & 3 deletions arch/nios2/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static int genregs_set(struct task_struct *target,

#define REG_IGNORE_RANGE(START, END) \
if (!ret) \
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, \
START * 4, (END * 4) + 4);

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

return ret;
}
Expand Down
8 changes: 3 additions & 5 deletions arch/openrisc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ static int genregs_set(struct task_struct *target,
int ret;

/* ignore r0 */
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, 4);
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, 4);
/* r1 - r31 */
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
regs->gpr+1, 4, 4*32);
/* PC */
if (!ret)
Expand All @@ -80,8 +79,7 @@ static int genregs_set(struct task_struct *target,
* the Supervision register
*/
if (!ret)
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
4*33, -1);
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 4*33, -1);

return ret;
}
Expand Down
15 changes: 9 additions & 6 deletions arch/parisc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,9 @@ static int fpr_set(struct task_struct *target,
ubuf = u;
pos *= sizeof(reg);
count *= sizeof(reg);
return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
ELF_NFPREG * sizeof(reg), -1);
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
ELF_NFPREG * sizeof(reg), -1);
return 0;
}

#define RI(reg) (offsetof(struct user_regs_struct,reg) / sizeof(long))
Expand Down Expand Up @@ -543,8 +544,9 @@ static int gpr_set(struct task_struct *target,
ubuf = u;
pos *= sizeof(reg);
count *= sizeof(reg);
return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
ELF_NGREG * sizeof(reg), -1);
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
ELF_NGREG * sizeof(reg), -1);
return 0;
}

static const struct user_regset native_regsets[] = {
Expand Down Expand Up @@ -606,8 +608,9 @@ static int gpr32_set(struct task_struct *target,
ubuf = u;
pos *= sizeof(reg);
count *= sizeof(reg);
return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
ELF_NGREG * sizeof(reg), -1);
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
ELF_NGREG * sizeof(reg), -1);
return 0;
}

/*
Expand Down
10 changes: 5 additions & 5 deletions arch/powerpc/kernel/ptrace/ptrace-tm.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset,
(PT_MAX_PUT_REG + 1) * sizeof(reg));

if (PT_MAX_PUT_REG + 1 < PT_TRAP && !ret)
ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
(PT_MAX_PUT_REG + 1) * sizeof(reg),
PT_TRAP * sizeof(reg));
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
(PT_MAX_PUT_REG + 1) * sizeof(reg),
PT_TRAP * sizeof(reg));

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

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

return ret;
}
Expand Down
Loading

0 comments on commit 8702f2c

Please sign in to comment.