[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [PATCH 3/3] sysctl: detect overflows when converting to int
From:       Andrew Morton <akpm () linux-foundation ! org>
Date:       2015-03-31 22:45:54
Message-ID: 20150331154554.a0c878277c6d912db39316f9 () linux-foundation ! org
[Download RAW message or body]

On Sun, 29 Mar 2015 21:28:29 +0200 Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:

> When converting unsigned long to int overflows may occur.
> These currently are not detected when writing to the sysctl
> file system.
> 
> E.g. on a system where int has 32 bits and long has 64 bits
>   echo 0x800001234 > /proc/sys/kernel/threads-max
> has the same effect as
>   echo 0x1234 > /proc/sys/kernel/threads-max
> 
> The patch adds the missing check in do_proc_dointvec_conv.
> 
> With the patch an overflow will result in an error EINVAL when
> writing to the the sysctl file system.

hm, why fix this?  There's a small risk of breaking
accidentally-working userspace, but I expect we can live with that.

But how big a problem is this, really?  This behaviour is quite
expected, after all.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic