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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 9 May 2008 06:46:06 -0700
From:	"Pallipadi, Venkatesh" <venkatesh.pallipadi@...el.com>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	"Rufus & Azrael" <rufus-azrael@...ericable.fr>,
	"Ingo Molnar" <mingo@...e.hu>,
	"Siddha, Suresh B" <suresh.b.siddha@...el.com>,
	"Linux-kernel Mailing List" <linux-kernel@...r.kernel.org>,
	"Yinghai Lu" <yhlu.kernel@...il.com>,
	"Thomas Gleixner" <tglx@...utronix.de>
Subject: RE: [2.6.25-git18 => 2.6.26-rc1-git1] Xorg crash with	xf86MapVidMem error

 

>-----Original Message-----
>From: H. Peter Anvin [mailto:hpa@...or.com] 
>Sent: Thursday, May 08, 2008 5:53 PM
>To: Pallipadi, Venkatesh
>Cc: Rufus & Azrael; Ingo Molnar; Siddha, Suresh B; 
>Linux-kernel Mailing List; Yinghai Lu; Thomas Gleixner
>Subject: Re: [2.6.25-git18 => 2.6.26-rc1-git1] Xorg crash with 
>xf86MapVidMem error
>
>Venki Pallipadi wrote:
>> 
>> One of the reason for heristic was to get proper type for 
>/dev/mem maps for WB
>> region (ACPI and BIOS area). /dev/mem checks to see the mtrr 
>type of the start
>> address and starts with that type for the request. As long 
>as there are no
>> other conflict in PAT list, we can give WB to this /dev/mem 
>request. Not
>> having this heuristic we will have to most probably default to UC.
>> 
>> When there are overlapping PAT list entries, the mtrr_lookup 
>does not matter
>> as we have to inherit things from those PAT entries or 
>conflicting with them.
>> 
>
>Okay, now here is something...
>
>I don't believe it is kosher for mmap() to behave differently if we 
>called it once or called it twice.

May be I am missing something. Only time mmap will behave differently is
when some of the pre-existing conditions are different. If the MTRRs are
different and/or there has been conflicting mapping in between first and
second mmap. Otherwise, it will be same. We had to do this inheriting
Business if there are other conflicting maps to have compatibility with
All existing /dev/mem users.

>Therefore, the proper behaviour in the case of a range that covers 
>multiple types is to break it down into multiple requests each mapped 
>with the appropriate type, as if mmap had been called separate on each 
>subrange.  In the limiting case, yes, this does mean the subranges can 
>be individual pages, but such an outcome is vanishingly improbable in 
>practice.

We thought about splitting the range. But, in general the interface
requires
us to give one single type of access back. Interfaces like pci accesses
in /sysfs. If user maps the file with mmap, we give one particular type
of mapping.
returning multi type may be a possibility, but that will mean whole new
level of complications in tracking, splitting the vmas, returning this
subrange mapping info to user in some way etc.

Sub-range of a page is probably improbable. But overlaps are common.
That is exactly what is happening with the issue in this thread.
Part of the region is mmaped first (it will get UC_MINUS) and MTRR setup
for WC.
Later a bigger region that includes the first smaller part is being
mmaped. We can
safely return UC_MINUS to this bigger request (without causing any
aliases) and things
will work fine as this bigger mmap does its own MTRR for WC as well.
This is the case
where I feel just maintaining the consistency across the PAT list (which
is UC_MINUS)
here is safe irrespective of any MTRR setting we may have underneath.
Worrying about
MTRR ranges here doesn't seem to add any additional safety-ness.

Thanks,
Venki


--
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