public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PATCH] Driver Core fixes for 2.6.16-rc2
@ 2006-02-06 20:28 Greg KH
  2006-02-06 20:29 ` [PATCH] Fix Userspace interface breakage in power/state Greg KH
  0 siblings, 1 reply; 20+ messages in thread
From: Greg KH @ 2006-02-06 20:28 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel

Here are some driver core fixes for 2.6.16-rc2.  They have all been in
the last -mm with no problems.  They contain the following things:
	- buffer overflow from input MODALIAS expansion
	- spi Kconfig fixes
	- fix IB and DRM's usage of sysfs dev files (both acked by the
	  various subsystem maintainers).
	- oops fix in driver core with power files
	- build warning fixes
	- make it harder to use kobjects incorrectly (fixes an oops).

Please pull from:
	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
or if master.kernel.org hasn't synced up yet:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/

The full patch set will be sent to the linux-kernel mailing list, if
anyone wants to see them.

thanks,

greg k-h

 Documentation/spi/butterfly   |   23 +++++--
 drivers/base/base.h           |    4 +
 drivers/base/bus.c            |    3 
 drivers/base/power/resume.c   |    3 
 drivers/base/power/shutdown.c |    2 
 drivers/base/power/suspend.c  |    3 
 drivers/base/power/sysfs.c    |   24 +++++--
 drivers/base/sys.c            |    3 
 drivers/char/drm/drmP.h       |   10 +--
 drivers/char/drm/drm_stub.c   |    2 
 drivers/char/drm/drm_sysfs.c  |  129 +++++++++---------------------------------
 drivers/infiniband/core/ucm.c |   13 ----
 drivers/spi/Kconfig           |   10 ---
 drivers/spi/spi_butterfly.c   |   36 +++++------
 fs/debugfs/file.c             |    6 -
 lib/kobject.c                 |    9 ++
 lib/kobject_uevent.c          |    2 
 17 files changed, 111 insertions(+), 171 deletions(-)
Adrian Bunk:
      drivers/base/: proper prototypes

Benjamin Herrenschmidt:
      Fix uevent buffer overflow in input layer

Chuck Ebbert:
      kobject: don't oops on null kobject.name

David Brownell:
      SPI: spi_butterfly, restore lost deltas

Greg Kroah-Hartman:
      DRM: fix up classdev interface for drm core
      IB: fix up major/minor sysfs interface for IB core
      kobject_add() must have a valid name in order to succeed.

Pavel Machek:
      Fix Userspace interface breakage in power/state

Russell King:
      Fix compiler warning in driver core for CONFIG_HOTPLUG=N

Vincent Hanquez:
      debugfs: trivial comment fix


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [patch] kobject: don't oops on null kobject.name
@ 2006-01-14 16:18 Chuck Ebbert
  0 siblings, 0 replies; 20+ messages in thread
From: Chuck Ebbert @ 2006-01-14 16:18 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Andrew Morton, Bartlomiej Zolnierkiewicz

In-Reply-To: <20060114034404.GA23061@kroah.com>

On Fri, 13 Jan 2006, Greg KH wrote:

> > I applied your patch to prevent registration of objects with null names on
> > top of my patch, then applied this to see if my test still triggered, and
> > the message was printed:
> 
> What was the message?  What traceback?
> 
> So, I think the point is that it isn't a kobject_add() issue, right?

My message was printed:

        get_kobj_path_length: encountered NULL name

So an uninitialized kobject was passed to kobject_get_path().

This is likely a problem somewhere in IDE when "hdx=ide-scsi' is used.
-- 
Chuck
Currently reading: _Olympos_ by Dan Simmons

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [patch] kobject: don't oops on null kobject.name
@ 2006-01-14  3:07 Chuck Ebbert
  2006-01-14  3:44 ` Greg KH
  0 siblings, 1 reply; 20+ messages in thread
From: Chuck Ebbert @ 2006-01-14  3:07 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

In-Reply-To: <20060114000246.GA7549@kroah.com>

On Fri, 13 Jan 2006, Greg KH wrote:

> Hm, I looked at the only user of kobjects in the kernel that I know of
> that doesn't use sysfs (the cdev code) and even it sets the kobject name
> to something sane, so I think we should be safe with this.

Well, something is still wrong.

I applied your patch to prevent registration of objects with null names on
top of my patch, then applied this to see if my test still triggered, and
the message was printed:


--- 2.6.15a.orig/lib/kobject.c
+++ 2.6.15a/lib/kobject.c
@@ -72,8 +72,10 @@ static int get_kobj_path_length(struct k
 	 * Add 1 to strlen for leading '/' of each level.
 	 */
 	do {
-		if (kobject_name(parent) == NULL)
+		if (kobject_name(parent) == NULL) {
+			printk("get_kobj_path_length: encountered NULL name\n");
 			return 0;
+		}
 		length += strlen(kobject_name(parent)) + 1;
 		parent = parent->parent;
 	} while (parent);


To reproduce:

Start with vanilla 2.6.15 and apply the three patches, which I called:

        kobject_dont_register_null_name.patch  <- my original
        kobject_handle_null_object_name.patch  <- Greg's
        kobject_debug_null_path.patch          <- included above

On a machine with an ATAPI CD-ROM, boot with "hdx=ide-scsi" where
hdx is the CD-ROM's drivename.  Then try to mount a CD:

        mount -t iso9660 /dev/hdx /mnt/cdrom

Note that hdx is being controlled by ide-scsi so this should fail.  You
will see the message from my new patch print in the kernel log.

NOTE:  This won't happen on 2.6.15-current because
fs/super.c::kill_block_super() no longer calls kobject_uevent().

-- 
Chuck
Currently reading: _Olympos_ by Dan Simmons

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [patch] kobject: don't oops on null kobject.name
@ 2006-01-14  3:07 Chuck Ebbert
  0 siblings, 0 replies; 20+ messages in thread
From: Chuck Ebbert @ 2006-01-14  3:07 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, greg

In-Reply-To: <20060113143013.0ed0f9c0.akpm@osdl.org>
References: <20060110184624.GA6721@aitel.hist.no>

On Fri, 13 Jan 2006, Andrew Morton wrote:

> Why did you choose kobject_get_path()?

This is the piece of code that was oopsing in Helge Hafting's
bug report: "2.6.15 OOPS while trying to mount cdrom".  This
patch solves that by fixing the symptoms.

Details are in that thread.
-- 
Chuck
Currently reading: _Olympos_ by Dan Simmons

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [patch] kobject: don't oops on null kobject.name
@ 2006-01-13  1:02 Chuck Ebbert
  2006-01-13 22:30 ` Andrew Morton
  0 siblings, 1 reply; 20+ messages in thread
From: Chuck Ebbert @ 2006-01-13  1:02 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

kobject_get_path() will oops if one of the component names is
NULL.  Fix that by returning NULL instead of oopsing.

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
---

Helge, this fixes your "2.6.15 OOPS while trying to mount cdrom".

Probably not the best fix, but It Works For Me (TM).

--- 2.6.15a.orig/lib/kobject.c
+++ 2.6.15a/lib/kobject.c
@@ -72,6 +72,8 @@ static int get_kobj_path_length(struct k
 	 * Add 1 to strlen for leading '/' of each level.
 	 */
 	do {
+		if (kobject_name(parent) == NULL)
+			return 0;
 		length += strlen(kobject_name(parent)) + 1;
 		parent = parent->parent;
 	} while (parent);
@@ -107,6 +109,8 @@ char *kobject_get_path(struct kobject *k
 	int len;
 
 	len = get_kobj_path_length(kobj);
+	if (len == 0)
+		return NULL;
 	path = kmalloc(len, gfp_mask);
 	if (!path)
 		return NULL;
-- 
Chuck
Currently reading: _Olympos_ by Dan Simmons

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

end of thread, other threads:[~2006-02-06 20:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06 20:28 [GIT PATCH] Driver Core fixes for 2.6.16-rc2 Greg KH
2006-02-06 20:29 ` [PATCH] Fix Userspace interface breakage in power/state Greg KH
2006-02-06 20:29   ` [PATCH] DRM: fix up classdev interface for drm core Greg KH
2006-02-06 20:29     ` [PATCH] IB: fix up major/minor sysfs interface for IB core Greg KH
2006-02-06 20:29       ` [PATCH] SPI: spi_butterfly, restore lost deltas Greg KH
2006-02-06 20:29         ` [PATCH] kobject: don't oops on null kobject.name Greg KH
2006-02-06 20:29           ` [PATCH] kobject_add() must have a valid name in order to succeed Greg KH
2006-02-06 20:29             ` [PATCH] Fix compiler warning in driver core for CONFIG_HOTPLUG=N Greg KH
2006-02-06 20:29               ` [PATCH] drivers/base/: proper prototypes Greg KH
2006-02-06 20:29                 ` [PATCH] debugfs: trivial comment fix Greg KH
2006-02-06 20:29                   ` [PATCH] Fix uevent buffer overflow in input layer Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2006-01-14 16:18 [patch] kobject: don't oops on null kobject.name Chuck Ebbert
2006-01-14  3:07 Chuck Ebbert
2006-01-14  3:44 ` Greg KH
2006-01-14  3:07 Chuck Ebbert
2006-01-13  1:02 Chuck Ebbert
2006-01-13 22:30 ` Andrew Morton
2006-01-13 22:55   ` Greg KH
2006-01-13 23:12     ` Andrew Morton
2006-01-14  0:02       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox