Skip to contentSkip to conversation

xfs_repair: set args.geo in longform_dir2_entry_check_data

PATCH In review Eric Sandeen 2 participants 3 messages Aug 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_repair: set args.geo in longform_dir2_entry_check_data

Here's another one where we miss setting da_args->geo:

longform_dir2_entry_check_data

        struct xfs_da_args      da = {
                .dp = ip,
		// .geo is unset
        };
...
	libxfs_dir2_data_make_free(&da ...)
		xfs_dir2_data_make_free
			endptr = (char *)hdr + args->geo->blksize;
				BOOM

Addresses-Coverity-Id: 1298008

---

Have to wonder if there are more of these :(

repair/phase6.c +1 -0
index 04638c2..951587e 100644
@@ -1506,6 +1506,7 @@ longform_dir2_entry_check_data(
 	int			wantmagic;
 	struct xfs_da_args	da = {
 		.dp = ip,
+		.geo = mp->m_dir_geo,
 	};
 
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 13 lines · Eric Sandeen

Here's another one where we miss setting da_args->geo:

longform_dir2_entry_check_data

        struct xfs_da_args      da = {
                .dp = ip,
		// .geo is unset
        };
...
	libxfs_dir2_data_make_free(&da ...)
		xfs_dir2_data_make_free
			endptr = (char *)hdr + args->geo->blksize;
				BOOM
Quoted 5 lines

Addresses-Coverity-Id: 1298008

---

Have to wonder if there are more of these :(

A quick git grep shows 3 uses of the struct xfs_da_args outside libxfs. longform_dir2_entry_check() is already fixed, this fixes longform_dir2_entry_check_data(), and dir2_kill_block() still needs fixing.

AFAICT all the libxfs/ usage is good.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw
In reply to Eric Sandeen
Quoted 13 lines · Eric Sandeen

Here's another one where we miss setting da_args->geo:

longform_dir2_entry_check_data

        struct xfs_da_args      da = {
                .dp = ip,
		// .geo is unset
        };
...
	libxfs_dir2_data_make_free(&da ...)
		xfs_dir2_data_make_free
			endptr = (char *)hdr + args->geo->blksize;
				BOOM
Quoted 5 lines

Addresses-Coverity-Id: 1298008

---

Have to wonder if there are more of these :(

Spot-checking in userspace wasn't hard; doesn't look like there are any more.

kernelspace looks ok too.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs