linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] security: tomoyo: Fix obsolete function
@ 2018-09-04  8:41 Ding Xiang
  2018-09-04 10:22 ` Tetsuo Handa
  2018-09-04 18:57 ` James Morris
  0 siblings, 2 replies; 3+ messages in thread
From: Ding Xiang @ 2018-09-04  8:41 UTC (permalink / raw)
  To: linux-security-module

simple_strtoul is obsolete, and use kstrtouint instead

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
---
 security/tomoyo/common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 03923a1..9b38f94 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -1660,7 +1660,8 @@ static void tomoyo_read_pid(struct tomoyo_io_buffer *head)
 	head->r.eof = true;
 	if (tomoyo_str_starts(&buf, "global-pid "))
 		global_pid = true;
-	pid = (unsigned int) simple_strtoul(buf, NULL, 10);
+	if (kstrtouint(buf, 10, &pid))
+		return;
 	rcu_read_lock();
 	if (global_pid)
 		p = find_task_by_pid_ns(pid, &init_pid_ns);
-- 
1.9.1

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

* [PATCH] security: tomoyo: Fix obsolete function
  2018-09-04  8:41 [PATCH] security: tomoyo: Fix obsolete function Ding Xiang
@ 2018-09-04 10:22 ` Tetsuo Handa
  2018-09-04 18:57 ` James Morris
  1 sibling, 0 replies; 3+ messages in thread
From: Tetsuo Handa @ 2018-09-04 10:22 UTC (permalink / raw)
  To: linux-security-module

On 2018/09/04 17:41, Ding Xiang wrote:
> simple_strtoul is obsolete, and use kstrtouint instead
> 
> Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>

Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>

> ---
>  security/tomoyo/common.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
> index 03923a1..9b38f94 100644
> --- a/security/tomoyo/common.c
> +++ b/security/tomoyo/common.c
> @@ -1660,7 +1660,8 @@ static void tomoyo_read_pid(struct tomoyo_io_buffer *head)
>  	head->r.eof = true;
>  	if (tomoyo_str_starts(&buf, "global-pid "))
>  		global_pid = true;
> -	pid = (unsigned int) simple_strtoul(buf, NULL, 10);
> +	if (kstrtouint(buf, 10, &pid))
> +		return;
>  	rcu_read_lock();
>  	if (global_pid)
>  		p = find_task_by_pid_ns(pid, &init_pid_ns);
> 

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

* [PATCH] security: tomoyo: Fix obsolete function
  2018-09-04  8:41 [PATCH] security: tomoyo: Fix obsolete function Ding Xiang
  2018-09-04 10:22 ` Tetsuo Handa
@ 2018-09-04 18:57 ` James Morris
  1 sibling, 0 replies; 3+ messages in thread
From: James Morris @ 2018-09-04 18:57 UTC (permalink / raw)
  To: linux-security-module

On Tue, 4 Sep 2018, Ding Xiang wrote:

> simple_strtoul is obsolete, and use kstrtouint instead
> 
> Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general

and next-testing.



-- 
James Morris
<jmorris@namei.org>

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

end of thread, other threads:[~2018-09-04 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04  8:41 [PATCH] security: tomoyo: Fix obsolete function Ding Xiang
2018-09-04 10:22 ` Tetsuo Handa
2018-09-04 18:57 ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).