public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Lee Jones <lee.jones@canonical.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Russell King <rmk@arm.linux.org.uk>
Subject: Re: [PATCH] Stop ARM boards crashing when CUPS is loaded - 2.6.35-rc5
Date: Thu, 15 Jul 2010 13:02:14 -0700	[thread overview]
Message-ID: <20100715130214.4c9303b2.akpm@linux-foundation.org> (raw)
In-Reply-To: <4C3C72C6.4000005@canonical.com>

(cc linux-arm-kernel)

On Tue, 13 Jul 2010 15:05:58 +0100
Lee Jones <lee.jones@canonical.com> wrote:

> >From 219005d9522043bc42ddb51d59688959eed0d443 Mon Sep 17 00:00:00 2001
> From: Lee Jones <lee.jones@canonical.com>
> Date: Tue, 13 Jul 2010 15:02:17 +0100
> Subject: [PATCH] UBUNTU: [Upstream] Stop ARM boards crashing when CUPS is loaded
> 
> BugLink: http://bugs.launchpad.net/bugs/601226
> 
> When CUPS loads, it tries to load several drivers that it may need.
> When one of these drivers, specifically parport_pc is loaded on ARM
> based systems, it causes a segmentation fault as the ISA addresses
> which are attempted are not writable on non-PC based architectures.
> This code prevents ISA addresses from being attempted except on x86.
> 

That sounds like a pretty serious problem.  But presumably it isn't -
otherwise it would have been fixed earlier!

So what actions are required to trigger this bug and why aren't others
seeing it?

>  arch/arm/include/asm/parport.h |    7 +++++--

This should probably go via the arm tree.

> 
> diff --git a/arch/arm/include/asm/parport.h b/arch/arm/include/asm/parport.h
> index 26e94b0..a1874f8 100644
> --- a/arch/arm/include/asm/parport.h
> +++ b/arch/arm/include/asm/parport.h
> @@ -9,10 +9,13 @@
>  #ifndef __ASMARM_PARPORT_H
>  #define __ASMARM_PARPORT_H
>  
> -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
>  static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)

It's strange that this function isn't marked inline.  It's in a .h
file.  But many arch/*/include/asm/parport.h's do it this way.  They're
probably broken.  It adds a risk that unneeded code will be generated
into each compilation unit which includes these headers, although gcc
can probably fix that, depending on the version.  Plus it's plain odd.

>  {
> -	return parport_pc_find_isa_ports (autoirq, autodma);
> +/* parport_pc_find_isa_ports uses direct register addresses which are
> + * only correct on x86 architectures. This may have undesirable
> + * consequences (including segfaults) when used on other architectures.
> + */
> +	return 0;
>  }

That comment layout is whacky.  I did this:

--- a/arch/arm/include/asm/parport.h~parport-prevent-arm-boards-frmo-crashing-when-cups-is-loaded-fix
+++ a/arch/arm/include/asm/parport.h
@@ -9,12 +9,13 @@
 #ifndef __ASMARM_PARPORT_H
 #define __ASMARM_PARPORT_H
 
-static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
+static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma)
 {
-/* parport_pc_find_isa_ports uses direct register addresses which are
- * only correct on x86 architectures. This may have undesirable
- * consequences (including segfaults) when used on other architectures.
- */
+	/*
+	 * parport_pc_find_isa_ports() uses direct register addresses which are
+	 * only correct on x86 architectures. This may have undesirable
+	 * consequences (including segfaults) when used on other architectures.
+	 */
 	return 0;
 }
 
_


  reply	other threads:[~2010-07-15 20:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 14:05 [PATCH] Stop ARM boards crashing when CUPS is loaded - 2.6.35-rc5 Lee Jones
2010-07-15 20:02 ` Andrew Morton [this message]
2010-07-15 20:06   ` Russell King - ARM Linux
2010-07-16  9:08     ` Lee Jones
2010-07-16  9:20       ` Russell King - ARM Linux
2010-07-16  9:32         ` Lee Jones
2010-07-16 11:12           ` Lee Jones
2010-07-26 22:26             ` Greg KH
2010-07-16 16:23           ` Milton Miller
2010-07-16 16:42             ` Lee Jones
2010-07-16 19:38               ` Milton Miller
2010-07-16 20:54                 ` Russell King - ARM Linux
2010-07-16  9:37       ` Martin Michlmayr
2010-07-16 13:27         ` Woody Suwalski

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=20100715130214.4c9303b2.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=lee.jones@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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