Re: [PATCH] net: remove duplicate fetch in sock_getsockopt

2019-06-18 Thread David Miller
From: JingYi Hou Date: Mon, 17 Jun 2019 14:56:05 +0800 > In sock_getsockopt(), 'optlen' is fetched the first time from userspace. > 'len < 0' is then checked. Then in condition 'SO_MEMINFO', 'optlen' is > fetched the second time from userspace. > > If change it between two fetches may cause secu

[PATCH] net: remove duplicate fetch in sock_getsockopt

2019-06-16 Thread JingYi Hou
In sock_getsockopt(), 'optlen' is fetched the first time from userspace. 'len < 0' is then checked. Then in condition 'SO_MEMINFO', 'optlen' is fetched the second time from userspace. If change it between two fetches may cause security problems or unexpected behaivor, and there is no reason to fet