Skip to contentSkip to conversation

mm-highmem-vm_bug_on-if-offset-len-page_size.patch removed from -mm tree

merged mm-stable Andrew Morton 2 participants 2 messages May 10, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/highmem: VM_BUG_ON() if offset + len > PAGE_SIZE
has been removed from the -mm tree. Its filename was
mm-highmem-vm_bug_on-if-offset-len-page_size.patch

This patch was dropped because it was merged into mm-stable

------------------------------------------------------
From: "Fabio M. De Francesco" <[email protected]>
Subject: mm/highmem: VM_BUG_ON() if offset + len > PAGE_SIZE

Add VM_BUG_ON() bounds checking to make sure that, if "offset + len> PAGE_SIZE", memset() does not corrupt data in adjacent pages.

Mainly to match all the similar functions in highmem.h.

---

 include/linux/highmem.h |    2 ++
 1 file changed, 2 insertions(+)
include/linux/highmem.h renamed from include/linux/highmem.h~mm-highmem-vm_bug_on-if-offset-len-page_size +2 -0
@@ -358,6 +358,8 @@ static inline void memcpy_to_page(struct
 static inline void memzero_page(struct page *page, size_t offset, size_t len)
 {
 	char *addr = kmap_local_page(page);
+
+	VM_BUG_ON(offset + len > PAGE_SIZE);
 	memset(addr + offset, 0, len);
 	flush_dcache_page(page);
 	kunmap_local(addr);

_

Patches currently in -mm which might be from [email protected] are

#1 lore raw
Quoted 25 lines · On martedì 10 maggio 2022 06:15:28 CEST Andrew Morton wrote:

The quilt patch titled
Subject: mm/highmem: VM_BUG_ON() if offset + len > PAGE_SIZE
has been removed from the -mm tree. Its filename was
mm-highmem-vm_bug_on-if-offset-len-page_size.patch

This patch was dropped because it was merged into mm-stable

------------------------------------------------------
From: "Fabio M. De Francesco" <[email protected]>
Subject: mm/highmem: VM_BUG_ON() if offset + len > PAGE_SIZE

Add VM_BUG_ON() bounds checking to make sure that, if "offset + len> PAGE_SIZE", memset() does not corrupt data in adjacent pages.

Mainly to match all the similar functions in highmem.h.

Quoted 6 lines

---

 include/linux/highmem.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/include/linux/highmem.h~mm-highmem-vm_bug_on-if-offset-len-

page_size

Review static inline void memcpy_to_page(struct · line 358

Quoted 3 lines

+++ a/include/linux/highmem.h

(quoted diff) +0 -0
@@ -358,6 +358,8 @@ static inline void memcpy_to_page(struct
 static inline void memzero_page(struct page *page, size_t offset, size_t 

len)

Quoted 9 lines
include/linux/highmem.h renamed from include/linux/highmem.h~mm-highmem-vm_bug_on-if-offset-len-page_size +2 -0
 {
 	char *addr = kmap_local_page(page);
+
+	VM_BUG_ON(offset + len > PAGE_SIZE);
 	memset(addr + offset, 0, len);
 	flush_dcache_page(page);
 	kunmap_local(addr);

_

Quoted 4 lines

Patches currently in -mm which might be from [email protected] are

Hello Andrew,

I still see that the list of my patches currently in -mm is empty.

On April 28th I sent v4 of a series.[1] It received two "Reviewed-by" tags, respectively from Ira Weiny[2] and Sebastian Andrzej Siewior.[3]

Therefore, I assume that the v4 of the series can be considered final. Can you please take a look at it and either apply to -mm or let me know if there is anything which should still be improved?

Thank you very much,

Fabio M. De Francesco

[1] [PATCH v4 0/4] Extend and reorganize Highmem's documentation
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/

[2] Reviewed-by: Ira Weiny <[email protected]> (for the series)
https://lore.kernel.org/lkml/Ym4WSstEQI7yYU0n@iweiny-server/

[3] Reviewed-by: Sebastian Andrzej Siewior <[email protected]> (for the series)
[3] https://lore.kernel.org/lkml/[email protected]/