Thread (46 messages) 46 messages, 11 authors, 2021-12-17

Re: [PATCH v2 12/13] asm-generic: uaccess: 1-byte access is always aligned

From: Arnd Bergmann <arnd@kernel.org>
Date: 2021-05-15 20:17:49
Also in: lkml

On Sat, May 15, 2021 at 8:41 PM Randy Dunlap [off-list ref] wrote:
On 5/14/21 3:01 AM, Arnd Bergmann wrote:
quoted
From: Arnd Bergmann <arnd@arndb.de>
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index 4973328f3c6e..7e903e450659 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -19,7 +19,7 @@ __get_user_fn(size_t size, const void __user *from, void *to)

      switch (size) {
      case 1:
-             *(u8 *)to = get_unaligned((u8 __force *)from);
+             *(u8 *)to = *((u8 __force *)from);
              return 0;
      case 2:
              *(u16 *)to = get_unaligned((u16 __force *)from);
@@ -45,7 +45,7 @@ __put_user_fn(size_t size, void __user *to, void *from)

      switch (size) {
      case 1:
-             put_unaligned(*(u8 *)from, (u8 __force *)to);
+             *(*(u8 *)from, (u8 __force *)to);
Should that be           from =
?
Thanks a lot for catching the typo!

Changed now to

        *(u8 __force *)to = *(u8 *)from;

For some reason neither my own build testing nor the kernel
build bot caught it so far.

        Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help