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
Reply to
Randy Dunlap, 2021-05-15
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
Thread (46 messages) 46 messages, 11 authors, last reply 2021-12-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help