1. 14 Apr, 2021 38 commits
  2. 12 Apr, 2021 1 commit
    • Christophe Leroy's avatar
      powerpc/signal32: Fix build failure with CONFIG_SPE · af072b1a
      Christophe Leroy authored
      Add missing fault exit label in unsafe_copy_from_user() in order to
      avoid following build failure with CONFIG_SPE
      
        CC      arch/powerpc/kernel/signal_32.o
      arch/powerpc/kernel/signal_32.c: In function 'restore_user_regs':
      arch/powerpc/kernel/signal_32.c:565:36: error: macro "unsafe_copy_from_user" requires 4 arguments, but only 3 given
        565 |           ELF_NEVRREG * sizeof(u32));
            |                                    ^
      In file included from ./include/linux/uaccess.h:11,
                       from ./include/linux/sched/task.h:11,
                       from ./include/linux/sched/signal.h:9,
                       from ./include/linux/rcuwait.h:6,
                       from ./include/linux/percpu-rwsem.h:7,
                       from ./include/linux/fs.h:33,
                       from ./include/linux/huge_mm.h:8,
                       from ./include/linux/mm.h:707,
                       from arch/powerpc/kernel/signal_32.c:17:
      ./arch/powerpc/include/asm/uaccess.h:428: note: macro "unsafe_copy_from_user" defined here
        428 | #define unsafe_copy_from_user(d, s, l, e) \
            |
      arch/powerpc/kernel/signal_32.c:564:3: error: 'unsafe_copy_from_user' undeclared (first use in this function); did you mean 'raw_copy_from_user'?
        564 |   unsafe_copy_from_user(current->thread.evr, &sr->mc_vregs,
            |   ^~~~~~~~~~~~~~~~~~~~~
            |   raw_copy_from_user
      arch/powerpc/kernel/signal_32.c:564:3: note: each undeclared identifier is reported only once for each function it appears in
      make[3]: *** [arch/powerpc/kernel/signal_32.o] Error 1
      
      Fixes: 627b72be ("powerpc/signal32: Convert restore_[tm]_user_regs() to user access block")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/aad2cb1801a3cc99bc27081022925b9fc18a0dfb.1618159169.git.christophe.leroy@csgroup.eu
      af072b1a
  3. 08 Apr, 2021 1 commit
    • Christophe Leroy's avatar
      powerpc/32: Remove powerpc specific definition of 'ptrdiff_t' · c46bbf5d
      Christophe Leroy authored
      For unknown reason, old commit d27dfd388715 ("Import pre2.0.8")
      changed 'ptrdiff_t' from 'int' to 'long'.
      
      GCC expects it as 'int' really, and this leads to the following
      warning when building KFENCE:
      
        CC      mm/kfence/report.o
      In file included from ./include/linux/printk.h:7,
                       from ./include/linux/kernel.h:16,
                       from mm/kfence/report.c:10:
      mm/kfence/report.c: In function 'kfence_report_error':
      ./include/linux/kern_levels.h:5:18: warning: format '%td' expects argument of type 'ptrdiff_t', but argument 6 has type 'long int' [-Wformat=]
          5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
            |                  ^~~~~~
      ./include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
         11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
            |                  ^~~~~~~~
      ./include/linux/printk.h:343:9: note: in expansion of macro 'KERN_ERR'
        343 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            |         ^~~~~~~~
      mm/kfence/report.c:213:3: note: in expansion of macro 'pr_err'
        213 |   pr_err("Out-of-bounds %s at 0x%p (%luB %s of kfence-#%td):\n",
            |   ^~~~~~
      
      <asm-generic/uapi/posix-types.h> defines it as 'int', and
      defines 'size_t' and 'ssize_t' exactly as powerpc do, so
      remove the powerpc specific definitions and fallback on
      generic ones.
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Acked-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/e43d133bf52fa19e577f64f3a3a38cedc570377d.1617616601.git.christophe.leroy@csgroup.eu
      c46bbf5d