lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1510226898-4310-1-git-send-email-manjeet.p@samsung.com>
Date:   Thu,  9 Nov 2017 16:58:18 +0530
From:   Manjeet Pawar <manjeet.p@...sung.com>
To:     linux-kernel@...r.kernel.org, linux-mm@...ck.org, vbabka@...e.cz,
        mhocko@...e.com, akpm@...ux-foundation.org, hughd@...gle.com
Cc:     a.sahrawat@...sung.com, pankaj.m@...sung.com,
        lalit.mohan@...sung.com, Manjeet Pawar <manjeet.p@...sung.com>,
        Vinay Kumar Rijhwani <v.rijhwani@...sung.com>,
        Rohit Thapliyal <r.thapliyal@...sung.com>
Subject: [PATCH] mm: Replace-simple_strtoul-with-kstrtoul

simple_strtoul() is obselete now, so using newer function kstrtoul()

Signed-off-by: Manjeet Pawar <manjeet.p@...sung.com>
Signed-off-by: Vinay Kumar Rijhwani <v.rijhwani@...sung.com>
Signed-off-by: Rohit Thapliyal <r.thapliyal@...sung.com>
---
 mm/page_alloc.c |  3 +--
 mm/shmem.c      | 11 +++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 77e4d3c..f9d812e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7197,9 +7197,8 @@ int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *table, int write,
 
 static int __init set_hashdist(char *str)
 {
-	if (!str)
+	if (!str || kstrtoul(str, 0, (unsigned long *)&hashdist))
 		return 0;
-	hashdist = simple_strtoul(str, &str, 0);
 	return 1;
 }
 __setup("hashdist=", set_hashdist);
diff --git a/mm/shmem.c b/mm/shmem.c
index 07a1d22..bf7d905 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3470,6 +3470,7 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,
 	struct mempolicy *mpol = NULL;
 	uid_t uid;
 	gid_t gid;
+	unsigned long mode;
 
 	while (options != NULL) {
 		this_char = options;
@@ -3522,14 +3523,13 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,
 		} else if (!strcmp(this_char,"mode")) {
 			if (remount)
 				continue;
-			sbinfo->mode = simple_strtoul(value, &rest, 8) & 07777;
-			if (*rest)
+			if (kstrtoul(value, 8, &mode))
 				goto bad_val;
+			sbinfo->mode = mode & 07777;
 		} else if (!strcmp(this_char,"uid")) {
 			if (remount)
 				continue;
-			uid = simple_strtoul(value, &rest, 0);
-			if (*rest)
+			if (kstrtoul(value, 0, (unsigned long *)&uid))
 				goto bad_val;
 			sbinfo->uid = make_kuid(current_user_ns(), uid);
 			if (!uid_valid(sbinfo->uid))
@@ -3537,8 +3537,7 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,
 		} else if (!strcmp(this_char,"gid")) {
 			if (remount)
 				continue;
-			gid = simple_strtoul(value, &rest, 0);
-			if (*rest)
+			if (kstrtoul(value, 0, (unsigned long *)&gid))
 				goto bad_val;
 			sbinfo->gid = make_kgid(current_user_ns(), gid);
 			if (!gid_valid(sbinfo->gid))
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ