Skip to contentSkip to conversation

bio-integrity: Fix use of bs->bio_integrity_pool after free

PATCH In review Bjorn Helgaas 3 participants 6 messages May 29, 2013 – Sep 17, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bio-integrity: Fix use of bs->bio_integrity_pool after free

This fixes a copy and paste error introduced by 9f060e2231 ("block: Convert integrity to bvec_alloc_bs()").

Found by Coverity (CID 1020654).

---
 fs/bio-integrity.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bio-integrity.c +1 -1
index 8fb4291..45e944f 100644
@@ -734,7 +734,7 @@ void bioset_integrity_free(struct bio_set *bs)
 		mempool_destroy(bs->bio_integrity_pool);
 
 	if (bs->bvec_integrity_pool)
-		mempool_destroy(bs->bio_integrity_pool);
+		mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);
 
#1 lore raw
Quoted 15 lines · Bjorn Helgaas

This fixes a copy and paste error introduced by 9f060e2231 ("block: Convert integrity to bvec_alloc_bs()").

Found by Coverity (CID 1020654).

---
 fs/bio-integrity.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bio-integrity.c +0 -0
index 8fb4291..45e944f 100644

fs/bio-integrity.c void bioset_integrity_free(struct bio_set *bs) · line 739

Quoted 7 lines
fs/bio-integrity.c +1 -1
@@ -734,7 +734,7 @@ void bioset_integrity_free(struct bio_set *bs)
                mempool_destroy(bs->bio_integrity_pool);
 
        if (bs->bvec_integrity_pool)
-               mempool_destroy(bs->bio_integrity_pool);
+               mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);

Kent, do you want to chime in on this? Looks like an obvious error to me, but maybe I'm missing something and we should teach Coverity to shut up about it.

Bjorn

#2 lore raw
Quoted 18 lines · Bjorn Helgaas
Quoted 17 lines · Bjorn Helgaas

This fixes a copy and paste error introduced by 9f060e2231 ("block: Convert integrity to bvec_alloc_bs()").

Found by Coverity (CID 1020654).

---
 fs/bio-integrity.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bio-integrity.c +0 -0
index 8fb4291..45e944f 100644
@@ -734,7 +734,7 @@ void bioset_integrity_free(struct bio_set *bs)
                mempool_destroy(bs->bio_integrity_pool);
 
Quoted 9 lines

fs/bio-integrity.c void bioset_integrity_free(struct bio_set *bs) · line 739

Quoted 5 lines
fs/bio-integrity.c +1 -1
        if (bs->bvec_integrity_pool)
-               mempool_destroy(bs->bio_integrity_pool);
+               mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);

Kent, do you want to chime in on this? Looks like an obvious error to me, but maybe I'm missing something and we should teach Coverity to shut up about it.

Sorry - no, this is definitely a bug:

#3 lore raw
Quoted 29 lines · Kent Overstreet
Quoted 18 lines · Bjorn Helgaas
Quoted 17 lines · Bjorn Helgaas

This fixes a copy and paste error introduced by 9f060e2231 ("block: Convert integrity to bvec_alloc_bs()").

Found by Coverity (CID 1020654).

---
 fs/bio-integrity.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bio-integrity.c +0 -0
index 8fb4291..45e944f 100644
@@ -734,7 +734,7 @@ void bioset_integrity_free(struct bio_set *bs)
                mempool_destroy(bs->bio_integrity_pool);
 
Quoted 9 lines

fs/bio-integrity.c void bioset_integrity_free(struct bio_set *bs) · line 739

Quoted 5 lines
fs/bio-integrity.c +1 -1
        if (bs->bvec_integrity_pool)
-               mempool_destroy(bs->bio_integrity_pool);
+               mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);

Kent, do you want to chime in on this? Looks like an obvious error to me, but maybe I'm missing something and we should teach Coverity to shut up about it.

Quoted 5 lines

Sorry - no, this is definitely a bug:

From my v3.12-rc1 reminder list: what's going on with this patch?

It's been acked, Gu asked whether he could include it in some patchset, I see a Sep 11 2013 patch from Gu upstream already (bc5c8f078), but this patch (from May 29 2013) still hasn't gone anywhere. Why is this so hard?

Bjorn

#4 lore raw

[update Kent's email address]

Quoted 43 lines · Bjorn Helgaas
Quoted 29 lines · Kent Overstreet
Quoted 18 lines · Bjorn Helgaas
Quoted 17 lines · Bjorn Helgaas

This fixes a copy and paste error introduced by 9f060e2231 ("block: Convert integrity to bvec_alloc_bs()").

Found by Coverity (CID 1020654).

---
 fs/bio-integrity.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bio-integrity.c +0 -0
index 8fb4291..45e944f 100644
@@ -734,7 +734,7 @@ void bioset_integrity_free(struct bio_set *bs)
                mempool_destroy(bs->bio_integrity_pool);
 
Quoted 9 lines

fs/bio-integrity.c void bioset_integrity_free(struct bio_set *bs) · line 739

Quoted 5 lines
fs/bio-integrity.c +1 -1
        if (bs->bvec_integrity_pool)
-               mempool_destroy(bs->bio_integrity_pool);
+               mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);

Kent, do you want to chime in on this? Looks like an obvious error to me, but maybe I'm missing something and we should teach Coverity to shut up about it.

Quoted 3 lines

Sorry - no, this is definitely a bug:

From my v3.12-rc1 reminder list: what's going on with this patch?

It's been acked, Gu asked whether he could include it in some patchset, I see a Sep 11 2013 patch from Gu upstream already (bc5c8f078), but this patch (from May 29 2013) still hasn't gone anywhere. Why is this so hard?

Bjorn

#5 lore raw
In reply to Bjorn Helgaas
Quoted 33 lines · Bjorn Helgaas
Quoted 31 lines · Kent Overstreet
Quoted 18 lines · Bjorn Helgaas
Quoted 17 lines · Bjorn Helgaas

This fixes a copy and paste error introduced by 9f060e2231 ("block: Convert integrity to bvec_alloc_bs()").

Found by Coverity (CID 1020654).

---
 fs/bio-integrity.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bio-integrity.c +0 -0
index 8fb4291..45e944f 100644
@@ -734,7 +734,7 @@ void bioset_integrity_free(struct bio_set *bs)
                mempool_destroy(bs->bio_integrity_pool);
 
Quoted 9 lines

fs/bio-integrity.c void bioset_integrity_free(struct bio_set *bs) · line 739

Quoted 5 lines
fs/bio-integrity.c +1 -1
        if (bs->bvec_integrity_pool)
-               mempool_destroy(bs->bio_integrity_pool);
+               mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);

Kent, do you want to chime in on this? Looks like an obvious error to me, but maybe I'm missing something and we should teach Coverity to shut up about it.

Sorry - no, this is definitely a bug:

Quoted 8 lines
Quoted 1 line

From my v3.12-rc1 reminder list: what's going on with this patch?

It's been acked, Gu asked whether he could include it in some patchset, I see a Sep 11 2013 patch from Gu upstream already (bc5c8f078), but this patch (from May 29 2013) still hasn't gone anywhere. Why is this so hard?

Queued up.

Signature · 1 line
Jens Axboe