Skip to content

Commit 6f66404

Browse files
committed
Merge tag 'mm-nonmm-stable-2022-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc updates from Andrew Morton: "The non-MM patch queue for this merge window. Not a lot of material this cycle. Many singleton patches against various subsystems. Most notably some maintenance work in ocfs2 and initramfs" * tag 'mm-nonmm-stable-2022-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (65 commits) kcov: update pos before writing pc in trace function ocfs2: dlmfs: fix error handling of user_dlm_destroy_lock ocfs2: dlmfs: don't clear USER_LOCK_ATTACHED when destroying lock fs/ntfs: remove redundant variable idx fat: remove time truncations in vfat_create/vfat_mkdir fat: report creation time in statx fat: ignore ctime updates, and keep ctime identical to mtime in memory fat: split fat_truncate_time() into separate functions MAINTAINERS: add Muchun as a memcg reviewer proc/sysctl: make protected_* world readable ia64: mca: drop redundant spinlock initialization tty: fix deadlock caused by calling printk() under tty_port->lock relay: remove redundant assignment to pointer buf fs/ntfs3: validate BOOT sectors_per_clusters lib/string_helpers: fix not adding strarray to device's resource list kernel/crash_core.c: remove redundant check of ck_cmdline ELF, uapi: fixup ELF_ST_TYPE definition ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() ipc: update semtimedop() to use hrtimer ipc/sem: remove redundant assignments ...
2 parents 8bdc2a1 + 3159d79 commit 6f66404

83 files changed

Lines changed: 1181 additions & 706 deletions

Some content is hidden

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

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5056,6 +5056,7 @@ M: Johannes Weiner <hannes@cmpxchg.org>
50565056
M: Michal Hocko <mhocko@kernel.org>
50575057
M: Roman Gushchin <roman.gushchin@linux.dev>
50585058
M: Shakeel Butt <shakeelb@google.com>
5059+
R: Muchun Song <songmuchun@bytedance.com>
50595060
L: cgroups@vger.kernel.org
50605061
L: linux-mm@kvack.org
50615062
S: Maintained
@@ -16097,7 +16098,6 @@ F: include/asm-generic/syscall.h
1609716098
F: include/linux/ptrace.h
1609816099
F: include/linux/regset.h
1609916100
F: include/uapi/linux/ptrace.h
16100-
F: include/uapi/linux/ptrace.h
1610116101
F: kernel/ptrace.c
1610216102

1610316103
PULSE8-CEC DRIVER

arch/alpha/lib/csum_partial_copy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ csum_and_copy_from_user(const void __user *src, void *dst, int len)
353353
return 0;
354354
return __csum_and_copy(src, dst, len);
355355
}
356-
EXPORT_SYMBOL(csum_and_copy_from_user);
357356

358357
__wsum
359358
csum_partial_copy_nocheck(const void *src, void *dst, int len)

arch/arm/kernel/crash_dump.c

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,10 @@
1414
#include <linux/crash_dump.h>
1515
#include <linux/uaccess.h>
1616
#include <linux/io.h>
17+
#include <linux/uio.h>
1718

18-
/**
19-
* copy_oldmem_page() - copy one page from old kernel memory
20-
* @pfn: page frame number to be copied
21-
* @buf: buffer where the copied page is placed
22-
* @csize: number of bytes to copy
23-
* @offset: offset in bytes into the page
24-
* @userbuf: if set, @buf is int he user address space
25-
*
26-
* This function copies one page from old kernel memory into buffer pointed by
27-
* @buf. If @buf is in userspace, set @userbuf to %1. Returns number of bytes
28-
* copied or negative error in case of failure.
29-
*/
30-
ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
31-
size_t csize, unsigned long offset,
32-
int userbuf)
19+
ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
20+
size_t csize, unsigned long offset)
3321
{
3422
void *vaddr;
3523

@@ -40,14 +28,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
4028
if (!vaddr)
4129
return -ENOMEM;
4230

43-
if (userbuf) {
44-
if (copy_to_user(buf, vaddr + offset, csize)) {
45-
iounmap(vaddr);
46-
return -EFAULT;
47-
}
48-
} else {
49-
memcpy(buf, vaddr + offset, csize);
50-
}
31+
csize = copy_to_iter(vaddr + offset, csize, iter);
5132

5233
iounmap(vaddr);
5334
return csize;

arch/arm64/kernel/crash_dump.c

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,11 @@
99
#include <linux/crash_dump.h>
1010
#include <linux/errno.h>
1111
#include <linux/io.h>
12-
#include <linux/memblock.h>
13-
#include <linux/uaccess.h>
12+
#include <linux/uio.h>
1413
#include <asm/memory.h>
1514

16-
/**
17-
* copy_oldmem_page() - copy one page from old kernel memory
18-
* @pfn: page frame number to be copied
19-
* @buf: buffer where the copied page is placed
20-
* @csize: number of bytes to copy
21-
* @offset: offset in bytes into the page
22-
* @userbuf: if set, @buf is in a user address space
23-
*
24-
* This function copies one page from old kernel memory into buffer pointed by
25-
* @buf. If @buf is in userspace, set @userbuf to %1. Returns number of bytes
26-
* copied or negative error in case of failure.
27-
*/
28-
ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
29-
size_t csize, unsigned long offset,
30-
int userbuf)
15+
ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
16+
size_t csize, unsigned long offset)
3117
{
3218
void *vaddr;
3319

@@ -38,14 +24,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
3824
if (!vaddr)
3925
return -ENOMEM;
4026

41-
if (userbuf) {
42-
if (copy_to_user((char __user *)buf, vaddr + offset, csize)) {
43-
memunmap(vaddr);
44-
return -EFAULT;
45-
}
46-
} else {
47-
memcpy(buf, vaddr + offset, csize);
48-
}
27+
csize = copy_to_iter(vaddr + offset, csize, iter);
4928

5029
memunmap(vaddr);
5130

arch/ia64/kernel/crash_dump.c

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,18 @@
1010
#include <linux/errno.h>
1111
#include <linux/types.h>
1212
#include <linux/crash_dump.h>
13-
13+
#include <linux/uio.h>
1414
#include <asm/page.h>
15-
#include <linux/uaccess.h>
1615

17-
/**
18-
* copy_oldmem_page - copy one page from "oldmem"
19-
* @pfn: page frame number to be copied
20-
* @buf: target memory address for the copy; this can be in kernel address
21-
* space or user address space (see @userbuf)
22-
* @csize: number of bytes to copy
23-
* @offset: offset in bytes into the page (based on pfn) to begin the copy
24-
* @userbuf: if set, @buf is in user address space, use copy_to_user(),
25-
* otherwise @buf is in kernel address space, use memcpy().
26-
*
27-
* Copy a page from "oldmem". For this page, there is no pte mapped
28-
* in the current kernel. We stitch up a pte, similar to kmap_atomic.
29-
*
30-
* Calling copy_to_user() in atomic context is not desirable. Hence first
31-
* copying the data to a pre-allocated kernel page and then copying to user
32-
* space in non-atomic context.
33-
*/
34-
ssize_t
35-
copy_oldmem_page(unsigned long pfn, char *buf,
36-
size_t csize, unsigned long offset, int userbuf)
16+
ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
17+
size_t csize, unsigned long offset)
3718
{
3819
void *vaddr;
3920

4021
if (!csize)
4122
return 0;
4223
vaddr = __va(pfn<<PAGE_SHIFT);
43-
if (userbuf) {
44-
if (copy_to_user(buf, (vaddr + offset), csize)) {
45-
return -EFAULT;
46-
}
47-
} else
48-
memcpy(buf, (vaddr + offset), csize);
24+
csize = copy_to_iter(vaddr + offset, csize, iter);
4925
return csize;
5026
}
5127

arch/ia64/kernel/kprobes.c

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,38 @@ struct kretprobe_blackpoint kretprobe_blacklist[] = {{NULL, NULL}};
2929

3030
enum instruction_type {A, I, M, F, B, L, X, u};
3131
static enum instruction_type bundle_encoding[32][3] = {
32-
{ M, I, I }, /* 00 */
33-
{ M, I, I }, /* 01 */
34-
{ M, I, I }, /* 02 */
35-
{ M, I, I }, /* 03 */
36-
{ M, L, X }, /* 04 */
37-
{ M, L, X }, /* 05 */
38-
{ u, u, u }, /* 06 */
39-
{ u, u, u }, /* 07 */
40-
{ M, M, I }, /* 08 */
41-
{ M, M, I }, /* 09 */
42-
{ M, M, I }, /* 0A */
43-
{ M, M, I }, /* 0B */
44-
{ M, F, I }, /* 0C */
45-
{ M, F, I }, /* 0D */
46-
{ M, M, F }, /* 0E */
47-
{ M, M, F }, /* 0F */
48-
{ M, I, B }, /* 10 */
49-
{ M, I, B }, /* 11 */
50-
{ M, B, B }, /* 12 */
51-
{ M, B, B }, /* 13 */
52-
{ u, u, u }, /* 14 */
53-
{ u, u, u }, /* 15 */
54-
{ B, B, B }, /* 16 */
55-
{ B, B, B }, /* 17 */
56-
{ M, M, B }, /* 18 */
57-
{ M, M, B }, /* 19 */
58-
{ u, u, u }, /* 1A */
59-
{ u, u, u }, /* 1B */
60-
{ M, F, B }, /* 1C */
61-
{ M, F, B }, /* 1D */
62-
{ u, u, u }, /* 1E */
63-
{ u, u, u }, /* 1F */
32+
[0x00] = { M, I, I },
33+
[0x01] = { M, I, I },
34+
[0x02] = { M, I, I },
35+
[0x03] = { M, I, I },
36+
[0x04] = { M, L, X },
37+
[0x05] = { M, L, X },
38+
[0x06] = { u, u, u },
39+
[0x07] = { u, u, u },
40+
[0x08] = { M, M, I },
41+
[0x09] = { M, M, I },
42+
[0x0A] = { M, M, I },
43+
[0x0B] = { M, M, I },
44+
[0x0C] = { M, F, I },
45+
[0x0D] = { M, F, I },
46+
[0x0E] = { M, M, F },
47+
[0x0F] = { M, M, F },
48+
[0x10] = { M, I, B },
49+
[0x11] = { M, I, B },
50+
[0x12] = { M, B, B },
51+
[0x13] = { M, B, B },
52+
[0x14] = { u, u, u },
53+
[0x15] = { u, u, u },
54+
[0x16] = { B, B, B },
55+
[0x17] = { B, B, B },
56+
[0x18] = { M, M, B },
57+
[0x19] = { M, M, B },
58+
[0x1A] = { u, u, u },
59+
[0x1B] = { u, u, u },
60+
[0x1C] = { M, F, B },
61+
[0x1D] = { M, F, B },
62+
[0x1E] = { u, u, u },
63+
[0x1F] = { u, u, u },
6464
};
6565

6666
/* Insert a long branch code */

arch/ia64/kernel/mca.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ static void ia64_mlogbuf_finish(int wait)
290290
{
291291
BREAK_LOGLEVEL(console_loglevel);
292292

293-
spin_lock_init(&mlogbuf_rlock);
294293
ia64_mlogbuf_dump();
295294
printk(KERN_EMERG "mlogbuf_finish: printing switched to urgent mode, "
296295
"MCA/INIT might be dodgy or fail.\n");

arch/ia64/kernel/palinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static const char *mem_attrib[]={
120120
* Input:
121121
* - a pointer to a buffer to hold the string
122122
* - a 64-bit vector
123-
* Ouput:
123+
* Output:
124124
* - a pointer to the end of the buffer
125125
*
126126
*/

arch/ia64/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ static void syscall_get_args_cb(struct unw_frame_info *info, void *data)
20252025
* - epsinstruction: cfm is set by br.call
20262026
* locals don't exist.
20272027
*
2028-
* For both cases argguments are reachable in cfm.sof - cfm.sol.
2028+
* For both cases arguments are reachable in cfm.sof - cfm.sol.
20292029
* CFM: [ ... | sor: 17..14 | sol : 13..7 | sof : 6..0 ]
20302030
*/
20312031
cfm = pt->cr_ifs;

arch/ia64/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
309309
/*
310310
* Lower 4 bits are used as a count. Upper bits are a sequence
311311
* number that is updated when count is reset. The cmpxchg will
312-
* fail is seqno has changed. This minimizes mutiple cpus
312+
* fail is seqno has changed. This minimizes multiple cpus
313313
* resetting the count.
314314
*/
315315
if (current_jiffies > last.time)

0 commit comments

Comments
 (0)