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] [thread-next>] [day] [month] [year] [list]
Message-Id: <1252707304.18996.739.camel@gandalf.stny.rr.com>
Date:	Fri, 11 Sep 2009 18:15:04 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Carsten Emde <Carsten.Emde@...dl.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Ingo Molnar <mingo@...e.hu>, Li Zefan <lizf@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Prevent NULL pointer dereference in
 ftrace_raw_event_block_bio_bounce

On Sat, 2009-09-12 at 00:05 +0200, Carsten Emde wrote:
> Booting 2.6.31 and executing
>    echo 1 >/sys/kernel/debug/tracing/events/enable
> leads to
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: [<c032a583>] ftrace_raw_event_block_bio_bounce+0x4b/0xb9
> 
> Apparently,
>    bio = bio_map_user(q, NULL, uaddr, len, reading, gfp_mask);
> is called in block/blk-map.c:58 where bio->bi_bdev in set to NULL and 
> still is NULL when an attempt is made to evaluate bio->bi_bdev->bd_dev 
> in include/trace/events/block.h:189.
> 
> The tracepoint should ensure bio->bi_bdev is not dereferenced, if NULL.
> 
> Signed-Off-By: Carsten Emde <C.Emde@...dl.org>

Thanks Carsten!

I'll apply it and push it off to Ingo.

-- Steve

> 
> --- a/include/trace/events/block.h 2009-09-11 21:20:56.000000000 +0200
> +++ b/include/trace/events/block.h 2009-09-11 22:01:52.000000000 +0200
> @@ -186,7 +186,8 @@
>   	),
> 
>   	TP_fast_assign(
> -		__entry->dev		= bio->bi_bdev->bd_dev;
> +		__entry->dev		= bio->bi_bdev ?
> +					  bio->bi_bdev->bd_dev : 0;
>   		__entry->sector		= bio->bi_sector;
>   		__entry->nr_sector	= bio->bi_size >> 9;
>   		blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
> 

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