Skip to contentSkip to conversation

mm-change-fault_in_pages_-to-have-an-unsigned-size-parameter.patch removed from -mm tree

merged [email protected] 1 participant 1 message Sep 3, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm: change fault_in_pages_* to have an unsigned size parameter
has been removed from the -mm tree. Its filename was
mm-change-fault_in_pages_-to-have-an-unsigned-size-parameter.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Greg Kroah-Hartman <[email protected]>
Subject: mm: change fault_in_pages_* to have an unsigned size parameter

fault_in_pages_writeable() and fault_in_pages_readable() treat the size parameter as unsigned, doing pointer math with the value, so make this explicit and set it to be a size_t type which all callers currently treat it as anyway.

This solves the issue where static checkers get nervous seeing pointer arithmetic happening with a signed value.

---

 include/linux/pagemap.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/pagemap.h renamed from include/linux/pagemap.h~mm-change-fault_in_pages_-to-have-an-unsigned-size-parameter +2 -2
@@ -736,7 +736,7 @@ extern void add_page_wait_queue(struct p
 /*
  * Fault everything in given userspace address range in.
  */
-static inline int fault_in_pages_writeable(char __user *uaddr, int size)
+static inline int fault_in_pages_writeable(char __user *uaddr, size_t size)
 {
 	char __user *end = uaddr + size - 1;
 
@@ -763,7 +763,7 @@ static inline int fault_in_pages_writeab
 	return 0;
 }
 
-static inline int fault_in_pages_readable(const char __user *uaddr, int size)
+static inline int fault_in_pages_readable(const char __user *uaddr, size_t size)
 {
 	volatile char c;
 	const char __user *end = uaddr + size - 1;

_

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

percpu-remove-export-of-pcpu_base_addr.patch