Revision 19a58ce1dc72264b9d50ff6d86cc36b3c439fb64 authored by Xinpeng Liu on 07 August 2019, 23:29:23 UTC, committed by Steven Rostedt (VMware) on 31 August 2019, 10:51:55 UTC
BUG: KASAN: null-ptr-deref in trace_probe_cleanup+0x8d/0xd0
Read of size 8 at addr 0000000000000000 by task syz-executor.0/9746
trace_probe_cleanup+0x8d/0xd0
free_trace_kprobe.part.14+0x15/0x50
alloc_trace_kprobe+0x23e/0x250

Link: http://lkml.kernel.org/r/1565220563-980-1-git-send-email-danielliu861@gmail.com

Fixes: e3dc9f898ef9c ("tracing/probe: Add trace_event_call accesses APIs")
Signed-off-by: Xinpeng Liu <danielliu861@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 595a438
Raw File
bpf_asm.c
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Minimal BPF assembler
 *
 * Instead of libpcap high-level filter expressions, it can be quite
 * useful to define filters in low-level BPF assembler (that is kept
 * close to Steven McCanne and Van Jacobson's original BPF paper).
 * In particular for BPF JIT implementors, JIT security auditors, or
 * just for defining BPF expressions that contain extensions which are
 * not supported by compilers.
 *
 * How to get into it:
 *
 * 1) read Documentation/networking/filter.txt
 * 2) Run `bpf_asm [-c] <filter-prog file>` to translate into binary
 *    blob that is loadable with xt_bpf, cls_bpf et al. Note: -c will
 *    pretty print a C-like construct.
 *
 * Copyright 2013 Daniel Borkmann <borkmann@redhat.com>
 */

#include <stdbool.h>
#include <stdio.h>
#include <string.h>

extern void bpf_asm_compile(FILE *fp, bool cstyle);

int main(int argc, char **argv)
{
	FILE *fp = stdin;
	bool cstyle = false;
	int i;

	for (i = 1; i < argc; i++) {
		if (!strncmp("-c", argv[i], 2)) {
			cstyle = true;
			continue;
		}

		fp = fopen(argv[i], "r");
		if (!fp) {
			fp = stdin;
			continue;
		}

		break;
	}

	bpf_asm_compile(fp, cstyle);

	return 0;
}
back to top