lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 16 Dec 2008 23:34:26 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Arjan van de Ven <arjan@...radead.org>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Pekka Enberg <penberg@...helsinki.fi>,
	Frans Pop <elendil@...net.nl>, Eric Anholt <eric@...olt.net>,
	nix.or.die@...glemail.com, linux-kernel@...r.kernel.org,
	rjw@...k.pl, Yinghai Lu <yinghai@...nel.org>
Subject: Re: Linux 2.6.28-rc8


* Arjan van de Ven <arjan@...radead.org> wrote:

> On Fri, 12 Dec 2008 08:11:35 -0800 (PST)
> Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> 
> > 
> > 
> > On Fri, 12 Dec 2008, Arjan van de Ven wrote:
> > > 
> > > another thing we could do is try to only warn if you cross bar
> > > boundaries but not if you cross other user-of-the-resource
> > > boundaries.
> > 
> > Hmm. We could use the res->flags for this. But I'm not sure non-PCI 
> > resources fill those in correctly.
> > 
> > A pure "busy" allocation (ie a driver marker) would generally have
> > just the IORESOURCE_BUSY bit set, while a real PCI hardware resource
> > will have other bits set (ie the IORESOURCE_IO/MEM bits) and not be
> > marked BUSY.
> > 
> > Maybe just ignoring resources with BUSY set, as they are driver
> > markers rather than actual HW resources.
> 
> something like this: ?

okay, i've applied it in the form below, to tip/core/resources. This in 
combination with the toning down of the messages should do the trick i 
think.

btw., here's a bug that got caught by the sanity checks:

| commit d522af581c6abd0e064278345ca638b0553a93fa
| Author: Suresh Siddha <suresh.b.siddha@...el.com>
| Date:   Mon Oct 20 17:57:02 2008 -0300
|
|     V4L/DVB (9356): [PATCH] saa7134: fix resource map sanity check conflict
|    
|     Impact: driver could possibly stomp on resources outside of its scope

so it's not just nuisance.

> Note: having two drivers talk to the same hardware at the same
> time is obviously not optimal behavior, but that's a separate story.

it will be much more likely to be caught via other misbehavior i guess. 

	Ingo

------------------>
>From 3ac52669c7a24b93663acfcab606d1065ed1accd Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@...ux.intel.com>
Date: Sat, 13 Dec 2008 09:15:27 -0800
Subject: [PATCH] resources: skip sanity check of busy resources

Impact: reduce false positives in iomem_map_sanity_check()

Some drivers (vesafb) only map/reserve a portion of a resource.
If then some other driver comes in and maps the whole resource,
the current code WARN_ON's. This is not the intent of the checks
in iomem_map_sanity_check(); rather these checks want to
warn when crossing *hardware* resources only.

This patch skips BUSY resources as suggested by Linus.

Note: having two drivers talk to the same hardware at the same
time is obviously not optimal behavior, but that's a separate story.

Signed-off-by: Arjan van de Ven <arjan@...ux.intel.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 kernel/resource.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 4337063..e633106 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -853,6 +853,15 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size)
 		if (PFN_DOWN(p->start) <= PFN_DOWN(addr) &&
 		    PFN_DOWN(p->end) >= PFN_DOWN(addr + size - 1))
 			continue;
+		/*
+		 * if a resource is "BUSY", it's not a hardware resource
+		 * but a driver mapping of such a resource; we don't want
+		 * to warn for those; some drivers legitimately map only
+		 * partial hardware resources. (example: vesafb)
+		 */
+		if (p->flags & IORESOURCE_BUSY)
+			continue;
+
 		printk(KERN_WARNING "resource map sanity check conflict: "
 		       "0x%llx 0x%llx 0x%llx 0x%llx %s\n",
 		       (unsigned long long)addr,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ