Whamcloud - gitweb
LU-17000 utils: Coverity leaks and races 49/56149/4
authorShaun Tancheff <shaun.tancheff@hpe.com>
Tue, 27 Aug 2024 02:59:35 +0000 (09:59 +0700)
committerOleg Drokin <green@whamcloud.com>
Sun, 24 Nov 2024 06:04:46 +0000 (06:04 +0000)
commit646a5b62db5b6644b4eed5a1c972652888d79664
treec8783d28361aa4129d49395ac89cdbb0a6561c15
parent10547cbf7ad11423729cc7a15ee1352bb4461814
LU-17000 utils: Coverity leaks and races

CoverityID: 442365 ("time-of-check, time-of-use")
CoverityID: 442366 ("time-of-check, time-of-use")
Use fstat() on open file descriptor and use fcntl() to add
the desired O_NONBLOCK flag for pipes.

CoverityID: 442113 ("Resource leaks")
Ensure qctl allocated object is free'd in lfs_quota()

CoverityID: 442364: ("Null pointer dereferences")
In lfs_fid2path() ensure `path_or_fsname` is not null before
checking if it starts with a forward slash ('/')

CoverityID: 442116 ("Resource leaks")
In get_projid() close dir_fd as soon as it is no longer needed.

CoverityID: 442373 ("Memory - corruptions, overrun allocated")
Fix lov_forge_comp_v1() which also fails to clone FID

Test-Parameters: trivial
Test-Parameters: testlist=sanity env=ONLY="56ebb"
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I2868d5ded322cd9cc890c463a494d296206d4be9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56149
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/lfs.c
lustre/utils/liblustreapi.c