]> git.baikalelectronics.ru Git - kernel.git/commit
perf trace: Check for vfs_getname.pathname length
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 24 Mar 2017 17:51:28 +0000 (14:51 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 24 Mar 2017 19:05:31 +0000 (16:05 -0300)
commit2f0e803b5cce6d4c7cee864c2f0e5fc7c0cf8cb3
tree614ff8fc65f75f578e46821167a4ab0ff0667c31
parent474e5ba7f36aa7591bc11eef7cf29504a9858aa9
perf trace: Check for vfs_getname.pathname length

It shouldn't be zero, but if the 'perf probe' on getname_flags() (or
elsewhere in the future we need to probe to catch the pathname for
syscalls like 'open' being copied from userspace to the kernel) is
misplaced somehow, then we will end up not allocating space and trying
to copy the "" empty string to ttrace->filename.name, causing a
segfault, fix it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-c4f1t6sx1nczuzop19r5si5s@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c