summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/sigaltstack/current_stack_pointer.h
diff options
context:
space:
mode:
authorShardul Bankar <shardul.b@mpiricsoftware.com>2025-11-17 17:41:21 +0530
committerChuck Lever <chuck.lever@oracle.com>2025-12-18 11:18:39 -0500
commitdf8d829bba3adcf3cc744c01d933b6fd7cf06e91 (patch)
tree96d9158be88c905f474a69cd1afd0ca3b8d32d42 /tools/testing/selftests/sigaltstack/current_stack_pointer.h
parentebae102897e760e9e6bc625f701dd666b2163bd1 (diff)
nfsd: fix memory leak in nfsd_create_serv error paths
When nfsd_create_serv() calls percpu_ref_init() to initialize nn->nfsd_net_ref, it allocates both a percpu reference counter and a percpu_ref_data structure (64 bytes). However, if the function fails later due to svc_create_pooled() returning NULL or svc_bind() returning an error, these allocations are not cleaned up, resulting in a memory leak. The leak manifests as: - Unreferenced percpu allocation (8 bytes per CPU) - Unreferenced percpu_ref_data structure (64 bytes) Fix this by adding percpu_ref_exit() calls in both error paths to properly clean up the percpu_ref_init() allocations. This patch fixes the percpu_ref leak in nfsd_create_serv() seen as an auxiliary leak in syzbot report 099461f8558eb0a1f4f3; the prepare_creds() and vsock-related leaks in the same report remain to be addressed separately. Reported-by: syzbot+099461f8558eb0a1f4f3@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=099461f8558eb0a1f4f3 Fixes: 47e988147f40 ("nfsd: add nfsd_serv_try_get and nfsd_serv_put") Signed-off-by: Shardul Bankar <shardul.b@mpiricsoftware.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'tools/testing/selftests/sigaltstack/current_stack_pointer.h')
0 files changed, 0 insertions, 0 deletions