All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_db: fix crc invalidation segfault
@ 2020-05-12 14:16 Anthony Iliopoulos
  2020-05-12 15:08 ` Eric Sandeen
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Iliopoulos @ 2020-05-12 14:16 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

The nowrite_ops var is declared within nested block scope but used
outside that scope, causing xfs_db to crash while trying to defererence
the verify_write pointer. Fix it by lifting the declaration to the outer
scope, where it is accessed.

Fixes: b64af2c48220c8 ("xfs_db: add crc manipulation commands")
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
---
 db/crc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/db/crc.c b/db/crc.c
index 95161c6dfe6a55..b23417a11a1e66 100644
--- a/db/crc.c
+++ b/db/crc.c
@@ -53,6 +53,7 @@ crc_f(
 	char		**argv)
 {
 	const struct xfs_buf_ops *stashed_ops = NULL;
+	struct xfs_buf_ops nowrite_ops;
 	extern char	*progname;
 	const field_t	*fields;
 	const ftattr_t	*fa;
@@ -127,7 +128,6 @@ crc_f(
 	}
 
 	if (invalidate) {
-		struct xfs_buf_ops nowrite_ops;
 		flist_t		*sfl;
 		int		bit_length;
 		int		parentoffset;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs_db: fix crc invalidation segfault
  2020-05-12 14:16 [PATCH] xfs_db: fix crc invalidation segfault Anthony Iliopoulos
@ 2020-05-12 15:08 ` Eric Sandeen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2020-05-12 15:08 UTC (permalink / raw)
  To: Anthony Iliopoulos; +Cc: linux-xfs

On 5/12/20 9:16 AM, Anthony Iliopoulos wrote:
> The nowrite_ops var is declared within nested block scope but used
> outside that scope, causing xfs_db to crash while trying to defererence
> the verify_write pointer. Fix it by lifting the declaration to the outer
> scope, where it is accessed.
> 
> Fixes: b64af2c48220c8 ("xfs_db: add crc manipulation commands")
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>

Thank you for the reminder, this is staged now.

-Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs_db: fix crc invalidation segfault
  2020-04-21  0:05   ` Darrick J. Wong
@ 2020-04-21  0:26     ` Eric Sandeen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2020-04-21  0:26 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Anthony Iliopoulos, linux-xfs



On 4/20/20 7:05 PM, Darrick J. Wong wrote:
> On Mon, Apr 20, 2020 at 03:33:36PM -0500, Eric Sandeen wrote:
>> On 4/20/20 2:52 PM, Anthony Iliopoulos wrote:
>>> The nowrite_ops var is declared within nested block scope but used
>>> outside that scope, causing xfs_db to crash while trying to defererence
>>> the verify_write pointer. Fix it by lifting the declaration to the outer
>>> scope, where it is accessed.
>>>
>>> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
>>
>> Yup, thanks for spotting & fixing this.
>>
>> Fixes: b64af2c "xfs_db: add crc manipulation commands"
> 
> <nitpick> commit ids should be 14(?) digits long these days.

hm yeah I should fix that.  (tho in xfsprogs probably less necessary)

>> Reviewd-by: Eric Sandeen <sandeen@redhat.com>
> 
> "Pat, I'd like to buy a vowel..." :D

sigh, you'd think I'd have hotkeys by now?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs_db: fix crc invalidation segfault
  2020-04-20 20:33 ` Eric Sandeen
@ 2020-04-21  0:05   ` Darrick J. Wong
  2020-04-21  0:26     ` Eric Sandeen
  0 siblings, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2020-04-21  0:05 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Anthony Iliopoulos, linux-xfs

On Mon, Apr 20, 2020 at 03:33:36PM -0500, Eric Sandeen wrote:
> On 4/20/20 2:52 PM, Anthony Iliopoulos wrote:
> > The nowrite_ops var is declared within nested block scope but used
> > outside that scope, causing xfs_db to crash while trying to defererence
> > the verify_write pointer. Fix it by lifting the declaration to the outer
> > scope, where it is accessed.
> > 
> > Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
> 
> Yup, thanks for spotting & fixing this.
> 
> Fixes: b64af2c "xfs_db: add crc manipulation commands"

<nitpick> commit ids should be 14(?) digits long these days.

> Reviewd-by: Eric Sandeen <sandeen@redhat.com>

"Pat, I'd like to buy a vowel..." :D

--D

> 
> > ---
> >  db/crc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/db/crc.c b/db/crc.c
> > index 95161c6df..b23417a11 100644
> > --- a/db/crc.c
> > +++ b/db/crc.c
> > @@ -53,6 +53,7 @@ crc_f(
> >  	char		**argv)
> >  {
> >  	const struct xfs_buf_ops *stashed_ops = NULL;
> > +	struct xfs_buf_ops nowrite_ops;
> >  	extern char	*progname;
> >  	const field_t	*fields;
> >  	const ftattr_t	*fa;
> > @@ -127,7 +128,6 @@ crc_f(
> >  	}
> >  
> >  	if (invalidate) {
> > -		struct xfs_buf_ops nowrite_ops;
> >  		flist_t		*sfl;
> >  		int		bit_length;
> >  		int		parentoffset;
> > 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfs_db: fix crc invalidation segfault
  2020-04-20 19:52 Anthony Iliopoulos
@ 2020-04-20 20:33 ` Eric Sandeen
  2020-04-21  0:05   ` Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2020-04-20 20:33 UTC (permalink / raw)
  To: Anthony Iliopoulos; +Cc: linux-xfs

On 4/20/20 2:52 PM, Anthony Iliopoulos wrote:
> The nowrite_ops var is declared within nested block scope but used
> outside that scope, causing xfs_db to crash while trying to defererence
> the verify_write pointer. Fix it by lifting the declaration to the outer
> scope, where it is accessed.
> 
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>

Yup, thanks for spotting & fixing this.

Fixes: b64af2c "xfs_db: add crc manipulation commands"
Reviewd-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  db/crc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/db/crc.c b/db/crc.c
> index 95161c6df..b23417a11 100644
> --- a/db/crc.c
> +++ b/db/crc.c
> @@ -53,6 +53,7 @@ crc_f(
>  	char		**argv)
>  {
>  	const struct xfs_buf_ops *stashed_ops = NULL;
> +	struct xfs_buf_ops nowrite_ops;
>  	extern char	*progname;
>  	const field_t	*fields;
>  	const ftattr_t	*fa;
> @@ -127,7 +128,6 @@ crc_f(
>  	}
>  
>  	if (invalidate) {
> -		struct xfs_buf_ops nowrite_ops;
>  		flist_t		*sfl;
>  		int		bit_length;
>  		int		parentoffset;
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] xfs_db: fix crc invalidation segfault
@ 2020-04-20 19:52 Anthony Iliopoulos
  2020-04-20 20:33 ` Eric Sandeen
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Iliopoulos @ 2020-04-20 19:52 UTC (permalink / raw)
  To: sandeen; +Cc: linux-xfs

The nowrite_ops var is declared within nested block scope but used
outside that scope, causing xfs_db to crash while trying to defererence
the verify_write pointer. Fix it by lifting the declaration to the outer
scope, where it is accessed.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
---
 db/crc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/db/crc.c b/db/crc.c
index 95161c6df..b23417a11 100644
--- a/db/crc.c
+++ b/db/crc.c
@@ -53,6 +53,7 @@ crc_f(
 	char		**argv)
 {
 	const struct xfs_buf_ops *stashed_ops = NULL;
+	struct xfs_buf_ops nowrite_ops;
 	extern char	*progname;
 	const field_t	*fields;
 	const ftattr_t	*fa;
@@ -127,7 +128,6 @@ crc_f(
 	}
 
 	if (invalidate) {
-		struct xfs_buf_ops nowrite_ops;
 		flist_t		*sfl;
 		int		bit_length;
 		int		parentoffset;
-- 
2.26.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-12 15:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 14:16 [PATCH] xfs_db: fix crc invalidation segfault Anthony Iliopoulos
2020-05-12 15:08 ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2020-04-20 19:52 Anthony Iliopoulos
2020-04-20 20:33 ` Eric Sandeen
2020-04-21  0:05   ` Darrick J. Wong
2020-04-21  0:26     ` Eric Sandeen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.