[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1454188160-12570-1-git-send-email-ztong@vt.edu>
Date:	Sat, 30 Jan 2016 16:09:20 -0500
From:	Tong Zhang <ztong@...edu>
To:	acme@...hat.com, wangnan0@...wei.com, jpoimboe@...hat.com
Cc:	LKML <linux-kernel@...r.kernel.org>, Tong Zhang <ztong@...edu>
Subject: [PATCH 1/1] broken perf tool on 4.4-rc1
reproduce:
  lzto@...d ~ $ ~/linux/tools/perf/perf record -I -e intel_pt/tsc=1,noretcomp=1/u /bin/ls
  lzto@...d ~ $ ~/linux/tools/perf/perf script  -F event,comm,pid,tid,time,addr,ip,sym,dso,iregs
  Segmentation fault
  lzto@...d ~ $
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@...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
Powered by blists - more mailing lists
 
