xfs_db: fix crc invalidation segfault
PATCH 1/1 xfs_db: fix crc invalidation segfault
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.
--- db/crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
db/crc.c +1 -1
@@ -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;
Signature · 1 line
2.26.1
Quoted 6 lines · Anthony Iliopoulos
The
nowrite_opsvar is declared within nested block scope but used outside that scope, causingxfs_dbto crash while trying to defererence theverify_writepointer. Fix it by lifting the declaration to the outer scope, where it is accessed.Signed-off-by Anthony Iliopoulos <[email protected]>
Yup, thanks for spotting & fixing this.
Quoted 25 lines
--- db/crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)db/crc.c +1
-1@@ -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;
Quoted 11 lines · Eric Sandeen
Quoted 6 lines · Anthony Iliopoulos
The
nowrite_opsvar is declared within nested block scope but used outside that scope, causingxfs_dbto crash while trying to defererence theverify_writepointer. Fix it by lifting the declaration to the outer scope, where it is accessed.Signed-off-by Anthony Iliopoulos <[email protected]>Yup, thanks for spotting & fixing this.
Fixes b64af2c "xfs_db: add crc manipulation commands"
<nitpick> commit ids should be 14(?) digits long these days.
Quoted 1 line
Reviewd-by Eric Sandeen <[email protected]>
"Pat, I'd like to buy a vowel..." :D
--D
Quoted 26 lines
Quoted 26 lines
--- db/crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)db/crc.c +1
-1@@ -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;
Quoted 7 lines · Darrick J. Wong
Quoted 6 lines · Eric Sandeen
Quoted 5 lines · Anthony Iliopoulos
The
nowrite_opsvar is declared within nested block scope but used outside that scope, causingxfs_dbto crash while trying to defererence theverify_writepointer. Fix it by lifting the declaration to the outer scope, where it is accessed.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Anthony Iliopoulos <[email protected]>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)
Quoted 3 lines
Quoted 1 line
Reviewd-by Eric Sandeen <[email protected]>"Pat, I'd like to buy a vowel..." :D
sigh, you'd think I'd have hotkeys by now?