提交 fa87dc82 编写于 作者: D Dan Carpenter 提交者: Yang Yingliang

net/sunrpc: return 0 on attempt to write to "transports"

mainline inclusion
from mainline-5.10-rc4
commit d435c05a
category: bugfix
bugzilla: 51817
CVE: NA

-------------------------------------------------
You can't write to this file because the permissions are 0444.  But
it sort of looked like you could do a write and it would result in
a read.  Then it looked like proc_sys_call_handler() just ignored
it.  Which is confusing.  It's more clear if the "write" just
returns zero.

Also, the "lenp" pointer is never NULL so that check can be removed.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
(cherry picked from commit d435c05a)
Signed-off-by: NBaisong Zhong <zhongbaisong@huawei.com>
Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 9323b943
...@@ -64,7 +64,7 @@ static int proc_do_xprt(struct ctl_table *table, int write, ...@@ -64,7 +64,7 @@ static int proc_do_xprt(struct ctl_table *table, int write,
char tmpbuf[256]; char tmpbuf[256];
size_t len; size_t len;
if ((*ppos && !write) || !*lenp) { if (write || *ppos) {
*lenp = 0; *lenp = 0;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册