1. 02 3月, 2017 5 次提交
  2. 28 2月, 2017 3 次提交
  3. 25 2月, 2017 1 次提交
  4. 24 2月, 2017 2 次提交
    • M
      s390: TASK_SIZE for kernel threads · fb94a687
      Martin Schwidefsky 提交于
      Return a sensible value if TASK_SIZE if called from a kernel thread.
      
      This gets us around an issue with copy_mount_options that does a magic
      size calculation "TASK_SIZE - (unsigned long)data" while in a kernel
      thread and data pointing to kernel space.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      fb94a687
    • M
      s390/crypt: Add protected key AES module · 27937843
      Martin Schwidefsky 提交于
      This patch introduces a new in-kernel-crypto blockcipher
      called 'paes' which implements AES with protected keys.
      The paes blockcipher can be used similar to the aes
      blockcipher but uses secure key material to derive the
      working protected key and so offers an encryption
      implementation where never a clear key value is exposed
      in memory.
      
      The paes module is only available for the s390 platform
      providing a minimal hardware support of CPACF enabled
      with at least MSA level 3. Upon module initialization
      these requirements are checked.
      
      Includes additional contribution from Harald Freudenberger.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      27937843
  5. 23 2月, 2017 9 次提交
  6. 22 2月, 2017 2 次提交
  7. 20 2月, 2017 1 次提交
  8. 18 2月, 2017 2 次提交
    • D
      bpf: make jited programs visible in traces · 74451e66
      Daniel Borkmann 提交于
      Long standing issue with JITed programs is that stack traces from
      function tracing check whether a given address is kernel code
      through {__,}kernel_text_address(), which checks for code in core
      kernel, modules and dynamically allocated ftrace trampolines. But
      what is still missing is BPF JITed programs (interpreted programs
      are not an issue as __bpf_prog_run() will be attributed to them),
      thus when a stack trace is triggered, the code walking the stack
      won't see any of the JITed ones. The same for address correlation
      done from user space via reading /proc/kallsyms. This is read by
      tools like perf, but the latter is also useful for permanent live
      tracing with eBPF itself in combination with stack maps when other
      eBPF types are part of the callchain. See offwaketime example on
      dumping stack from a map.
      
      This work tries to tackle that issue by making the addresses and
      symbols known to the kernel. The lookup from *kernel_text_address()
      is implemented through a latched RB tree that can be read under
      RCU in fast-path that is also shared for symbol/size/offset lookup
      for a specific given address in kallsyms. The slow-path iteration
      through all symbols in the seq file done via RCU list, which holds
      a tiny fraction of all exported ksyms, usually below 0.1 percent.
      Function symbols are exported as bpf_prog_<tag>, in order to aide
      debugging and attribution. This facility is currently enabled for
      root-only when bpf_jit_kallsyms is set to 1, and disabled if hardening
      is active in any mode. The rationale behind this is that still a lot
      of systems ship with world read permissions on kallsyms thus addresses
      should not get suddenly exposed for them. If that situation gets
      much better in future, we always have the option to change the
      default on this. Likewise, unprivileged programs are not allowed
      to add entries there either, but that is less of a concern as most
      such programs types relevant in this context are for root-only anyway.
      If enabled, call graphs and stack traces will then show a correct
      attribution; one example is illustrated below, where the trace is
      now visible in tooling such as perf script --kallsyms=/proc/kallsyms
      and friends.
      
      Before:
      
        7fff8166889d bpf_clone_redirect+0x80007f0020ed (/lib/modules/4.9.0-rc8+/build/vmlinux)
               f5d80 __sendmsg_nocancel+0xffff006451f1a007 (/usr/lib64/libc-2.18.so)
      
      After:
      
        7fff816688b7 bpf_clone_redirect+0x80007f002107 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fffa0575728 bpf_prog_33c45a467c9e061a+0x8000600020fb (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fffa07ef1fc cls_bpf_classify+0x8000600020dc (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff81678b68 tc_classify+0x80007f002078 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff8164d40b __netif_receive_skb_core+0x80007f0025fb (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff8164d718 __netif_receive_skb+0x80007f002018 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff8164e565 process_backlog+0x80007f002095 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff8164dc71 net_rx_action+0x80007f002231 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff81767461 __softirqentry_text_start+0x80007f0020d1 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff817658ac do_softirq_own_stack+0x80007f00201c (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff810a2c20 do_softirq+0x80007f002050 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff810a2cb5 __local_bh_enable_ip+0x80007f002085 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff8168d452 ip_finish_output2+0x80007f002152 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff8168ea3d ip_finish_output+0x80007f00217d (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff8168f2af ip_output+0x80007f00203f (/lib/modules/4.9.0-rc8+/build/vmlinux)
        [...]
        7fff81005854 do_syscall_64+0x80007f002054 (/lib/modules/4.9.0-rc8+/build/vmlinux)
        7fff817649eb return_from_SYSCALL_64+0x80007f002000 (/lib/modules/4.9.0-rc8+/build/vmlinux)
               f5d80 __sendmsg_nocancel+0xffff01c484812007 (/usr/lib64/libc-2.18.so)
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      74451e66
    • D
      bpf: remove stubs for cBPF from arch code · 9383191d
      Daniel Borkmann 提交于
      Remove the dummy bpf_jit_compile() stubs for eBPF JITs and make
      that a single __weak function in the core that can be overridden
      similarly to the eBPF one. Also remove stale pr_err() mentions
      of bpf_jit_compile.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9383191d
  9. 17 2月, 2017 10 次提交
  10. 08 2月, 2017 5 次提交
    • M
      s390: add no-execute support · 57d7f939
      Martin Schwidefsky 提交于
      Bit 0x100 of a page table, segment table of region table entry
      can be used to disallow code execution for the virtual addresses
      associated with the entry.
      
      There is one tricky bit, the system call to return from a signal
      is part of the signal frame written to the user stack. With a
      non-executable stack this would stop working. To avoid breaking
      things the protection fault handler checks the opcode that caused
      the fault for 0x0a77 (sys_sigreturn) and 0x0aad (sys_rt_sigreturn)
      and injects a system call. This is preferable to the alternative
      solution with a stub function in the vdso because it works for
      vdso=off and statically linked binaries as well.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      57d7f939
    • M
      s390: report new vector facilities · 2583b848
      Martin Schwidefsky 提交于
      Add hardware capability bits and feature tags to /proc/cpuinfo for
      the "Vector Packed Decimal Facility" (tag "vxd" / hwcap bit 2^12)
      and the "Vector Enhancements Facility 1" (tag "vxe" / hwcap bit 2^13).
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      2583b848
    • H
      s390: use correct input data address for setup_randomness · 4920e3cf
      Heiko Carstens 提交于
      The current implementation of setup_randomness uses the stack address
      and therefore the pointer to the SYSIB 3.2.2 block as input data
      address. Furthermore the length of the input data is the number of
      virtual-machine description blocks which is typically one.
      
      This means that typically a single zero byte is fed to
      add_device_randomness.
      
      Fix both of these and use the address of the first virtual machine
      description block as input data address and also use the correct
      length.
      
      Fixes: bcfcbb6b ("s390: add system information as device randomness")
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      4920e3cf
    • H
      s390/sclp: don't add new lines to each printed string · 02407baa
      Heiko Carstens 提交于
      The early vt220 sclp printk code added an extra new line to each
      printed multi-line text. If used for the early sclp console this will
      lead to numerous extra new lines. Therefore get rid of this semantic
      and require that each to be printed string contains a line feed
      character if a new line is wanted.
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      02407baa
    • H
      s390/sclp: make early sclp code readable · d5ab7a34
      Heiko Carstens 提交于
      This patch
      
       - unifies the old sclp early code and the sclp early printk code, so
         they can use common functions
      
       - makes sure all sclp early functions and variables have the same
         "sclp_early" prefix
      
       - converts the sclp early printk code into readable code by using
         existing data structures instead of hard coded magic arrays
      
       - splits the early sclp code into two files: sclp_early.c and
         sclp_early_core.c. The core file contains everything that is
         required by the kernel decompressor and may not call functions not
         contained within the core file. Otherwise the result would be a
         link error.
      
       - changes interrupt handling to be completely synchronous. The old
         early sclp code had a small window which allowed to receive several
         interrupts instead of exactly the single expected interrupt. This
         did hide a subtle potential bug, which is fixed with this large
         rework.
      
       - contains a couple of small cleanups.
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      d5ab7a34