mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shi Weihua <shiwh@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>,
	morgan@kernel.org, linux-security-module@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	jmorris@namei.org, ltp-list@lists.sourceforge.net
Subject: [PATCH] fix sys_prctl() returned uninitialized value
Date: Thu, 22 May 2008 11:19:21 +0800	[thread overview]
Message-ID: <4834E639.2010209@cn.fujitsu.com> (raw)

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;


             reply	other threads:[~2008-05-22  3:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22  3:19 Shi Weihua [this message]
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

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=4834E639.2010209@cn.fujitsu.com \
    --to=shiwh@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=morgan@kernel.org \
    --cc=serue@us.ibm.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

Powered by JetHome