security: replace strict_strto*() with kstrto*()
authorJingoo Han <jg1.han@samsung.com>
Wed, 5 Feb 2014 06:13:14 +0000 (15:13 +0900)
committerJames Morris <james.l.morris@oracle.com>
Thu, 6 Feb 2014 08:11:04 +0000 (19:11 +1100)
The usage of strict_strto*() is not preferred, because
strict_strto*() is obsolete. Thus, kstrto*() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/apparmor/lsm.c
security/integrity/ima/ima_policy.c
security/integrity/integrity_audit.c
security/keys/encrypted-keys/encrypted.c
security/keys/trusted.c
security/selinux/hooks.c
security/selinux/selinuxfs.c

index 4257b7e2796bf16e41db9ddca0e1f7c8e0d08a02..998100093332a1390d1bc26b07eab91307fa2917 100644 (file)
@@ -751,7 +751,7 @@ module_param_named(enabled, apparmor_enabled, bool, S_IRUGO);
 static int __init apparmor_enabled_setup(char *str)
 {
        unsigned long enabled;
-       int error = strict_strtoul(str, 0, &enabled);
+       int error = kstrtoul(str, 0, &enabled);
        if (!error)
                apparmor_enabled = enabled ? 1 : 0;
        return 1;
index a9c3d3cd1990d506a431614ffcf1d63ee53434a3..354b125c6c9fa93535e7d67ce445ccef4b259e62 100644 (file)
@@ -520,7 +520,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
                                break;
                        }
 
-                       result = strict_strtoul(args[0].from, 16,
+                       result = kstrtoul(args[0].from, 16,
                                                &entry->fsmagic);
                        if (!result)
                                entry->flags |= IMA_FSMAGIC;
@@ -547,7 +547,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
                                break;
                        }
 
-                       result = strict_strtoul(args[0].from, 10, &lnum);
+                       result = kstrtoul(args[0].from, 10, &lnum);
                        if (!result) {
                                entry->uid = make_kuid(current_user_ns(), (uid_t)lnum);
                                if (!uid_valid(entry->uid) || (((uid_t)lnum) != lnum))
@@ -564,7 +564,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
                                break;
                        }
 
-                       result = strict_strtoul(args[0].from, 10, &lnum);
+                       result = kstrtoul(args[0].from, 10, &lnum);
                        if (!result) {
                                entry->fowner = make_kuid(current_user_ns(), (uid_t)lnum);
                                if (!uid_valid(entry->fowner) || (((uid_t)lnum) != lnum))
index d7efb30404aaed01d860a5bf274477ce56e2e481..809ec8428ee7d46195997d1b9675a7c8e55f5694 100644 (file)
@@ -22,7 +22,7 @@ static int __init integrity_audit_setup(char *str)
 {
        unsigned long audit;
 
-       if (!strict_strtoul(str, 0, &audit))
+       if (!kstrtoul(str, 0, &audit))
                integrity_audit_info = audit ? 1 : 0;
        return 1;
 }
index 9e1e005c75967d497831fb67146020aeed4bc4a8..5fe443d120afe81826902cc70efecff24ccee1bb 100644 (file)
@@ -609,7 +609,7 @@ static struct encrypted_key_payload *encrypted_key_alloc(struct key *key,
        long dlen;
        int ret;
 
-       ret = strict_strtol(datalen, 10, &dlen);
+       ret = kstrtol(datalen, 10, &dlen);
        if (ret < 0 || dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE)
                return ERR_PTR(-EINVAL);
 
index e13fcf7636f7ffa0ff40d7cd60408645621dab1f..6b804aa4529a171bfab534307903b142c23cf891 100644 (file)
@@ -753,7 +753,7 @@ static int getoptions(char *c, struct trusted_key_payload *pay,
                                return -EINVAL;
                        break;
                case Opt_keyhandle:
-                       res = strict_strtoul(args[0].from, 16, &handle);
+                       res = kstrtoul(args[0].from, 16, &handle);
                        if (res < 0)
                                return -EINVAL;
                        opt->keytype = SEAL_keytype;
@@ -782,7 +782,7 @@ static int getoptions(char *c, struct trusted_key_payload *pay,
                                return -EINVAL;
                        break;
                case Opt_pcrlock:
-                       res = strict_strtoul(args[0].from, 10, &lock);
+                       res = kstrtoul(args[0].from, 10, &lock);
                        if (res < 0)
                                return -EINVAL;
                        opt->pcrlock = lock;
@@ -820,7 +820,7 @@ static int datablob_parse(char *datablob, struct trusted_key_payload *p,
                c = strsep(&datablob, " \t");
                if (!c)
                        return -EINVAL;
-               ret = strict_strtol(c, 10, &keylen);
+               ret = kstrtol(c, 10, &keylen);
                if (ret < 0 || keylen < MIN_KEY_SIZE || keylen > MAX_KEY_SIZE)
                        return -EINVAL;
                p->key_len = keylen;
index 3219560f9fae17598dde8bc70285f2fb1846e63a..0e68bdbe020a2c8db0c994afbc6ac9f2e013a8de 100644 (file)
@@ -106,7 +106,7 @@ int selinux_enforcing;
 static int __init enforcing_setup(char *str)
 {
        unsigned long enforcing;
-       if (!strict_strtoul(str, 0, &enforcing))
+       if (!kstrtoul(str, 0, &enforcing))
                selinux_enforcing = enforcing ? 1 : 0;
        return 1;
 }
@@ -119,7 +119,7 @@ int selinux_enabled = CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE;
 static int __init selinux_enabled_setup(char *str)
 {
        unsigned long enabled;
-       if (!strict_strtoul(str, 0, &enabled))
+       if (!kstrtoul(str, 0, &enabled))
                selinux_enabled = enabled ? 1 : 0;
        return 1;
 }
index 5122affe06a8840e193150d62bd9b2f996fe67fe..170b4b123acc32e6757e649f19ca62504ea675d2 100644 (file)
@@ -54,7 +54,7 @@ unsigned int selinux_checkreqprot = CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE;
 static int __init checkreqprot_setup(char *str)
 {
        unsigned long checkreqprot;
-       if (!strict_strtoul(str, 0, &checkreqprot))
+       if (!kstrtoul(str, 0, &checkreqprot))
                selinux_checkreqprot = checkreqprot ? 1 : 0;
        return 1;
 }