Skip to content

Commit

Permalink
Merge tag 'mm-hotfixes-stable-2023-07-08-10-43' 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 hotfixes from Andrew Morton:
 "16 hotfixes. Six are cc:stable and the remainder address post-6.4
  issues"

The merge undoes the disabling of the CONFIG_PER_VMA_LOCK feature, since
it was all hopefully fixed in mainline.

* tag 'mm-hotfixes-stable-2023-07-08-10-43' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  lib: dhry: fix sleeping allocations inside non-preemptable section
  kasan, slub: fix HW_TAGS zeroing with slub_debug
  kasan: fix type cast in memory_is_poisoned_n
  mailmap: add entries for Heiko Stuebner
  mailmap: update manpage link
  bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page
  MAINTAINERS: add linux-next info
  mailmap: add Markus Schneider-Pargmann
  writeback: account the number of pages written back
  mm: call arch_swap_restore() from do_swap_page()
  squashfs: fix cache race with migration
  mm/hugetlb.c: fix a bug within a BUG(): inconsistent pte comparison
  docs: update ocfs2-devel mailing list address
  MAINTAINERS: update ocfs2-devel mailing list address
  mm: disable CONFIG_PER_VMA_LOCK until its fixed
  fork: lock VMAs of the parent process when forking
  • Loading branch information
torvalds committed Jul 8, 2023
2 parents fb49c45 + 8ba388c commit 946c6b5
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 44 deletions.
7 changes: 6 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# same person appearing not to be so or badly displayed. Also allows for
# old email addresses to map to new email addresses.
#
# For format details, see "MAPPING AUTHORS" in "man git-shortlog".
# For format details, see "man gitmailmap" or "MAPPING AUTHORS" in
# "man git-shortlog" on older systems.
#
# Please keep this list dictionary sorted.
#
Expand Down Expand Up @@ -177,6 +178,9 @@ Gustavo Padovan <[email protected]>
Hanjun Guo <[email protected]> <[email protected]>
Heiko Carstens <[email protected]> <[email protected]>
Heiko Carstens <[email protected]> <[email protected]>
Heiko Stuebner <[email protected]> <[email protected]>
Heiko Stuebner <[email protected]> <[email protected]>
Heiko Stuebner <[email protected]> <[email protected]>
Henk Vergonet <[email protected]>
Henrik Kretzschmar <[email protected]>
Henrik Rydberg <[email protected]>
Expand Down Expand Up @@ -305,6 +309,7 @@ Marek Behún <[email protected]> <[email protected]>
Marek Behún <[email protected]> Marek Behun <[email protected]>
Mark Brown <[email protected]>
Mark Starovoytov <[email protected]> <[email protected]>
Markus Schneider-Pargmann <[email protected]> <[email protected]>
Mark Yao <[email protected]> <[email protected]>
Martin Kepplinger <[email protected]> <[email protected]>
Martin Kepplinger <[email protected]> <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions Documentation/ABI/obsolete/o2cb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
What: /sys/o2cb
Date: Dec 2005
KernelVersion: 2.6.16
Contact: ocfs2-devel@oss.oracle.com
Contact: ocfs2-devel@lists.linux.dev
Description: Ocfs2-tools looks at 'interface-revision' for versioning
information. Each logmask/ file controls a set of debug prints
and can be written into with the strings "allow", "deny", or
"off". Reading the file returns the current state.
Was renamed to /sys/fs/u2cb/
Users: ocfs2-tools. It's sufficient to mail proposed changes to
ocfs2-devel@oss.oracle.com.
ocfs2-devel@lists.linux.dev.
4 changes: 2 additions & 2 deletions Documentation/ABI/removed/o2cb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
What: /sys/o2cb symlink
Date: May 2011
KernelVersion: 3.0
Contact: ocfs2-devel@oss.oracle.com
Contact: ocfs2-devel@lists.linux.dev
Description: This is a symlink: /sys/o2cb to /sys/fs/o2cb. The symlink is
removed when new versions of ocfs2-tools which know to look
in /sys/fs/o2cb are sufficiently prevalent. Don't code new
software to look here, it should try /sys/fs/o2cb instead.
Users: ocfs2-tools. It's sufficient to mail proposed changes to
ocfs2-devel@oss.oracle.com.
ocfs2-devel@lists.linux.dev.
4 changes: 2 additions & 2 deletions Documentation/ABI/stable/o2cb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
What: /sys/fs/o2cb/
Date: Dec 2005
KernelVersion: 2.6.16
Contact: ocfs2-devel@oss.oracle.com
Contact: ocfs2-devel@lists.linux.dev
Description: Ocfs2-tools looks at 'interface-revision' for versioning
information. Each logmask/ file controls a set of debug prints
and can be written into with the strings "allow", "deny", or
"off". Reading the file returns the current state.
Users: ocfs2-tools. It's sufficient to mail proposed changes to
ocfs2-devel@oss.oracle.com.
ocfs2-devel@lists.linux.dev.
12 changes: 6 additions & 6 deletions Documentation/ABI/testing/sysfs-ocfs2
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
What: /sys/fs/ocfs2/
Date: April 2008
Contact: ocfs2-devel@oss.oracle.com
Contact: ocfs2-devel@lists.linux.dev
Description:
The /sys/fs/ocfs2 directory contains knobs used by the
ocfs2-tools to interact with the filesystem.

What: /sys/fs/ocfs2/max_locking_protocol
Date: April 2008
Contact: ocfs2-devel@oss.oracle.com
Contact: ocfs2-devel@lists.linux.dev
Description:
The /sys/fs/ocfs2/max_locking_protocol file displays version
of ocfs2 locking supported by the filesystem. This version
Expand All @@ -28,7 +28,7 @@ Description:

What: /sys/fs/ocfs2/loaded_cluster_plugins
Date: April 2008
Contact: ocfs2-devel@oss.oracle.com
Contact: ocfs2-devel@lists.linux.dev
Description:
The /sys/fs/ocfs2/loaded_cluster_plugins file describes
the available plugins to support ocfs2 cluster operation.
Expand All @@ -48,7 +48,7 @@ Description:

What: /sys/fs/ocfs2/active_cluster_plugin
Date: April 2008
Contact: ocfs2-devel@oss.oracle.com
Contact: ocfs2-devel@lists.linux.dev
Description:
The /sys/fs/ocfs2/active_cluster_plugin displays which
cluster plugin is currently in use by the filesystem.
Expand All @@ -65,7 +65,7 @@ Description:

What: /sys/fs/ocfs2/cluster_stack
Date: April 2008
Contact: ocfs2-devel@oss.oracle.com
Contact: ocfs2-devel@lists.linux.dev
Description:
The /sys/fs/ocfs2/cluster_stack file contains the name
of current ocfs2 cluster stack. This value is set by
Expand All @@ -86,4 +86,4 @@ Description:
stack return an error.

Users:
ocfs2-tools <ocfs2-tools-devel@oss.oracle.com>
ocfs2-tools <ocfs2-tools-devel@lists.linux.dev>
2 changes: 1 addition & 1 deletion Documentation/filesystems/dlmfs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dlmfs is built with OCFS2 as it requires most of its infrastructure.

:Project web page: http://ocfs2.wiki.kernel.org
:Tools web page: https://github.com/markfasheh/ocfs2-tools
:OCFS2 mailing lists: https://oss.oracle.com/projects/ocfs2/mailman/
:OCFS2 mailing lists: https://subspace.kernel.org/lists.linux.dev.html

All code copyright 2005 Oracle except when otherwise noted.

Expand Down
2 changes: 1 addition & 1 deletion Documentation/filesystems/ocfs2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ get "mount.ocfs2" and "ocfs2_hb_ctl".

Project web page: http://ocfs2.wiki.kernel.org
Tools git tree: https://github.com/markfasheh/ocfs2-tools
OCFS2 mailing lists: https://oss.oracle.com/projects/ocfs2/mailman/
OCFS2 mailing lists: https://subspace.kernel.org/lists.linux.dev.html

All code copyright 2005 Oracle except when otherwise noted.

Expand Down
9 changes: 8 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -12069,6 +12069,13 @@ F: Documentation/litmus-tests/
F: Documentation/memory-barriers.txt
F: tools/memory-model/

LINUX-NEXT TREE
M: Stephen Rothwell <[email protected]>
L: [email protected]
S: Supported
B: mailto:[email protected] and the appropriate development tree
T: git git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/

LIS3LV02D ACCELEROMETER DRIVER
M: Eric Piel <[email protected]>
S: Maintained
Expand Down Expand Up @@ -15894,7 +15901,7 @@ ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
M: Mark Fasheh <[email protected]>
M: Joel Becker <[email protected]>
M: Joseph Qi <[email protected]>
L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
L: ocfs2-devel@lists.linux.dev
S: Supported
W: http://ocfs2.wiki.kernel.org
F: Documentation/filesystems/dlmfs.rst
Expand Down
6 changes: 3 additions & 3 deletions fs/ocfs2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ config OCFS2_FS
You'll want to install the ocfs2-tools package in order to at least
get "mount.ocfs2".

Project web page: https://oss.oracle.com/projects/ocfs2
Tools web page: https://oss.oracle.com/projects/ocfs2-tools
OCFS2 mailing lists: https://oss.oracle.com/projects/ocfs2/mailman/
Project web page: https://ocfs2.wiki.kernel.org/
Tools web page: https://github.com/markfasheh/ocfs2-tools
OCFS2 mailing lists: https://subspace.kernel.org/lists.linux.dev.html

For more information on OCFS2, see the file
<file:Documentation/filesystems/ocfs2.rst>.
Expand Down
27 changes: 23 additions & 4 deletions fs/squashfs/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,26 @@ static int squashfs_bio_read_cached(struct bio *fullbio,
return 0;
}

static struct page *squashfs_get_cache_page(struct address_space *mapping,
pgoff_t index)
{
struct page *page;

if (!mapping)
return NULL;

page = find_get_page(mapping, index);
if (!page)
return NULL;

if (!PageUptodate(page)) {
put_page(page);
return NULL;
}

return page;
}

static int squashfs_bio_read(struct super_block *sb, u64 index, int length,
struct bio **biop, int *block_offset)
{
Expand All @@ -190,11 +210,10 @@ static int squashfs_bio_read(struct super_block *sb, u64 index, int length,
for (i = 0; i < page_count; ++i) {
unsigned int len =
min_t(unsigned int, PAGE_SIZE - offset, total_len);
struct page *page = NULL;
pgoff_t index = (read_start >> PAGE_SHIFT) + i;
struct page *page;

if (cache_mapping)
page = find_get_page(cache_mapping,
(read_start >> PAGE_SHIFT) + i);
page = squashfs_get_cache_page(cache_mapping, index);
if (!page)
page = alloc_page(GFP_NOIO);

Expand Down
2 changes: 2 additions & 0 deletions include/linux/bootmem_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define __LINUX_BOOTMEM_INFO_H

#include <linux/mm.h>
#include <linux/kmemleak.h>

/*
* Types for free bootmem stored in page->lru.next. These have to be in
Expand Down Expand Up @@ -59,6 +60,7 @@ static inline void get_page_bootmem(unsigned long info, struct page *page,

static inline void free_bootmem_page(struct page *page)
{
kmemleak_free_part(page_to_virt(page), PAGE_SIZE);
free_reserved_page(page);
}
#endif
Expand Down
11 changes: 9 additions & 2 deletions lib/dhry_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,15 @@ int dhry(int n)

/* Initializations */

Next_Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_KERNEL);
Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_KERNEL);
Next_Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_ATOMIC);
if (!Next_Ptr_Glob)
return -ENOMEM;

Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_ATOMIC);
if (!Ptr_Glob) {
kfree(Next_Ptr_Glob);
return -ENOMEM;
}

Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
Ptr_Glob->Discr = Ident_1;
Expand Down
7 changes: 6 additions & 1 deletion mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -7246,7 +7246,12 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
pte = (pte_t *)pmd_alloc(mm, pud, addr);
}
}
BUG_ON(pte && pte_present(ptep_get(pte)) && !pte_huge(ptep_get(pte)));

if (pte) {
pte_t pteval = ptep_get_lockless(pte);

BUG_ON(pte_present(pteval) && !pte_huge(pteval));
}

return pte;
}
Expand Down
3 changes: 2 additions & 1 deletion mm/kasan/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ static __always_inline bool memory_is_poisoned_n(const void *addr, size_t size)
if (unlikely(ret)) {
const void *last_byte = addr + size - 1;
s8 *last_shadow = (s8 *)kasan_mem_to_shadow(last_byte);
s8 last_accessible_byte = (unsigned long)last_byte & KASAN_GRANULE_MASK;

if (unlikely(ret != (unsigned long)last_shadow ||
(((long)last_byte & KASAN_GRANULE_MASK) >= *last_shadow)))
last_accessible_byte >= *last_shadow))
return true;
}
return false;
Expand Down
12 changes: 0 additions & 12 deletions mm/kasan/kasan.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,18 +466,6 @@ static inline void kasan_unpoison(const void *addr, size_t size, bool init)

if (WARN_ON((unsigned long)addr & KASAN_GRANULE_MASK))
return;
/*
* Explicitly initialize the memory with the precise object size to
* avoid overwriting the slab redzone. This disables initialization in
* the arch code and may thus lead to performance penalty. This penalty
* does not affect production builds, as slab redzones are not enabled
* there.
*/
if (__slub_debug_enabled() &&
init && ((unsigned long)size & KASAN_GRANULE_MASK)) {
init = false;
memzero_explicit((void *)addr, size);
}
size = round_up(size, KASAN_GRANULE_SIZE);

hw_set_mem_tag_range((void *)addr, size, tag, init);
Expand Down
7 changes: 7 additions & 0 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -3950,6 +3950,13 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
}
}

/*
* Some architectures may have to restore extra metadata to the page
* when reading from swap. This metadata may be indexed by swap entry
* so this must be called before swap_free().
*/
arch_swap_restore(entry, folio);

/*
* Remove the swap entry and conditionally try to free up the swapcache.
* We're already holding a reference on the page but haven't mapped it
Expand Down
8 changes: 5 additions & 3 deletions mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -2434,6 +2434,7 @@ int write_cache_pages(struct address_space *mapping,

for (i = 0; i < nr_folios; i++) {
struct folio *folio = fbatch.folios[i];
unsigned long nr;

done_index = folio->index;

Expand Down Expand Up @@ -2471,6 +2472,7 @@ int write_cache_pages(struct address_space *mapping,

trace_wbc_writepage(wbc, inode_to_bdi(mapping->host));
error = writepage(folio, wbc, data);
nr = folio_nr_pages(folio);
if (unlikely(error)) {
/*
* Handle errors according to the type of
Expand All @@ -2489,8 +2491,7 @@ int write_cache_pages(struct address_space *mapping,
error = 0;
} else if (wbc->sync_mode != WB_SYNC_ALL) {
ret = error;
done_index = folio->index +
folio_nr_pages(folio);
done_index = folio->index + nr;
done = 1;
break;
}
Expand All @@ -2504,7 +2505,8 @@ int write_cache_pages(struct address_space *mapping,
* keep going until we have written all the pages
* we tagged for writeback prior to entering this loop.
*/
if (--wbc->nr_to_write <= 0 &&
wbc->nr_to_write -= nr;
if (wbc->nr_to_write <= 0 &&
wbc->sync_mode == WB_SYNC_NONE) {
done = 1;
break;
Expand Down
16 changes: 14 additions & 2 deletions mm/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s,
unsigned int orig_size)
{
unsigned int zero_size = s->object_size;
bool kasan_init = init;
size_t i;

flags &= gfp_allowed_mask;
Expand All @@ -739,6 +740,17 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s,
(s->flags & SLAB_KMALLOC))
zero_size = orig_size;

/*
* When slub_debug is enabled, avoid memory initialization integrated
* into KASAN and instead zero out the memory via the memset below with
* the proper size. Otherwise, KASAN might overwrite SLUB redzones and
* cause false-positive reports. This does not lead to a performance
* penalty on production builds, as slub_debug is not intended to be
* enabled there.
*/
if (__slub_debug_enabled())
kasan_init = false;

/*
* As memory initialization might be integrated into KASAN,
* kasan_slab_alloc and initialization memset must be
Expand All @@ -747,8 +759,8 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s,
* As p[i] might get tagged, memset and kmemleak hook come after KASAN.
*/
for (i = 0; i < size; i++) {
p[i] = kasan_slab_alloc(s, p[i], flags, init);
if (p[i] && init && !kasan_has_integrated_init())
p[i] = kasan_slab_alloc(s, p[i], flags, kasan_init);
if (p[i] && init && (!kasan_init || !kasan_has_integrated_init()))
memset(p[i], 0, zero_size);
kmemleak_alloc_recursive(p[i], s->object_size, 1,
s->flags, flags);
Expand Down

0 comments on commit 946c6b5

Please sign in to comment.