1. 05 Jun, 2018 1 commit
  2. 04 Jun, 2018 3 commits
  3. 25 May, 2018 3 commits
  4. 22 May, 2018 1 commit
  5. 18 May, 2018 1 commit
  6. 16 May, 2018 1 commit
  7. 15 May, 2018 5 commits
  8. 14 May, 2018 1 commit
  9. 13 May, 2018 1 commit
  10. 10 May, 2018 5 commits
  11. 03 May, 2018 1 commit
  12. 30 Apr, 2018 1 commit
    • Yonghong Song's avatar
      samples/bpf: fix kprobe attachment issue on x64 · 34745aed
      Yonghong Song authored
      Commit d5a00528 ("syscalls/core, syscalls/x86: Rename
      struct pt_regs-based sys_*() to __x64_sys_*()") renamed a lot
      of syscall function sys_*() to __x64_sys_*().
      This caused several kprobe based samples/bpf tests failing.
      
      This patch fixed the problem in bpf_load.c.
      For x86_64 architecture, function name __x64_sys_*() will be
      first used for kprobe event creation. If the creation is successful,
      it will be used. Otherwise, function name sys_*() will be used
      for kprobe event creation.
      
      Fixes: d5a00528 ("syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()")
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      34745aed
  13. 29 Apr, 2018 1 commit
  14. 26 Apr, 2018 2 commits
  15. 24 Apr, 2018 4 commits
  16. 23 Apr, 2018 1 commit
    • John Fastabend's avatar
      bpf: sockmap sample use clang flag, -target bpf · 4dfe1bb9
      John Fastabend authored
      Per Documentation/bpf/bpf_devel_QA.txt add the -target flag to the
      sockmap Makefile. Relevant text quoted here,
      
         Otherwise, you can use bpf target. Additionally, you _must_ use
         bpf target when:
      
       - Your program uses data structures with pointer or long / unsigned
         long types that interface with BPF helpers or context data
         structures. Access into these structures is verified by the BPF
         verifier and may result in verification failures if the native
         architecture is not aligned with the BPF architecture, e.g. 64-bit.
         An example of this is BPF_PROG_TYPE_SK_MSG require '-target bpf'
      
      Fixes: 69e8cc13 ("bpf: sockmap sample program")
      Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      4dfe1bb9
  17. 18 Apr, 2018 3 commits
  18. 17 Apr, 2018 2 commits
    • Petr Mladek's avatar
      livepatch: Allow to call a custom callback when freeing shadow variables · 3b2c77d0
      Petr Mladek authored
      We might need to do some actions before the shadow variable is freed.
      For example, we might need to remove it from a list or free some data
      that it points to.
      
      This is already possible now. The user can get the shadow variable
      by klp_shadow_get(), do the necessary actions, and then call
      klp_shadow_free().
      
      This patch allows to do it a more elegant way. The user could implement
      the needed actions in a callback that is passed to klp_shadow_free()
      as a parameter. The callback usually does reverse operations to
      the constructor callback that can be called by klp_shadow_*alloc().
      
      It is especially useful for klp_shadow_free_all(). There we need to do
      these extra actions for each found shadow variable with the given ID.
      
      Note that the memory used by the shadow variable itself is still released
      later by rcu callback. It is needed to protect internal structures that
      keep all shadow variables. But the destructor is called immediately.
      The shadow variable must not be access anyway after klp_shadow_free()
      is called. The user is responsible to protect this any suitable way.
      
      Be aware that the destructor is called under klp_shadow_lock. It is
      the same as for the contructor in klp_shadow_alloc().
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: default avatarMiroslav Benes <mbenes@suse.cz>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      3b2c77d0
    • Petr Mladek's avatar
      livepatch: Initialize shadow variables safely by a custom callback · e91c2518
      Petr Mladek authored
      The existing API allows to pass a sample data to initialize the shadow
      data. It works well when the data are position independent. But it fails
      miserably when we need to set a pointer to the shadow structure itself.
      
      Unfortunately, we might need to initialize the pointer surprisingly
      often because of struct list_head. It is even worse because the list
      might be hidden in other common structures, for example, struct mutex,
      struct wait_queue_head.
      
      For example, this was needed to fix races in ALSA sequencer. It required
      to add mutex into struct snd_seq_client. See commit b3defb79
      ("ALSA: seq: Make ioctls race-free") and commit d15d662e
      ("ALSA: seq: Fix racy pool initializations")
      
      This patch makes the API more safe. A custom constructor function and data
      are passed to klp_shadow_*alloc() functions instead of the sample data.
      
      Note that ctor_data are no longer a template for shadow->data. It might
      point to any data that might be necessary when the constructor is called.
      
      Also note that the constructor is called under klp_shadow_lock. It is
      an internal spin_lock that synchronizes alloc() vs. get() operations,
      see klp_shadow_get_or_alloc(). On one hand, this adds a risk of ABBA
      deadlocks. On the other hand, it allows to do some operations safely.
      For example, we could add the new structure into an existing list.
      This must be done only once when the structure is allocated.
      Reported-by: default avatarNicolai Stange <nstange@suse.de>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: default avatarMiroslav Benes <mbenes@suse.cz>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      e91c2518
  19. 29 Mar, 2018 2 commits
  20. 28 Mar, 2018 1 commit