[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D4F25A3.1090401@redhat.com>
Date: Sun, 06 Feb 2011 23:50:11 +0100
From: Milan Broz <mbroz@...hat.com>
To: Jesper Juhl <jj@...osbits.net>
CC: linux-kernel@...r.kernel.org, Alexander Kjeldaas <astor@...t.no>,
David Woodhouse <David.Woodhouse@...el.com>,
Herbert Xu <herbert@...dor.hengli.com.au>,
Pekka Enberg <penberg@...helsinki.fi>
Subject: Re: NULL deref in drivers/md/dm-crypt.c:crypt_convert()
On 02/06/2011 11:31 PM, Jesper Juhl wrote:
> The coverity checker found this. I don't know how to fix it, so I'll just
> report it and hope that someone else can address the issue.
Hi,
can I see the plain output from the coverity check somewhere?
>
> In drivers/md/dm-crypt.c:crypt_convert() we have this code:
> ...
> while(ctx->idx_in < ctx->bio_in->bi_vcnt &&
> ctx->idx_out < ctx->bio_out->bi_vcnt) {
>
> crypt_alloc_req(cc, ctx);
Here in crypt_alloc_req() you have:
struct crypt_cpu *this_cc = this_crypt_config(cc);
if (!this_cc->req)
this_cc->req = mempool_alloc(cc->req_pool, GFP_NOIO);
>
> atomic_inc(&ctx->pending);
>
> r = crypt_convert_block(cc, ctx, this_cc->req);
this_cc is: struct crypt_cpu *this_cc = this_crypt_config(cc);
and because it is always running on the same CPU,
this_cc->req cannot be NULL here, because it was allocated
in crypt_alloc_req().
It is false positive here.
Milan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists