public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Olof Johansson <olof@lixom.net>,
	Hari Kanigeri <h-kanigeri2@ti.com>, Suman Anna <s-anna@ti.com>,
	Benoit Cousson <b-cousson@ti.com>, Arnd Bergmann <arnd@arndb.de>,
	Tony Lindgren <tony@atomide.com>, Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org,
	Grant Likely <grant.likely@secretlab.ca>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	akpm@linux-foundation.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/4] drivers: hwspinlock: add generic framework
Date: Fri, 26 Nov 2010 10:45:48 +0000	[thread overview]
Message-ID: <20101126104548.GG9310@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTimS-cSi1B5LdtwhJWhKDuFKOYG1j_p-iQiH=zRe@mail.gmail.com>

On Fri, Nov 26, 2010 at 12:16:39PM +0200, Ohad Ben-Cohen wrote:
> On Fri, Nov 26, 2010 at 11:18 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Fri, Nov 26, 2010 at 10:53:10AM +0200, Ohad Ben-Cohen wrote:
> >> >> +int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
> >> >> +{
> >> >> +     int ret;
> >> >> +
> >> >> +     if (unlikely(!hwlock)) {
> >> >> +             pr_err("invalid hwlock\n");
> >> >
> >> > These kind of errors can get very spammy for buggy drivers.
> >>
> >> Yeah, but that's the purpose - I want to catch such egregious drivers
> >> who try to crash the kernel.
> >
> > That can be better - because you get a backtrace, and it causes people
> > to report the problem rather than just ignore it.  It may also prevent
> > the driver author releasing his code (as it won't work on their
> > initial testing.)
> >
> ...
> >
> > If it's "extremely buggy behaviour" then the drivers deserve to crash.
> > Such stuff should cause them not to get out the door.  A simple printk
> > with an error return can just be ignored.
> 
> I like this approach too, but recently we had a few privilege
> escalation exploits which involved NULL dereference kernel bugs
> (process context mapped address 0 despite a positive mmap_min_addr).

That's not a concern on ARM.  The prevention of having a user page mapped
at virtual address 0 does not rely on mmap_min_addr - in fact, we can't
use this as it's tuneable to enforce this requirement.

It's highly illegal on ARM - as ARM CPUs without vector remap place the
hardware vectors at virtual address 0, and as such allowing the user to
map a page there will take the system down.  So we have this code in the
mmap path:

#define arch_mmap_check(addr, len, flags) \
        (((flags) & MAP_FIXED && (addr) < FIRST_USER_ADDRESS) ? -EINVAL : 0)

which prevents any attempt what so ever, irrespective of the mmap_min_addr
setting, to create a userspace induced mapping at address 0.

  reply	other threads:[~2010-11-26 10:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 15:38 [PATCH v2 0/4] Introduce common hardware spinlock interface Ohad Ben-Cohen
2010-11-23 15:38 ` [PATCH v2 1/4] drivers: hwspinlock: add generic framework Ohad Ben-Cohen
2010-11-24  7:44   ` Kamoolkar, Mugdha
2010-11-24 19:59     ` Ohad Ben-Cohen
2010-11-25  3:59       ` David Brownell
2010-11-25  6:40         ` Ohad Ben-Cohen
2010-11-25 20:22           ` David Brownell
2010-11-26  7:34             ` Ohad Ben-Cohen
2010-11-27  1:24               ` David Brownell
2010-11-29  9:57                 ` Ohad Ben-Cohen
2010-11-25  6:05       ` Kamoolkar, Mugdha
2010-11-25 14:29         ` Ohad Ben-Cohen
2010-11-26  4:59   ` Olof Johansson
2010-11-26  7:18     ` Grant Likely
2010-11-26 21:00       ` Olof Johansson
2010-11-26  8:53     ` Ohad Ben-Cohen
2010-11-26  9:18       ` Russell King - ARM Linux
2010-11-26 10:16         ` Ohad Ben-Cohen
2010-11-26 10:45           ` Russell King - ARM Linux [this message]
2010-11-26 22:18             ` Ohad Ben-Cohen
2010-11-26 22:53               ` Russell King - ARM Linux
2010-11-29  9:46                 ` Ohad Ben-Cohen
2010-11-26 22:51       ` Olof Johansson
2010-11-29 21:31         ` Ohad Ben-Cohen
2010-11-30 19:00   ` Tony Lindgren
2010-11-30 22:20     ` Ohad Ben-Cohen
2010-11-30 22:23       ` Tony Lindgren
2010-11-23 15:38 ` [PATCH v2 2/4] drivers: hwspinlock: add OMAP implementation Ohad Ben-Cohen
2010-11-23 23:23   ` Ionut Nicu
2010-11-24 10:33     ` Ohad Ben-Cohen
2010-11-23 15:38 ` [PATCH v2 3/4] OMAP4: hwmod data: Add hwspinlock Ohad Ben-Cohen
2010-11-23 15:39 ` [PATCH v2 4/4] omap: add hwspinlock device Ohad Ben-Cohen

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=20101126104548.GG9310@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=b-cousson@ti.com \
    --cc=grant.likely@secretlab.ca \
    --cc=greg@kroah.com \
    --cc=h-kanigeri2@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=olof@lixom.net \
    --cc=s-anna@ti.com \
    --cc=tony@atomide.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