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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 9 Dec 2015 16:47:34 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Wang Yufen <wangyufen@...wei.com>, davem@...emloft.net,
	netdev@...r.kernel.org
Cc:	guohanjun@...wei.com, zhangdianfang@...wei.com,
	dingtianhong@...wei.com, huxinwei@...wei.com,
	Eric Dumazet <eric.dumazet@...il.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH net] net:sysctl fix the confusing corner of tcp_mem

Hello.

On 12/9/2015 5:01 AM, Wang Yufen wrote:

> From: Yufen Wang <wangyufen@...wei.com>
>
> I tried on linux-4.1:
>      linux:~# cat /proc/sys/net/ipv4/tcp_mem
>      8388608	12582912	16777216
>      linux:~# echo 1234 >/proc/sys/net/ipv4/tcp_mem
>      -bash: echo: write error: Invalid argument
>      linux:~# cat /proc/sys/net/ipv4/tcp_mem
>      1234	12582912	16777216
>
> the echo operation got error, but value already written to tcp_mem.
> If a write() returns an error like EINVAL, we expect no change occurred.
> This patch fix the confusing corner and makes __do_proc_doulongvec_minmax
> works the same as __do_proc_dointvec
>
> Signed-off-by: Yufen Wang <wangyufen@...wei.com>
> Cc: Eric Dumazet <eric.dumazet@...il.com>
> Cc: "Eric W. Biederman" <ebiederm@...ssion.com>
> ---
>   kernel/sysctl.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index c3eee4c..e3ee4be 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -2318,6 +2318,8 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
>   			bool neg;
>
>   			left -= proc_skip_spaces(&kbuf);
> +                        if (!left)
> +                                break;

     Please use tabs for indentation, not spaces.

[...]

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ