Newly introduced findings

List of Findings

Error: SHELLCHECK_WARNING (CWE-149): [#def1]
/usr/bin/xfs_metadump:28:24: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   26|   		exit $status
#   27|   		;;
#   28|-> 	r)	DBOPTS=$DBOPTS"-R "$OPTARG" ";;
#   29|   	\?)	echo $USAGE 1>&2
#   30|   		exit 2

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
xfsprogs-6.14.0/libfrog/bitmap.c:271:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'pos'
xfsprogs-6.14.0/libfrog/bitmap.c:264:9: branch_true: following 'true' branch...
xfsprogs-6.14.0/libfrog/bitmap.c:267:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.14.0/libfrog/bitmap.c:271:21: branch_true: ...to here
xfsprogs-6.14.0/libfrog/bitmap.c:267:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.14.0/libfrog/bitmap.c:271:21: branch_true: ...to here
xfsprogs-6.14.0/libfrog/bitmap.c:271:21: danger: dereference of NULL 'pos'
#  269|   
#  270|   		stat = 0;
#  271|-> 		if (ext->btn_start < start)
#  272|   			stat |= 1;
#  273|   		if (ext->btn_start + ext->btn_length > start + len)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
xfsprogs-6.14.0/libfrog/bitmap.c:304:45: warning[-Wanalyzer-malloc-leak]: leak of 'bitmap_node_init(start + len,  new_length)'
xfsprogs-6.14.0/libfrog/bitmap.c:238:1: enter_function: entry to '__bitmap_clear'
xfsprogs-6.14.0/libfrog/bitmap.c:264:9: branch_true: following 'true' branch...
xfsprogs-6.14.0/libfrog/bitmap.c:267:9: branch_true: following 'true' branch (when 'pos != l')...
xfsprogs-6.14.0/libfrog/bitmap.c:271:21: branch_true: ...to here
xfsprogs-6.14.0/libfrog/bitmap.c:298:31: call_function: calling 'bitmap_node_init' from '__bitmap_clear'
xfsprogs-6.14.0/libfrog/bitmap.c:298:31: return_function: returning to '__bitmap_clear' from 'bitmap_node_init'
xfsprogs-6.14.0/libfrog/bitmap.c:299:28: branch_false: following 'false' branch...
xfsprogs-6.14.0/libfrog/bitmap.c:304:60: branch_false: ...to here
xfsprogs-6.14.0/libfrog/bitmap.c:304:45: danger: 'bitmap_node_init(start + len,  new_length)' leaks here; was allocated at [(10)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/9)
#  302|   			}
#  303|   
#  304|-> 			node = avl64_insert(bmap->bt_tree, &ext->btn_node);
#  305|   			if (node == NULL) {
#  306|   				ret = -EEXIST;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
xfsprogs-6.14.0/libxfs/xfs_ag_resv.c:142:52: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
xfsprogs-6.14.0/libxfs/xfs_ag_resv.c:131:1: enter_function: entry to '__xfs_ag_resv_free'
xfsprogs-6.14.0/libxfs/xfs_ag_resv.c:140:16: call_function: inlined call to 'xfs_perag_resv' from '__xfs_ag_resv_free'
xfsprogs-6.14.0/libxfs/xfs_ag_resv.c:141:13: call_function: inlined call to 'pag_agno' from '__xfs_ag_resv_free'
xfsprogs-6.14.0/libxfs/xfs_ag_resv.c:141:12: branch_true: following 'true' branch...
xfsprogs-6.14.0/libxfs/xfs_ag_resv.c:142:17: call_function: inlined call to 'pag_mount' from '__xfs_ag_resv_free'
xfsprogs-6.14.0/libxfs/xfs_ag_resv.c:142:52: danger: dereference of NULL '<unknown>'
#  140|   	resv = xfs_perag_resv(pag, type);
#  141|   	if (pag_agno(pag) == 0)
#  142|-> 		pag_mount(pag)->m_ag_max_usable += resv->ar_asked;
#  143|   	/*
#  144|   	 * RMAPBT blocks come from the AGFL and AGFL blocks are always

Error: GCC_ANALYZER_WARNING (CWE-457): [#def5]
xfsprogs-6.14.0/libxfs/xfs_alloc.c:2945:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'bno'
xfsprogs-6.14.0/libxfs/xfs_alloc.c:3940:1: enter_function: entry to 'xfs_free_extent_fix_freelist'
xfsprogs-6.14.0/libxfs/xfs_alloc.c:3958:12: branch_false: following 'false' branch...
xfsprogs-6.14.0/libxfs/xfs_alloc.c:3961:17: branch_false: ...to here
xfsprogs-6.14.0/libxfs/xfs_alloc.c:3961:17: call_function: calling 'libxfs_alloc_fix_freelist' from 'xfs_free_extent_fix_freelist'
# 2943|   		 * freeing the block.
# 2944|   		 */
# 2945|-> 		error = xfs_free_extent_later(tp, xfs_agbno_to_fsb(pag, bno),
# 2946|   				1, &targs.oinfo, XFS_AG_RESV_AGFL, 0);
# 2947|   		if (error)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
xfsprogs-6.14.0/libxfs/xfs_alloc.c:4004:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'agbp'
xfsprogs-6.14.0/libxfs/xfs_alloc.c:3975:1: enter_function: entry to '__xfs_free_extent'
xfsprogs-6.14.0/libxfs/xfs_alloc.c:3997:17: call_function: calling 'xfs_free_extent_fix_freelist' from '__xfs_free_extent'
xfsprogs-6.14.0/libxfs/xfs_alloc.c:3997:17: return_function: returning to '__xfs_free_extent' from 'xfs_free_extent_fix_freelist'
xfsprogs-6.14.0/libxfs/xfs_alloc.c:3998:12: branch_false: following 'false' branch...
xfsprogs-6.14.0/libxfs/xfs_alloc.c:4004:19: branch_false: ...to here
xfsprogs-6.14.0/libxfs/xfs_alloc.c:4004:19: release_memory: 'agbp' is NULL
xfsprogs-6.14.0/libxfs/xfs_alloc.c:4004:9: danger: dereference of NULL 'agbp'
# 4002|   	}
# 4003|   
# 4004|-> 	agf = agbp->b_addr;
# 4005|   
# 4006|   	if (XFS_IS_CORRUPT(mp, agbno >= mp->m_sb.sb_agblocks)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
xfsprogs-6.14.0/libxfs/xfs_bmap_btree.c:561:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  559|   	struct xfs_btree_block	*broot;
#  560|   	unsigned int		new_size;
#  561|-> 	unsigned int		old_size = ifp->if_broot_bytes;
#  562|   
#  563|   	/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
xfsprogs-6.14.0/mkfs/proto.c:695:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘fname’
xfsprogs-6.14.0/mkfs/proto.c:933:1: enter_function: entry to ‘parse_proto’
xfsprogs-6.14.0/mkfs/proto.c:940:9: call_function: calling ‘parseproto’ from ‘parse_proto’
#  693|   	memset(&creds, 0, sizeof(creds));
#  694|   	mstr = getstr(pp);
#  695|-> 	switch (mstr[0]) {
#  696|   	case '-':
#  697|   		fmt = IF_REGULAR;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def9]
xfsprogs-6.14.0/repair/xfs_repair.c:609:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘sb.sb_unit’
xfsprogs-6.14.0/repair/xfs_repair.c:699:1: enter_function: entry to ‘calc_mkfs’
xfsprogs-6.14.0/repair/xfs_repair.c:713:12: branch_true: following ‘true’ branch...
xfsprogs-6.14.0/repair/xfs_repair.c:717:17: call_function: calling ‘guess_correct_sunit’ from ‘calc_mkfs’
#  607|   		do_warn(_("AG %u superblock contains plausible sb_unit value\n"),
#  608|   				agno);
#  609|-> 		new_sunit = sb.sb_unit;
#  610|   		goto fix;
#  611|   	}

Error: GCC_ANALYZER_WARNING (CWE-457): [#def10]
xfsprogs-6.14.0/scrub/inodes.c:545:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘error’
xfsprogs-6.14.0/scrub/inodes.c:559:1: enter_function: entry to ‘scan_ag_inumbers’
xfsprogs-6.14.0/scrub/inodes.c:574:17: call_function: calling ‘alloc_ichunk’ from ‘scan_ag_inumbers’
xfsprogs-6.14.0/scrub/inodes.c:574:17: return_function: returning to ‘scan_ag_inumbers’ from ‘alloc_ichunk’
xfsprogs-6.14.0/scrub/inodes.c:575:12: branch_false: following ‘false’ branch...
xfsprogs-6.14.0/scrub/inodes.c:577:16: branch_false: ...to here
xfsprogs-6.14.0/scrub/inodes.c:581:16: branch_true: following ‘true’ branch (when ‘error == 0’)...
xfsprogs-6.14.0/scrub/inodes.c:581:27: branch_true: ...to here
xfsprogs-6.14.0/scrub/inodes.c:581:16: branch_false: following ‘false’ branch...
xfsprogs-6.14.0/scrub/inodes.c:581:42: branch_false: ...to here
xfsprogs-6.14.0/scrub/inodes.c:581:16: branch_true: following ‘true’ branch...
xfsprogs-6.14.0/scrub/inodes.c:586:31: branch_true: ...to here
xfsprogs-6.14.0/scrub/inodes.c:586:20: branch_false: following ‘false’ branch...
xfsprogs-6.14.0/scrub/inodes.c:595:17: branch_false: ...to here
xfsprogs-6.14.0/scrub/inodes.c:597:20: branch_false: following ‘false’ branch...
xfsprogs-6.14.0/scrub/inodes.c:604:28: branch_false: ...to here
xfsprogs-6.14.0/scrub/inodes.c:604:27: branch_false: following ‘false’ branch...
xfsprogs-6.14.0/scrub/inodes.c:620:25: branch_false: ...to here
xfsprogs-6.14.0/scrub/inodes.c:620:25: call_function: calling ‘scan_ag_bulkstat’ from ‘scan_ag_inumbers’
#  543|   
#  544|   err:
#  545|-> 	if (error) {
#  546|   		str_liberror(ctx, error, descr_render(&dsc_bulkstat));
#  547|   		si->aborted = true;

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.86.0
diffbase-analyzer-version-cppcheck2.17.1
diffbase-analyzer-version-gcc15.0.1
diffbase-analyzer-version-gcc-analyzer15.0.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-96.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namexfsprogs-6.12.0-3.fc42
diffbase-store-results-to/tmp/tmpn7exzfau/xfsprogs-6.12.0-3.fc42.tar.xz
diffbase-time-created2025-04-25 16:06:19
diffbase-time-finished2025-04-25 16:09:57
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpn7exzfau/xfsprogs-6.12.0-3.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpn7exzfau/xfsprogs-6.12.0-3.fc42.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-96.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namexfsprogs-6.14.0-1.fc43
store-results-to/tmp/tmpoque1cx9/xfsprogs-6.14.0-1.fc43.tar.xz
time-created2025-04-25 16:10:26
time-finished2025-04-25 16:13:54
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpoque1cx9/xfsprogs-6.14.0-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpoque1cx9/xfsprogs-6.14.0-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9