1. 02 Oct, 2020 1 commit
    • Jann Horn's avatar
      objtool: Permit __kasan_check_{read,write} under UACCESS · b0b8e56b
      Jann Horn authored
      Building linux-next with JUMP_LABEL=n and KASAN=y, I got this objtool
      warning:
      
      arch/x86/lib/copy_mc.o: warning: objtool: copy_mc_to_user()+0x22: call to
      __kasan_check_read() with UACCESS enabled
      
      What happens here is that copy_mc_to_user() branches on a static key in a
      UACCESS region:
      
              __uaccess_begin();
              if (static_branch_unlikely(&copy_mc_fragile_key))
                      ret = copy_mc_fragile(to, from, len);
              ret = copy_mc_generic(to, from, len);
              __uaccess_end();
      
      and the !CONFIG_JUMP_LABEL version of static_branch_unlikely() uses
      static_key_enabled(), which uses static_key_count(), which uses
      atomic_read(), which calls instrument_atomic_read(), which uses
      kasan_check_read(), which is __kasan_check_read().
      
      Let's permit these KASAN helpers in UACCESS regions - static keys should
      probably work under UACCESS, I think.
      
      PeterZ adds:
      
        It's not a matter of permitting, it's a matter of being safe and
        correct. In this case it is, because it's a thin wrapper around
        check_memory_region() which was already marked safe.
      
        check_memory_region() is correct because the only thing it ends up
        calling is kasa_report() and that is also marked safe because that is
        annotated with user_access_save/restore() before it does anything else.
      
        On top of that, all of KASAN is noinstr, so nothing in here will end up
        in tracing and/or call schedule() before the user_access_save().
      Signed-off-by: default avatarJann Horn <jannh@google.com>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      b0b8e56b
  2. 21 Sep, 2020 2 commits
  3. 18 Sep, 2020 2 commits
  4. 10 Sep, 2020 10 commits
  5. 01 Sep, 2020 22 commits
  6. 30 Aug, 2020 3 commits
    • Linus Torvalds's avatar
      Linux 5.9-rc3 · f75aef39
      Linus Torvalds authored
      f75aef39
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · e43327c7
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
      
       - fix regression in af_alg that affects iwd
      
       - restore polling delay in qat
      
       - fix double free in ingenic on error path
      
       - fix potential build failure in sa2ul due to missing Kconfig dependency
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: af_alg - Work around empty control messages without MSG_MORE
        crypto: sa2ul - add Kconfig selects to fix build error
        crypto: ingenic - Drop kfree for memory allocated with devm_kzalloc
        crypto: qat - add delay before polling mailbox
      e43327c7
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · dcc5c6f0
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "Three interrupt related fixes for X86:
      
         - Move disabling of the local APIC after invoking fixup_irqs() to
           ensure that interrupts which are incoming are noted in the IRR and
           not ignored.
      
         - Unbreak affinity setting.
      
           The rework of the entry code reused the regular exception entry
           code for device interrupts. The vector number is pushed into the
           errorcode slot on the stack which is then lifted into an argument
           and set to -1 because that's regs->orig_ax which is used in quite
           some places to check whether the entry came from a syscall.
      
           But it was overlooked that orig_ax is used in the affinity cleanup
           code to validate whether the interrupt has arrived on the new
           target. It turned out that this vector check is pointless because
           interrupts are never moved from one vector to another on the same
           CPU. That check is a historical leftover from the time where x86
           supported multi-CPU affinities, but not longer needed with the now
           strict single CPU affinity. Famous last words ...
      
         - Add a missing check for an empty cpumask into the matrix allocator.
      
           The affinity change added a warning to catch the case where an
           interrupt is moved on the same CPU to a different vector. This
           triggers because a condition with an empty cpumask returns an
           assignment from the allocator as the allocator uses for_each_cpu()
           without checking the cpumask for being empty. The historical
           inconsistent for_each_cpu() behaviour of ignoring the cpumask and
           unconditionally claiming that CPU0 is in the mask struck again.
           Sigh.
      
        plus a new entry into the MAINTAINER file for the HPE/UV platform"
      
      * tag 'x86-urgent-2020-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq/matrix: Deal with the sillyness of for_each_cpu() on UP
        x86/irq: Unbreak interrupt affinity setting
        x86/hotplug: Silence APIC only after all interrupts are migrated
        MAINTAINERS: Add entry for HPE Superdome Flex (UV) maintainers
      dcc5c6f0