X won't start: xf86MapVidMem: Could not mmap framebuffer (0

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby spender » Tue Jan 25, 2011 3:00 pm

Make those changes above to drivers/char/mem.c and post the messages from dmesg that get printed, also send me your vmlinux (not vmlinuz) file after having built a kernel with those changes.

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby mike33 » Thu Jan 27, 2011 10:10 am

dmesg:

http://ompldr.org/vNzZhbg/dmesg.txt

Excerpt:
Code: Select all
[   27.144489] input: ACPI Virtual Keyboard Device as /devices/virtual/input/input9
[   28.250641] failed valid_mmap_phys_addr_range!
[   28.686392] pci 0000:01:05.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[   28.702318] failed valid_mmap_phys_addr_range!


xorg.log:

http://ompldr.org/vNzZhcw/xorg.log

Excerpt:

Code: Select all
(II) Module vgahw: vendor="X.Org Foundation"
   compiled for 1.7.7, module version = 0.1.0
   ABI class: X.Org Video Driver, version 6.0
(II) RADEON(0): vgaHWGetIOBase: hwp->IOBase is 0x03d0, hwp->PIOOffset is 0x0000
(==) RADEON(0): RGB weight 888
(II) RADEON(0): Using 8 bits per RGB (8 bit DAC)
(--) RADEON(0): Chipset: "ATI Mobility Radeon HD 4200" (ChipID = 0x9712)
(--) RADEON(0): Linear framebuffer at 0x00000000e0000000
(II) RADEON(0): PCI card detected
(II) Loading sub module "int10"
(II) LoadModule: "int10"
(II) Loading /usr/lib/xorg/modules/libint10.so
(II) Module int10: vendor="X.Org Foundation"
   compiled for 1.7.7, module version = 1.0.0
   ABI class: X.Org Video Driver, version 6.0
(II) RADEON(0): initializing int10

Fatal server error:
xf86MapVidMem: Could not mmap framebuffer (0x000a0000,0x20000) (Invalid argument)
mike33
 
Posts: 15
Joined: Tue Jan 18, 2011 9:53 am

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby spender » Thu Jan 27, 2011 10:36 am

in arch/x86/include/asm/io.h, change:
Code: Select all
static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t count)
{
        return (pfn + (count >> PAGE_SHIFT)) < (1 << (boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) ? 1 : 0;
}


to:

Code: Select all
static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t count)
{
        printk(KERN_ALERT "pfn=%08lx, count=%08lx, phys_bits=%u\n", pfn, count, boot_cpu_data.x86_phys_bits);
        return (pfn + (count >> PAGE_SHIFT)) < (1 << (boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) ? 1 : 0;
}


and send me the new dmesg.

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby PaX Team » Thu Jan 27, 2011 11:25 am

can you post /proc/cpuinfo please?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby mike33 » Thu Jan 27, 2011 2:14 pm

AMD Turion(tm) II Dual-Core Mobile M500
stepping: 2
Mhz: 2200
cache sizeL 512 kb
physical id: 0
siblings: 2
core id: 0
cpu cores: 2
apicid: 0
initial apicid: 0
fdiv_bug: no
hlt_bug: no
f00f_bug: no
coma_bug: no
fpu: yes
fpu_exception: yes
cpuid level: 5
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
bogomips: 4388.80
clflush size: 64
cache_alignment: 64
address sizes: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100 mhzsteps hwpstate

(and then there is a 2nd listing for the other core, similar.)
hope I copied that right

Compiling new kernel as asked: getting warnings:
format %08lx expects type 'long unsigned int', but argument has type size_t
mike33
 
Posts: 15
Joined: Tue Jan 18, 2011 9:53 am

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby spender » Thu Jan 27, 2011 3:08 pm

It's fine, you can ignore that warning.

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby spender » Thu Jan 27, 2011 4:31 pm

The PaX Team suggested something: if you change:

Code: Select all
static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t count)
{
        return (pfn + (count >> PAGE_SHIFT)) < (1 << (boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) ? 1 : 0;
}


to:

Code: Select all
static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t count)
{
        return (pfn + (count >> PAGE_SHIFT)) < (1ULL << (boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) ? 1 : 0;
}


it should resolve this issue.

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby mike33 » Thu Jan 27, 2011 7:36 pm

http://ompldr.org/vNzZrOQ/dmesg2.txt
excerpt:
Code: Select all
[   20.164749] input: ACPI Virtual Keyboard Device as /devices/virtual/input/input9
[   21.310629] pfn=000000f8, count=00001000, phys_bits=48
[   21.326835] failed valid_mmap_phys_addr_range!
[   21.766392] pci 0000:01:05.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[   21.782323] pfn=000000a0, count=00020000, phys_bits=48
[   21.782331] failed valid_mmap_phys_addr_range!


http://ompldr.org/vNzZrYQ/cpuinfo.txt
Code: Select all
processor   : 0
vendor_id   : AuthenticAMD
cpu family   : 16
model      : 6
model name   : AMD Turion(tm) II Dual-Core Mobile M500
stepping   : 2
cpu MHz      : 800.000
cache size   : 512 KB
physical id   : 0
siblings   : 2
core id      : 0
cpu cores   : 2
apicid      : 0
initial apicid   : 0
fdiv_bug   : no
hlt_bug      : no
f00f_bug   : no
coma_bug   : no
fpu      : yes
fpu_exception   : yes
cpuid level   : 5
wp      : yes
flags      : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
bogomips   : 4389.35
clflush size   : 64
cache_alignment   : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor   : 1
vendor_id   : AuthenticAMD
cpu family   : 16
model      : 6
model name   : AMD Turion(tm) II Dual-Core Mobile M500
stepping   : 2
cpu MHz      : 2200.000
cache size   : 512 KB
physical id   : 0
siblings   : 2
core id      : 1
cpu cores   : 2
apicid      : 1
initial apicid   : 1
fdiv_bug   : no
hlt_bug      : no
f00f_bug   : no
coma_bug   : no
fpu      : yes
fpu_exception   : yes
cpuid level   : 5
wp      : yes
flags      : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
bogomips   : 4389.04
clflush size   : 64
cache_alignment   : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

mike33
 
Posts: 15
Joined: Tue Jan 18, 2011 9:53 am

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby mike33 » Thu Jan 27, 2011 9:01 pm

Spender, PaX_Team: that worked.

Can I reenable PAT and disable embed now? (What is PAT?)
(What did that do btw, I saw something about dividing the memory along the 1gb boundary, does that mean my programs can only use the remaining 1gb? (often I need 2gb to compile a nexuiz/xonotic map (though I don't do much mapping anymore as I got totally kicked out of the "community" and the main developer now hates me due to social views)))

Should I enable kernel stack memory randomization? (Is it safe).

What about future kernels, shall I apply this patch in them too, or will this be in main?

Thank you so much for helping me here (unlike the debian forum which just disparaged GRSecurity instead of helping)
mike33
 
Posts: 15
Joined: Tue Jan 18, 2011 9:53 am

Re: X won't start: xf86MapVidMem: Could not mmap framebuffer

Postby spender » Thu Jan 27, 2011 11:20 pm

This fix will be included in the next patch. You can change any config options back to their previous state now. Kernel stack randomization is safe to enable.

BTW, if this is MikeeUSA (as I now realize it is) -- please keep any "social views" off this forum. I'm sure you realize by now it was the reason for your being moderated on the mailing list and your previous account/posts deleted here.

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm

Previous

Return to grsecurity support

cron