public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] broken perf tool on 4.4-rc1
@ 2016-01-30 21:02 Tong Zhang
  2016-01-30 21:20 ` TongZhang
  2016-02-01  2:17 ` Wangnan (F)
  0 siblings, 2 replies; 5+ messages in thread
From: Tong Zhang @ 2016-01-30 21:02 UTC (permalink / raw)
  To: acme, wangnan0, jpoimboe; +Cc: LKML, Tong Zhang

reproduce:
  lzto@objd ~ $ ~/linux/tools/perf/perf record -I -e intel_pt/tsc=1,noretcomp=1/u /bin/ls
  lzto@objd ~ $ ~/linux/tools/perf/perf script  -F event,comm,pid,tid,time,addr,ip,sym,dso,iregs
  Segmentation fault
  lzto@objd ~ $

Upon further investigation, it seems that
commit 747a9b0a08ae ("Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip")
breaks perf tool.

__list_del(): tools/include/linux/list.h does not check null pointer dereference

Signed-off-by: Tong Zhang <ztong@vt.edu>
---
 tools/include/linux/list.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/include/linux/list.h b/tools/include/linux/list.h
index 1da4238..1d644a0 100644
--- a/tools/include/linux/list.h
+++ b/tools/include/linux/list.h
@@ -85,8 +85,10 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head)
  */
 static inline void __list_del(struct list_head * prev, struct list_head * next)
 {
-	next->prev = prev;
-	WRITE_ONCE(prev->next, next);
+	if (next)
+		next->prev = prev;
+	if (prev)
+		WRITE_ONCE(prev->next, next);
 }
 
 /**
-- 
2.4.10

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH 1/1] broken perf tool on 4.4-rc1
@ 2016-01-30 21:09 Tong Zhang
  0 siblings, 0 replies; 5+ messages in thread
From: Tong Zhang @ 2016-01-30 21:09 UTC (permalink / raw)
  To: acme, wangnan0, jpoimboe; +Cc: LKML, Tong Zhang

reproduce:
  lzto@objd ~ $ ~/linux/tools/perf/perf record -I -e intel_pt/tsc=1,noretcomp=1/u /bin/ls
  lzto@objd ~ $ ~/linux/tools/perf/perf script  -F event,comm,pid,tid,time,addr,ip,sym,dso,iregs
  Segmentation fault
  lzto@objd ~ $

Upon further investigation, it seems that
commit 747a9b0a08ae ("Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip")
breaks perf tool.

__list_del(): tools/include/linux/list.h does not check null pointer dereference

Signed-off-by: Tong Zhang <ztong@vt.edu>
---
 tools/include/linux/list.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/include/linux/list.h b/tools/include/linux/list.h
index 1da4238..1d644a0 100644
--- a/tools/include/linux/list.h
+++ b/tools/include/linux/list.h
@@ -85,8 +85,10 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head)
  */
 static inline void __list_del(struct list_head * prev, struct list_head * next)
 {
-	next->prev = prev;
-	WRITE_ONCE(prev->next, next);
+	if (next)
+		next->prev = prev;
+	if (prev)
+		WRITE_ONCE(prev->next, next);
 }
 
 /**
-- 
2.4.10

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-01  3:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-30 21:02 [PATCH 1/1] broken perf tool on 4.4-rc1 Tong Zhang
2016-01-30 21:20 ` TongZhang
2016-02-01  2:17 ` Wangnan (F)
2016-02-01  3:23   ` Wangnan (F)
  -- strict thread matches above, loose matches on Subject: below --
2016-01-30 21:09 Tong Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox