The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] fix sys_prctl() returned uninitialized value
@ 2008-05-22  3:19 Shi Weihua
  2008-05-22  3:32 ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: Shi Weihua @ 2008-05-22  3:19 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Serge E. Hallyn, morgan, linux-security-module, LKML, jmorris,
	ltp-list

When we test kernel by the latest LTP(20080430) on ia64,
the following failure occured:
-------------------------------------
prctl01     1  PASS  :  Test Passed
prctl01     0  WARN  :  prctl() returned 2048 errno = 0 : Success
prctl01     1  PASS  :  Test Passed
prctl01     2  FAIL  :  Test Failed
-------------------------------------

We found commit 3898b1b4ebff8dcfbcf1807e0661585e06c9a91c
causes this failure by git-bisect.
And, we found 'error' has not been initialized in the function 
sys_prctl()(kernel/sys.c). When the capability module is not taking
responsibility for this call, sys_prctl() may return a wrong value.

Now, i fixed it.

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com> 
---
diff --git a/kernel/sys.c b/kernel/sys.c
index 895d2d4..26eb0f7 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1652,7 +1652,7 @@ asmlinkage long sys_umask(int mask)
 asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
 			  unsigned long arg4, unsigned long arg5)
 {
-	long uninitialized_var(error);
+	long error = 0;
 
 	if (security_task_prctl(option, arg2, arg3, arg4, arg5, &error))
 		return error;


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

end of thread, other threads:[~2008-05-22 22:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22  3:19 [PATCH] fix sys_prctl() returned uninitialized value Shi Weihua
2008-05-22  3:32 ` Andrew Morton
2008-05-22  4:34   ` [LTP] " Li Zefan
2008-05-22  4:57     ` Andrew Morton
2008-05-22  5:01   ` Andrew G. Morgan
2008-05-22  5:15     ` Andrew Morton
2008-05-22  5:25     ` Andrew Morton
2008-05-22 13:07       ` Andrew G. Morgan
2008-05-22 19:17       ` Serge E. Hallyn

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