lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <53626583.5030604@kernel.dk>
Date:	Thu, 01 May 2014 09:17:23 -0600
From:	Jens Axboe <axboe@...nel.dk>
To:	Ming Lei <tom.leiming@...il.com>, linux-kernel@...r.kernel.org
CC:	Christoph Hellwig <hch@....de>
Subject: Re: [PATCH] block: null_blk: fix use after free

On 05/01/2014 01:12 AM, Ming Lei wrote:
> entry(cmd->ll_list) may belong to new request once end_cmd()
> returns, so fix the bug with the patch.
> 
> Without the change, it is easy to observe oops when
> doing null_blk(timer) test.
> 
> Signed-off-by: Ming Lei <tom.leiming@...il.com>
> ---
>  drivers/block/null_blk.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
> index 8e7e3a0..e932398 100644
> --- a/drivers/block/null_blk.c
> +++ b/drivers/block/null_blk.c
> @@ -203,8 +203,8 @@ static enum hrtimer_restart null_cmd_timer_expired(struct hrtimer *timer)
>  		entry = llist_reverse_order(entry);
>  		do {
>  			cmd = container_of(entry, struct nullb_cmd, ll_list);
> -			end_cmd(cmd);
>  			entry = entry->next;
> +			end_cmd(cmd);
>  		} while (entry);
>  	}

Good catch, applied.

-- 
Jens Axboe

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ