netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] bluetooth: fix NULL-pointer dereferences
@ 2012-03-07 16:01 Johan Hovold
  2012-03-07 16:01 ` [PATCH 1/2] bluetooth: hci_ldisc: fix NULL-pointer dereference on tty_close Johan Hovold
  2012-03-07 16:02 ` [PATCH 2/2] bluetooth: hci_core: fix NULL-pointer dereference at unregister Johan Hovold
  0 siblings, 2 replies; 23+ messages in thread
From: Johan Hovold @ 2012-03-07 16:01 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo F. Padovan
  Cc: David S. Miller, linux-bluetooth, linux-kernel, netdev,
	Johan Hovold

Hi, 

These patches fixes two races in hci_ldisc and hci_core which can lead to
NULL-pointer dereferences.

The first one is 100% reproducible on 3.2 as well as 3.3-rc6 and needs to be
backported to all stable kernels as the offending code has been around for
quite some time.

The second one is 100% reproducible on 3.3-rc6 but I haven't seen it on 3.2 or
earlier, but as far as I can see it could be possibly to trigger it at least on
3.0 and later.


Thanks,
Johan

Johan Hovold (2):
  bluetooth: hci_ldisc: fix NULL-pointer dereference on tty_close
  bluetooth: hci_core: fix NULL-pointer dereference at unregister

 drivers/bluetooth/hci_ldisc.c |    2 +-
 include/net/bluetooth/hci.h   |    1 +
 net/bluetooth/hci_core.c      |    7 +++++++
 3 files changed, 9 insertions(+), 1 deletions(-)

-- 
1.7.8.4

^ permalink raw reply	[flat|nested] 23+ messages in thread
* bluetooth: bug fixes for bluetooth-next
@ 2012-03-15 13:47 Johan Hovold
  2012-03-15 13:48 ` [PATCH 1/2] bluetooth: hci_ldisc: fix NULL-pointer dereference on tty_close Johan Hovold
  0 siblings, 1 reply; 23+ messages in thread
From: Johan Hovold @ 2012-03-15 13:47 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo F. Padovan
  Cc: David S. Miller, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, David Herrmann, Greg KH,
	Johan Hovold

On Wed, Mar 14, 2012 at 11:16:54AM -0700, Marcel Holtmann wrote:
> > > This is a revised series which also contains a minimal fix to the memory leak
> > > discovered by David Hermann upon which the first NULL-pointer-dereference fix
> > > also depends.
> > > 
> > > These patches need to get to Linus ASAP as the problems are present in 3.3-rc6
> > > as well as earlier kernels and thus should be backported to the stable trees as
> > > well.
> > 
> > Any chance to get these into 3.3? Otherwise, is it possible to rebase
> > bluetooth-next on top of these so that Greg can get them into 3.3.1 (and
> > the other stable trees) once bluetooth-next is merged?
> > 
> > All three bugs can be used to crash any kernel with HCI-UART support and
> > can probably be used for exploits as they are extremely easy to trigger
> > reliably.
> 
> only if you have access to the TTY device node in the first place. If
> you do not have access to that device node, you can not crash the
> kernel.
> 
> Can you resend a clean set of patches for bluetooth-next and once we
> have that merged, we can talk on how to backport this to 3.3 and also
> -stable.

I'll respond to this mail with the two NULL-deref fixes against
bluetooth-next of today (44e612b3e6566f0b).

As I've mentioned before, a fix for the memory leak is already in
bluetooth-next and my first patch depends on it. Unfortunately, the
memory-leak fix in bluetooth-next is not a minimal fix but a more
invasive one:

	797fe796c4335b3 ("Bluetooth: uart-ldisc: Fix memory leak and
			  remove destruct cb")
	
and it also depends on a second commit (from bluetooth-next):

	010666a126fce7b ("Bluetooth: Make hci-destruct callback
			  optional")

Neither is marked for stable (and at least the latter probably shouldn't
be).

Please make sure that the memory leak fix also gets backported to
stable. A minimal (2-line) fix can be found here:

	http://marc.info/?l=linux-bluetooth&m=133130797428708&w=2

Thanks,
Johan

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2012-03-15 15:23 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 16:01 [PATCH 0/2] bluetooth: fix NULL-pointer dereferences Johan Hovold
2012-03-07 16:01 ` [PATCH 1/2] bluetooth: hci_ldisc: fix NULL-pointer dereference on tty_close Johan Hovold
2012-03-07 19:33   ` Marcel Holtmann
2012-03-08 11:57     ` Johan Hovold
2012-03-08 17:45       ` Marcel Holtmann
2012-03-09 13:04         ` Johan Hovold
2012-03-09 13:52           ` David Herrmann
2012-03-09 14:40             ` Johan Hovold
2012-03-09 15:02               ` David Herrmann
     [not found]                 ` <CANq1E4TcUKKXetitjWJZgP9550gnB43rncnAcwwdz_6HpZf_Ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-09 15:08                   ` Johan Hovold
2012-03-09 13:44   ` David Herrmann
2012-03-09 14:29     ` Johan Hovold
2012-03-09 14:35       ` David Herrmann
2012-03-09 15:15         ` Johan Hovold
2012-03-07 16:02 ` [PATCH 2/2] bluetooth: hci_core: fix NULL-pointer dereference at unregister Johan Hovold
     [not found]   ` <1331136120-27075-3-git-send-email-jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-07 19:29     ` Marcel Holtmann
2012-03-08 11:56       ` Johan Hovold
2012-03-08 17:43         ` Marcel Holtmann
2012-03-09 12:53           ` [PATCH 2/2 v2] " Johan Hovold
2012-03-09 14:04             ` David Herrmann
     [not found]               ` <CANq1E4Rt0ctZ5cpXipJE--YmkR4OjKBXLBQkeTKWP3+Q-q37Yw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-09 14:48                 ` Johan Hovold
  -- strict thread matches above, loose matches on Subject: below --
2012-03-15 13:47 bluetooth: bug fixes for bluetooth-next Johan Hovold
2012-03-15 13:48 ` [PATCH 1/2] bluetooth: hci_ldisc: fix NULL-pointer dereference on tty_close Johan Hovold
     [not found]   ` <1331819321-13018-1-git-send-email-jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-15 13:48     ` [PATCH 2/2] bluetooth: hci_core: fix NULL-pointer dereference at unregister Johan Hovold
2012-03-15 15:23       ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).