[1/1] selinuxfs: fix type mismatch
diff mbox

Message ID 1465593266-10135-1-git-send-email-xypron.glpk@gmx.de
State New
Headers show

Commit Message

Heinrich Schuchardt June 10, 2016, 9:14 p.m. UTC
avc_cache_threshold is of type unsigned int.

Do not use a signed new_value in
sscanf(page, "%u", &new_value).

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 security/selinux/selinuxfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Moore June 15, 2016, 8:25 p.m. UTC | #1
On Fri, Jun 10, 2016 at 5:14 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> avc_cache_threshold is of type unsigned int.
>
> Do not use a signed new_value in
> sscanf(page, "%u", &new_value).
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  security/selinux/selinuxfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
> index 1b1fd27..0765c5b 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -1347,7 +1347,7 @@ static ssize_t sel_write_avc_cache_threshold(struct file *file,
>  {
>         char *page;
>         ssize_t ret;
> -       int new_value;
> +       unsigned int new_value;
>
>         ret = task_has_security(current, SECURITY__SETSECPARAM);
>         if (ret)
> --
> 2.1.4
>

Patch
diff mbox

diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 1b1fd27..0765c5b 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1347,7 +1347,7 @@  static ssize_t sel_write_avc_cache_threshold(struct file *file,
 {
 	char *page;
 	ssize_t ret;
-	int new_value;
+	unsigned int new_value;
 
 	ret = task_has_security(current, SECURITY__SETSECPARAM);
 	if (ret)