Skip to content

Commit

Permalink
Merge tag 'mm-hotfixes-stable-2023-05-03-16-27' of git://git.kernel.o…
Browse files Browse the repository at this point in the history
…rg/pub/scm/linux/kernel/git/akpm/mm

Pull hitfixes from Andrew Morton:
 "Five hotfixes.  Three are cc:stable, two for this -rc cycle"

* tag 'mm-hotfixes-stable-2023-05-03-16-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  mm: change per-VMA lock statistics to be disabled by default
  MAINTAINERS: update Michal Simek's email
  mm/mempolicy: correctly update prev when policy is equal on mbind
  relayfs: fix out-of-bounds access in relay_file_read
  kasan: hw_tags: avoid invalid virt_to_page()
  • Loading branch information
torvalds committed May 4, 2023
2 parents 15fb96a + 6152e53 commit a1fd058
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ Maxime Ripard <[email protected]> <[email protected]>
Maxime Ripard <[email protected]> <[email protected]>
Mayuresh Janorkar <[email protected]>
Michael Buesch <[email protected]>
Michal Simek <[email protected]> <[email protected]>
Michel Dänzer <[email protected]>
Michel Lespinasse <[email protected]>
Michel Lespinasse <[email protected]> <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3039,7 +3039,7 @@ F: drivers/video/fbdev/wm8505fb*
F: drivers/video/fbdev/wmt_ge_rops.*

ARM/ZYNQ ARCHITECTURE
M: Michal Simek <michal.simek@xilinx.com>
M: Michal Simek <michal.simek@amd.com>
L: [email protected] (moderated for non-subscribers)
S: Supported
W: http://wiki.xilinx.com
Expand Down Expand Up @@ -23129,7 +23129,7 @@ F: drivers/net/can/xilinx_can.c
XILINX GPIO DRIVER
M: Shubhrajyoti Datta <[email protected]>
R: Srinivas Neeli <[email protected]>
R: Michal Simek <michal.simek@xilinx.com>
R: Michal Simek <michal.simek@amd.com>
S: Maintained
F: Documentation/devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml
F: Documentation/devicetree/bindings/gpio/gpio-zynq.yaml
Expand Down
3 changes: 2 additions & 1 deletion kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,8 @@ static size_t relay_file_read_start_pos(struct rchan_buf *buf)
size_t subbuf_size = buf->chan->subbuf_size;
size_t n_subbufs = buf->chan->n_subbufs;
size_t consumed = buf->subbufs_consumed % n_subbufs;
size_t read_pos = consumed * subbuf_size + buf->bytes_consumed;
size_t read_pos = (consumed * subbuf_size + buf->bytes_consumed)
% (n_subbufs * subbuf_size);

read_subbuf = read_pos / subbuf_size;
padding = buf->padding[read_subbuf];
Expand Down
10 changes: 8 additions & 2 deletions mm/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ config DEBUG_KMEMLEAK_AUTO_SCAN
config PER_VMA_LOCK_STATS
bool "Statistics for per-vma locks"
depends on PER_VMA_LOCK
default y
help
Statistics for per-vma locks.
Say Y here to enable success, retry and failure counters of page
faults handled under protection of per-vma locks. When enabled, the
counters are exposed in /proc/vmstat. This information is useful for
kernel developers to evaluate effectiveness of per-vma locks and to
identify pathological cases. Counting these events introduces a small
overhead in the page fault path.

If in doubt, say N.
4 changes: 2 additions & 2 deletions mm/kasan/hw_tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static void init_vmalloc_pages(const void *start, unsigned long size)
const void *addr;

for (addr = start; addr < start + size; addr += PAGE_SIZE) {
struct page *page = virt_to_page(addr);
struct page *page = vmalloc_to_page(addr);

clear_highpage_kasan_tagged(page);
}
Expand All @@ -297,7 +297,7 @@ void *__kasan_unpoison_vmalloc(const void *start, unsigned long size,
u8 tag;
unsigned long redzone_start, redzone_size;

if (!kasan_vmalloc_enabled() || !is_vmalloc_or_module_addr(start)) {
if (!kasan_vmalloc_enabled()) {
if (flags & KASAN_VMALLOC_INIT)
init_vmalloc_pages(start, size);
return (void *)start;
Expand Down
4 changes: 3 additions & 1 deletion mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,10 @@ static int mbind_range(struct vma_iterator *vmi, struct vm_area_struct *vma,
vmstart = vma->vm_start;
}

if (mpol_equal(vma_policy(vma), new_pol))
if (mpol_equal(vma_policy(vma), new_pol)) {
*prev = vma;
return 0;
}

pgoff = vma->vm_pgoff + ((vmstart - vma->vm_start) >> PAGE_SHIFT);
merged = vma_merge(vmi, vma->vm_mm, *prev, vmstart, vmend, vma->vm_flags,
Expand Down

0 comments on commit a1fd058

Please sign in to comment.