Re: [PATCH] blkmq: Fix NULL pointer deref when all reserved tags in use

From: Jens Axboe
Date: Wed Mar 18 2015 - 17:51:16 EST


On 03/18/2015 03:06 PM, Sam Bradshaw wrote:

Good catch! But why not put the hctx == NULL check in as a conditional
in bt_get() before running the queue? I can't imagine other cases where
calling blk_mq_run_hw_queue() with hctx == NULL would be a valid
scenario.

The change was meant to be broad in scope. A runtime NULL deref is a
rather unfortunate way to determine that there are other invalid scenarios.

Normally those kinds of issues would trigger quickly and it'd be obvious. Granted, this was an error handling case for the special case of reserved tags, so it persisted longer than it should have... But in general, I would not be too worried.

But given that both approaches fix the immediate problem, I'd be happy
to change the patch as you suggest.

Thanks!

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/