Ivan Delalande 4d5741aa2a proc/sysctl: don't return ENOMEM on lookup when a table is unregistering
commit ea5751ccd665a2fd1b24f9af81f6167f0718c5f6 upstream.

proc_sys_lookup can fail with ENOMEM instead of ENOENT when the
corresponding sysctl table is being unregistered. In our case we see
this upon opening /proc/sys/net/*/conf files while network interfaces
are being deleted, which confuses our configuration daemon.

The problem was successfully reproduced and this fix tested on v4.9.122
and v4.20-rc6.

v2: return ERR_PTRs in all cases when proc_sys_make_inode fails instead
of mixing them with NULL. Thanks Al Viro for the feedback.

Fixes: ace0c791e6c3 ("proc/sysctl: Don't grab i_lock under sysctl_lock.")
Cc: stable@vger.kernel.org
Signed-off-by: Ivan Delalande <colona@arista.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-29 13:40:16 +01:00
..
2016-10-15 12:09:13 -07:00
2018-12-08 13:05:10 +01:00
2017-08-06 18:59:43 -07:00
2018-12-05 19:42:40 +01:00
2018-11-21 09:26:03 +01:00
2018-12-17 09:38:35 +01:00
2017-11-30 08:39:04 +00:00
2018-12-17 09:38:35 +01:00
2018-12-21 14:11:31 +01:00
2017-06-14 15:06:00 +02:00
2016-09-27 21:20:53 -04:00
2016-09-27 18:47:38 -04:00
2018-05-16 10:08:42 +02:00
2018-02-17 13:21:15 +01:00
2017-06-14 15:06:01 +02:00