mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Vasiliy Kulikov <segoon@openwall.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	Pekka Enberg <penberg@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 03/12] perf: fix temporary file ownership check
Date: Fri, 12 Aug 2011 13:28:55 -0300	[thread overview]
Message-ID: <1313166544-6209-4-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1313166544-6209-1-git-send-email-acme@infradead.org>

From: Vasiliy Kulikov <segoon@openwall.com>

A file in /tmp/ might be a symlink, so lstat() should be used instead of
stat().

Acked-by: Pekka Enberg <penberg@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20110811205537.GA22864@albatros
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index e142c21..469c026 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1506,7 +1506,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
 		struct stat st;
 
-		if (stat(dso->name, &st) < 0)
+		if (lstat(dso->name, &st) < 0)
 			return -1;
 
 		if (st.st_uid && (st.st_uid != geteuid())) {
-- 
1.6.2.5


  parent reply	other threads:[~2011-08-12 16:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12 16:28 [GIT PULL 00/12] perf fixes Arnaldo Carvalho de Melo
2011-08-12 16:28 ` [PATCH 01/12] perf top browser: Remove spurious helpline update Arnaldo Carvalho de Melo
2011-08-12 16:28 ` [PATCH 02/12] perf report: Use properly build_id kernel binaries Arnaldo Carvalho de Melo
2011-08-12 16:28 ` Arnaldo Carvalho de Melo [this message]
2011-08-12 16:28 ` [PATCH 04/12] perf probe: Fix a memory leak for scopes array Arnaldo Carvalho de Melo
2011-08-12 16:28 ` [PATCH 05/12] perf probe: Fix line walker to check CU correctly Arnaldo Carvalho de Melo
2011-08-12 16:28 ` [PATCH 06/12] perf probe: Fix to search nested inlined functions in CU Arnaldo Carvalho de Melo
2011-08-12 16:28 ` [PATCH 07/12] perf probe: Fix to walk all inline instances Arnaldo Carvalho de Melo
2011-08-12 16:29 ` [PATCH 08/12] perf probe: Warn when more than one line are given Arnaldo Carvalho de Melo
2011-08-12 16:29 ` [PATCH 09/12] perf probe: Fix to search local variables in appropriate scope Arnaldo Carvalho de Melo
2011-08-12 16:29 ` [PATCH 10/12] perf probe: Avoid searching variables in intermediate scopes Arnaldo Carvalho de Melo
2011-08-12 16:29 ` [PATCH 11/12] perf probe: Search concrete out-of-line instances Arnaldo Carvalho de Melo
2011-08-12 16:29 ` [PATCH 12/12] perf probe: Filter out redundant inline-instances Arnaldo Carvalho de Melo

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=1313166544-6209-4-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=penberg@kernel.org \
    --cc=peterz@infradead.org \
    --cc=segoon@openwall.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®