Re: [v3 for-next 1/3] block: Reject unknown status tags in error injection rules
From: Christoph Hellwig
Date: Fri Nov 06 2026 - 03:03:57 EST
On Thu, Nov 05, 2026 at 09:00:27PM +0100, Haris Iqbal wrote:
>> Doing it this way will result in use-after-free. "tag" has already been
>> freed above.
>>
>> Maybe change tag_to_blk_status() to return an int (0 on success and
>> -EINVAL on failure) and use its return value without mapping it?
>
> I am not sure I get your suggestion completely. Even if we change the
> return type of tag_to_blk_status(), we would have to free the "tag" before
> returning.
Let's just ignore my suggestion as it obviously does not work.