All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Rantala, Tommi T. (Nokia - FI/Espoo)" <tommi.t.rantala@nokia.com>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4.14] perf machine: Guard against NULL in machine__exit()
Date: Wed, 19 Jun 2019 14:31:28 +0200	[thread overview]
Message-ID: <20190619123128.GA23334@kroah.com> (raw)
In-Reply-To: <20190619120030.6099-1-tommi.t.rantala@nokia.com>

On Wed, Jun 19, 2019 at 12:00:46PM +0000, Rantala, Tommi T. (Nokia - FI/Espoo) wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> commit 4a2233b194c77ae1ea8304cb7c00b551de4313f0 upstream.
> 
> A recent fix for 'perf trace' introduced a bug where
> machine__exit(trace->host) could be called while trace->host was still
> NULL, so make this more robust by guarding against NULL, just like
> free() does.
> 
> The problem happens, for instance, when !root users try to run 'perf
> trace':
> 
>   [acme@jouet linux]$ trace
>   Error:	No permissions to read /sys/kernel/debug/tracing/events/raw_syscalls/sys_(enter|exit)
>   Hint:	Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
> 
>   perf: Segmentation fault
>   Obtained 7 stack frames.
>   [0x4f1b2e]
>   /lib64/libc.so.6(+0x3671f) [0x7f43a1dd971f]
>   [0x4f3fec]
>   [0x47468b]
>   [0x42a2db]
>   /lib64/libc.so.6(__libc_start_main+0xe9) [0x7f43a1dc3509]
>   [0x42a6c9]
>   Segmentation fault (core dumped)
>   [acme@jouet linux]$
> 
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Andrei Vagin <avagin@openvz.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Vasily Averin <vvs@virtuozzo.com>
> Cc: Wang Nan <wangnan0@huawei.com>
> Fixes: 33974a414ce2 ("perf trace: Call machine__exit() at exit")
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
> ---
>  tools/perf/util/machine.c | 3 +++
>  1 file changed, 3 insertions(+)

Now applied, thanks.

greg k-h

      reply	other threads:[~2019-06-19 12:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 12:00 [PATCH 4.14] perf machine: Guard against NULL in machine__exit() Rantala, Tommi T. (Nokia - FI/Espoo)
2019-06-19 12:31 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190619123128.GA23334@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tommi.t.rantala@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.