diff options
| author | David S. Miller <davem@davemloft.net> | 2018-03-21 12:09:04 -0400 | 
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-03-21 12:09:04 -0400 | 
| commit | 3d27484eba9572ded0117acab7d2728e8916d58f (patch) | |
| tree | 0ccda8d3c50ddf3fb46088cf4b2307a84f9aa484 /kernel/fail_function.c | |
| parent | 5f2fb802eee1df0810b47ea251942fe3fd36589a (diff) | |
| parent | 87e0d4f0f37fb0c8c4aeeac46fff5e957738df79 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Daniel Borkmann says:
====================
pull-request: bpf 2018-03-21
The following pull-request contains BPF updates for your *net* tree.
The main changes are:
1) Follow-up fix to the fault injection framework to prevent jump
   optimization on the kprobe by installing a dummy post-handler,
   from Masami.
2) Drop bpf_perf_prog_read_value helper from tracepoint type programs
   which was mistakenly added there and would otherwise crash due to
   wrong input context, from Yonghong.
3) Fix a crash in BPF fs when compiled with clang. Code appears to
   be fine just that clang tries to overly aggressive optimize in
   non C conform ways, therefore fix the kernel's Makefile to
   generally prevent such issues, from Daniel.
4) Skip unnecessary capability checks in bpf syscall, which is otherwise
   triggering unnecessary security hooks on capability checking and
   causing false alarms on unprivileged processes trying to access
   CAP_SYS_ADMIN restricted infra, from Chenbo.
5) Fix the test_bpf.ko module when CONFIG_BPF_JIT_ALWAYS_ON is set
   with regards to a test case that is really just supposed to fail
   on x8_64 JIT but not others, from Thadeu.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/fail_function.c')
| -rw-r--r-- | kernel/fail_function.c | 10 | 
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/fail_function.c b/kernel/fail_function.c index 21b0122cb39c..1d5632d8bbcc 100644 --- a/kernel/fail_function.c +++ b/kernel/fail_function.c @@ -14,6 +14,15 @@  static int fei_kprobe_handler(struct kprobe *kp, struct pt_regs *regs); +static void fei_post_handler(struct kprobe *kp, struct pt_regs *regs, +			     unsigned long flags) +{ +	/* +	 * A dummy post handler is required to prohibit optimizing, because +	 * jump optimization does not support execution path overriding. +	 */ +} +  struct fei_attr {  	struct list_head list;  	struct kprobe kp; @@ -56,6 +65,7 @@ static struct fei_attr *fei_attr_new(const char *sym, unsigned long addr)  			return NULL;  		}  		attr->kp.pre_handler = fei_kprobe_handler; +		attr->kp.post_handler = fei_post_handler;  		attr->retval = adjust_error_retval(addr, 0);  		INIT_LIST_HEAD(&attr->list);  	}  | 
