mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "David Woodhouse" <dwmw2@infradead.org>,
	"Jiri Kosina" <jkosina@suse.cz>,
	"Michal Piotrowski" <michal.k.k.piotrowski@gmail.com>,
	marcel@holtmann.org, "Andrew Morton" <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	reiserfs-devel@vger.kernel.org,
	"Vladimir V. Saveliev" <vs@namesys.com>,
	"Randy Dunlap" <randy.dunlap@oracle.com>,
	linux-ide@vger.kernel.org, "David Chinner" <dgc@sgi.com>,
	sparclinux@vger.kernel.org, "David Miller" <davem@davemloft.net>,
	"Mikael Pettersson" <mikpe@it.uu.se>,
	"Mark Fortescue" <mark@mtfhpc.demon.co.uk>,
	"William Lee Irwin III" <wli@holomorphy.com>,
	"Greg KH" <greg@kroah.com>
Subject: Re: [1/2] 2.6.22-rc7: known regressions
Date: Thu, 5 Jul 2007 17:03:48 -0400	[thread overview]
Message-ID: <d120d5000707051403r1d946375nb119ff86b26580ef@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.0.98.0707051236410.9434@woody.linux-foundation.org>

On 7/5/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> Looks input-related..
>
> On Thu, 5 Jul 2007, David Woodhouse wrote:
> >
> > Hm, it's not something new. It's an oops I saw occasionally in 2.6.21-rc
> > too, whenever we had CONFIG_SYSFS_DEPRECATED set.
> >
> >  Unable to handle kernel paging request for data at address 0x6b6b6b6b
>
> Ok, that 0x6b is obviously the kfree() poisoning, ie it looks like a
> use-after-free problem with a pointer being loaded from a structure that
> had been free'd-
>
> And the trace seems to be (ignore the unreliable one):
>
> >  NIP [c001870c] strlen+0x4/0x18
> >  LR [c0134fec] kobject_get_path+0x34/0xc4
> >  Call Trace:
> >  [eed5be90] [c01d5124] class_uevent+0xac/0x1bc
> >  [eed5bed0] [c01357e4] kobject_uevent_env+0x23c/0x460
> >  [eed5bf20] [c01d485c] class_device_del+0x178/0x1a0
> >  [eed5bf40] [c01d489c] class_device_unregister+0x18/0x30
> >  [eed5bf60] [c021f820] input_unregister_device+0xf4/0x130
> >  [eed5bf70] [c0242f4c] hidinput_disconnect+0x2c/0x60
> >  [eed5bf90] [f27f2bac] hidp_session+0x550/0x584 [hidp]
> >  [eed5bff0] [c0013e28] kernel_thread+0x44/0x60
>
> Where we have a few missing functions due to inlining, ie the real
> sequence seems to be:
>
> class_device_del ->
>  kobject_uevent_env ->
>    class_uevent ->
>      kobject_get_path ->
>        get_kobj_path_length ->
>          parent = kobj;
>          do {
>            strlen(parent->k_name /* kobject_name(parent) */);
>            parent = parent->parent;
>          } while (parent);
>
> so either the kobj or one of it's parents had already been freed when it
> was unregistered due to the disconnect.
>
> I'm not seeing any reference counting or other protection for the device
> ("input") on "hid->inputs" list. But I don't know the code. Dmitry? Jiri?
>

In hidinput_connect we do:

          input_dev->dev.parent = hid->dev;

This should pin hid object untill all inputs are released. However
bluetooth does not use driver model and does not have hid->dev set up
and so it looks like we are simply trying to unregister an input
device that is already gone... I still don't quite get how we
unregister the same device twice - it is done from a per-hid-device
thread in hidp...

-- 
Dmitry

  reply	other threads:[~2007-07-05 21:04 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-03 16:45 Michal Piotrowski
2007-07-03 17:29 ` Sparc32: random invalid instruction occourances on sparc32 (sun4c) Mark Fortescue
2007-07-03 18:57   ` [PATCH] " Mark Fortescue
2007-07-03 19:26     ` David Woodhouse
2007-07-03 21:25       ` Mark Fortescue
2007-07-03 21:56         ` David Woodhouse
2007-07-03 22:47           ` Mark Fortescue
2007-07-03 23:36             ` David Woodhouse
2007-07-04  3:27               ` Mark Fortescue
2007-07-04  3:33                 ` David Woodhouse
2007-07-04 10:27                   ` Mark Fortescue
2007-07-04 14:46                     ` David Woodhouse
2007-07-04 18:38                       ` Mark Fortescue
2007-07-03 21:41       ` David Miller
2007-07-03 22:01         ` David Woodhouse
2007-07-03 17:50 ` [1/2] 2.6.22-rc7: known regressions Bartlomiej Zolnierkiewicz
2007-07-03 23:09   ` David Chinner
2007-07-05  0:20 ` David Woodhouse
2007-07-05  1:26 ` [PATCH 2.6.22 REGRESSION] Fix slab redzone alignment David Woodhouse
2007-07-05  1:42 ` [1/2] 2.6.22-rc7: known regressions David Woodhouse
2007-07-05 16:28   ` Linus Torvalds
2007-07-05 16:43     ` David Woodhouse
2007-07-05 18:46     ` David Woodhouse
2007-07-05 19:31       ` David Woodhouse
2007-07-05 19:51         ` Linus Torvalds
2007-07-05 21:03           ` Dmitry Torokhov [this message]
2007-07-06 22:50             ` Jiri Kosina
2007-07-07  0:33               ` Dmitry Torokhov
2007-07-07  1:05                 ` Jiri Kosina
2007-07-07  1:28                   ` David Woodhouse
2007-07-07  2:25                     ` David Woodhouse
2007-07-07 18:28                       ` Marcel Holtmann
2007-07-07 18:36                         ` Linus Torvalds
2007-07-07 18:58                           ` [PATCH] Fix use-after-free oops in Bluetooth HID David Woodhouse
2007-07-07 19:27                             ` Linus Torvalds
2007-07-09  2:32                             ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d120d5000707051403r1d946375nb119ff86b26580ef@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=dgc@sgi.com \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=jkosina@suse.cz \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mark@mtfhpc.demon.co.uk \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=mikpe@it.uu.se \
    --cc=randy.dunlap@oracle.com \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vs@namesys.com \
    --cc=wli@holomorphy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®