Files
Jeff Layton e31957a819 nfsd: don't ignore the return code of svc_proc_register()
commit 930b64ca0c upstream.

Currently, nfsd_proc_stat_init() ignores the return value of
svc_proc_register(). If the procfile creation fails, then the kernel
will WARN when it tries to remove the entry later.

Fix nfsd_proc_stat_init() to return the same type of pointer as
svc_proc_register(), and fix up nfsd_net_init() to check that and fail
the nfsd_net construction if it occurs.

svc_proc_register() can fail if the dentry can't be allocated, or if an
identical dentry already exists. The second case is pretty unlikely in
the nfsd_net construction codepath, so if this happens, return -ENOMEM.

Reported-by: syzbot+e34ad04f27991521104c@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-nfs/67a47501.050a0220.19061f.05f9.GAE@google.com/
Cc: stable@vger.kernel.org # v6.9
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-20 10:18:29 +02:00
..
2024-10-17 00:28:06 -07:00
2024-12-02 15:32:19 +01:00
2024-12-05 12:31:40 +01:00
2025-02-08 10:00:54 +01:00
2024-12-03 10:40:36 +01:00
2024-08-21 22:32:58 +02:00
2025-04-20 10:18:10 +02:00
2025-03-22 12:56:45 -07:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00
2024-10-21 16:29:38 +02:00
2024-11-03 01:28:06 -05:00
2024-10-21 16:29:38 +02:00
2025-01-09 16:58:50 +01:00
2024-09-27 08:18:43 -07:00
2025-02-17 11:36:36 +01:00
2024-09-27 08:18:43 -07:00
2024-11-03 01:28:07 -05:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00