* [PATCH] perf tools: do not complain if root is owning perf.data
@ 2009-08-26 13:05 Pierre Habouzit
2009-08-26 18:24 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Pierre Habouzit @ 2009-08-26 13:05 UTC (permalink / raw)
To: Ingo Molnar, Paul Mackerras, Peter Zijlstra; +Cc: linux-kernel
This improves patch fa6963b24 so that perf.data stuff that has been dumped
as root can be read (annotate/report) by a user without the use of the
--force.
Rationale is that root has plenty of ways to screw us (usually) that do
not require twisted schemes involving specially crafting a perf.data.
Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
---
tools/perf/builtin-annotate.c | 4 ++--
tools/perf/builtin-report.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 5e17de9..5010952 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -1335,8 +1335,8 @@ static int __cmd_annotate(void)
exit(-1);
}
- if (!force && (stat.st_uid != geteuid())) {
- fprintf(stderr, "file: %s not owned by current user\n", input_name);
+ if (!force && stat.st_uid && (stat.st_uid != geteuid())) {
+ fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1);
}
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 8b2ec88..b8a75f6 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1857,8 +1857,8 @@ static int __cmd_report(void)
exit(-1);
}
- if (!force && (stat.st_uid != geteuid())) {
- fprintf(stderr, "file: %s not owned by current user\n", input_name);
+ if (!force && stat.st_uid && (stat.st_uid != geteuid())) {
+ fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1);
}
--
1.6.4.1.331.gda1d56
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] perf tools: do not complain if root is owning perf.data
2009-08-26 13:05 [PATCH] perf tools: do not complain if root is owning perf.data Pierre Habouzit
@ 2009-08-26 18:24 ` Ingo Molnar
2009-08-27 7:59 ` [PATCH v2] " Pierre Habouzit
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2009-08-26 18:24 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: Paul Mackerras, Peter Zijlstra, linux-kernel
* Pierre Habouzit <pierre.habouzit@intersec.com> wrote:
> This improves patch fa6963b24 so that perf.data stuff that has
> been dumped as root can be read (annotate/report) by a user
> without the use of the --force.
>
> Rationale is that root has plenty of ways to screw us (usually)
> that do not require twisted schemes involving specially crafting a
> perf.data.
>
> Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
> ---
> tools/perf/builtin-annotate.c | 4 ++--
> tools/perf/builtin-report.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
Ok, this makes sense - but i think we should do this in .32 only,
with a Cc: <stable@kernel.org> backport tag for .31.1.
Mind doing it against the latest perfcounters tree, which can be
found in -tip:
http://people.redhat.com/mingo/tip.git/README
your current version does not apply cleanly as the surrounding code
has changed a bit already.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] perf tools: do not complain if root is owning perf.data
2009-08-26 18:24 ` Ingo Molnar
@ 2009-08-27 7:59 ` Pierre Habouzit
2009-08-28 11:49 ` Ingo Molnar
2009-08-28 11:52 ` [tip:perfcounters/core] " tip-bot for Pierre Habouzit
0 siblings, 2 replies; 5+ messages in thread
From: Pierre Habouzit @ 2009-08-27 7:59 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Paul Mackerras, Peter Zijlstra, linux-kernel, stable
This improves patch fa6963b24 so that perf.data stuff that has been dumped
as root can be read (annotate/report) by a user without the use of the
--force.
Rationale is that root has plenty of ways to screw us (usually) that do
not require twisted schemes involving specially crafting a perf.data.
Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>,
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Cc: <stable@kernel.org>
---
On Wed, Aug 26, 2009 at 08:24:59PM +0200, Ingo Molnar wrote:
> Ok, this makes sense - but i think we should do this in .32 only,
> with a Cc: <stable@kernel.org> backport tag for .31.1.
You're the boss ;)
> Mind doing it against the latest perfcounters tree, which can be
> found in -tip:
>
> http://people.redhat.com/mingo/tip.git/README
>
> your current version does not apply cleanly as the surrounding code
> has changed a bit already.
Here it is, against perfcounters/core which I assume is the proper
tip branch. Note that I'd suggest adding a README.Devel under
tools/perf to explicit how patches should be submitted, at least to
explain against which tree it's best to do our patches for
submission, it could help people avoiding losing your time with
unnecessary back-and-forth mails just to rebase a patch ;)
tools/perf/builtin-annotate.c | 4 ++--
tools/perf/builtin-report.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4ac618b..4c7bc44 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -984,8 +984,8 @@ static int __cmd_annotate(void)
exit(-1);
}
- if (!force && (input_stat.st_uid != geteuid())) {
- fprintf(stderr, "file: %s not owned by current user\n", input_name);
+ if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
+ fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1);
}
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index d2e2882..ea6328a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1405,8 +1405,8 @@ static int __cmd_report(void)
exit(-1);
}
- if (!force && (input_stat.st_uid != geteuid())) {
- fprintf(stderr, "file: %s not owned by current user\n", input_name);
+ if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
+ fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1);
}
--
1.6.4.1.341.gf2a44
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] perf tools: do not complain if root is owning perf.data
2009-08-27 7:59 ` [PATCH v2] " Pierre Habouzit
@ 2009-08-28 11:49 ` Ingo Molnar
2009-08-28 11:52 ` [tip:perfcounters/core] " tip-bot for Pierre Habouzit
1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2009-08-28 11:49 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: Paul Mackerras, Peter Zijlstra, linux-kernel, stable
* Pierre Habouzit <pierre.habouzit@intersec.com> wrote:
> This improves patch fa6963b24 so that perf.data stuff that has
> been dumped as root can be read (annotate/report) by a user
> without the use of the --force.
>
> Rationale is that root has plenty of ways to screw us (usually)
> that do not require twisted schemes involving specially crafting a
> perf.data.
>
> Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Paul Mackerras <paulus@samba.org>,
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
> Cc: <stable@kernel.org>
> ---
> On Wed, Aug 26, 2009 at 08:24:59PM +0200, Ingo Molnar wrote:
> > Ok, this makes sense - but i think we should do this in .32 only,
> > with a Cc: <stable@kernel.org> backport tag for .31.1.
>
> You're the boss ;)
>
> > Mind doing it against the latest perfcounters tree, which can be
> > found in -tip:
> >
> > http://people.redhat.com/mingo/tip.git/README
> >
> > your current version does not apply cleanly as the surrounding code
> > has changed a bit already.
>
> Here it is, against perfcounters/core which I assume is the
> proper tip branch. [...]
Yeah, applied - thanks!
> [...] Note that I'd suggest adding a README.Devel under
> tools/perf to explicit how patches should be submitted, at
> least to explain against which tree it's best to do our
> patches for submission, it could help people avoiding losing
> your time with unnecessary back-and-forth mails just to rebase
> a patch ;)
Agreed! Mind sending a patch for that, or adding a wiki page for
that on perf.wiki.kernel.org? We could then add a link to that to
tools/perf/Documentation/README.Devel or so :-)
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip:perfcounters/core] perf tools: do not complain if root is owning perf.data
2009-08-27 7:59 ` [PATCH v2] " Pierre Habouzit
2009-08-28 11:49 ` Ingo Molnar
@ 2009-08-28 11:52 ` tip-bot for Pierre Habouzit
1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Pierre Habouzit @ 2009-08-28 11:52 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, hpa, mingo, a.p.zijlstra, pierre.habouzit,
stable, tglx, mingo
Commit-ID: 119e7a22bb70d84849384e5113792cd45afa4f85
Gitweb: http://git.kernel.org/tip/119e7a22bb70d84849384e5113792cd45afa4f85
Author: Pierre Habouzit <pierre.habouzit@intersec.com>
AuthorDate: Thu, 27 Aug 2009 09:59:02 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 28 Aug 2009 13:47:43 +0200
perf tools: do not complain if root is owning perf.data
This improves patch fa6963b24 so that perf.data stuff that has
been dumped as root can be read (annotate/report) by a user
without the use of the --force.
Rationale is that root has plenty of ways to screw us (usually)
that do not require twisted schemes involving specially
crafting a perf.data.
Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: <stable@kernel.org>
LKML-Reference: <20090827075902.GF19653@laphroaig.corp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/builtin-annotate.c | 4 ++--
tools/perf/builtin-report.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4ac618b..4c7bc44 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -984,8 +984,8 @@ static int __cmd_annotate(void)
exit(-1);
}
- if (!force && (input_stat.st_uid != geteuid())) {
- fprintf(stderr, "file: %s not owned by current user\n", input_name);
+ if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
+ fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1);
}
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index d2e2882..ea6328a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1405,8 +1405,8 @@ static int __cmd_report(void)
exit(-1);
}
- if (!force && (input_stat.st_uid != geteuid())) {
- fprintf(stderr, "file: %s not owned by current user\n", input_name);
+ if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
+ fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1);
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-08-28 11:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-26 13:05 [PATCH] perf tools: do not complain if root is owning perf.data Pierre Habouzit
2009-08-26 18:24 ` Ingo Molnar
2009-08-27 7:59 ` [PATCH v2] " Pierre Habouzit
2009-08-28 11:49 ` Ingo Molnar
2009-08-28 11:52 ` [tip:perfcounters/core] " tip-bot for Pierre Habouzit
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.