[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150323073506.GC25184@gmail.com>
Date: Mon, 23 Mar 2015 08:35:07 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Alexei Starovoitov <ast@...mgrid.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Jiri Olsa <jolsa@...hat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
"David S. Miller" <davem@...emloft.net>,
Daniel Borkmann <daniel@...earbox.net>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
linux-api@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 tip 6/9] samples: bpf: simple non-portable kprobe
filter example
* Alexei Starovoitov <ast@...mgrid.com> wrote:
> +void read_trace_pipe(void)
> +{
> + int trace_fd;
> +
> + trace_fd = open(DEBUGFS "trace_pipe", O_RDONLY, 0);
> + if (trace_fd < 0)
> + return;
> +
> + while (1) {
> + static char buf[4096];
> + ssize_t sz;
> +
> + sz = read(trace_fd, buf, sizeof(buf));
read() will return -1 on failure ...
> + if (sz) {
... this test passes ...
> + buf[sz] = 0;
... and here we smash the stack?
> + puts(buf);
> + }
> + }
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists