* [PATCH] xfs_repair: set args.geo in longform_dir2_entry_check_data
@ 2015-08-25 18:34 Eric Sandeen
2015-08-25 22:52 ` Dave Chinner
2015-08-25 22:53 ` Eric Sandeen
0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2015-08-25 18:34 UTC (permalink / raw)
To: xfs-oss
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
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
Have to wonder if there are more of these :(
diff --git a/repair/phase6.c b/repair/phase6.c
index 04638c2..951587e 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] xfs_repair: set args.geo in longform_dir2_entry_check_data
2015-08-25 18:34 [PATCH] xfs_repair: set args.geo in longform_dir2_entry_check_data Eric Sandeen
@ 2015-08-25 22:52 ` Dave Chinner
2015-08-25 22:53 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2015-08-25 22:52 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Tue, Aug 25, 2015 at 01:34:21PM -0500, Eric Sandeen wrote:
> 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
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> 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.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] xfs_repair: set args.geo in longform_dir2_entry_check_data
2015-08-25 18:34 [PATCH] xfs_repair: set args.geo in longform_dir2_entry_check_data Eric Sandeen
2015-08-25 22:52 ` Dave Chinner
@ 2015-08-25 22:53 ` Eric Sandeen
1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2015-08-25 22:53 UTC (permalink / raw)
To: xfs-oss
On 8/25/15 1:34 PM, Eric Sandeen wrote:
> 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
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> 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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-25 22:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25 18:34 [PATCH] xfs_repair: set args.geo in longform_dir2_entry_check_data Eric Sandeen
2015-08-25 22:52 ` Dave Chinner
2015-08-25 22:53 ` Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox