[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] identify a Xen PV domU to fix devmem_is_allowed



On Mon, Feb 29, Konrad Rzeszutek Wilk wrote:

> .. A fix for what issue?

#include <unistd.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(void)
{
        unsigned long long *p;
        int fd;
        fd = open("/dev/mem", O_RDWR);
        if (fd < 0) {
                perror("/dev/mem");
                return 1;
        }
        p = mmap(NULL, 4096, PROT_READ, MAP_PRIVATE, fd, 0);
        if (p != MAP_FAILED) {
                printf("p %p: %016llx\n", p, *p);
                munmap(p, 4096);
        }
        close(fd);
        return 0;
}

# ./t
[ 1627.491281] ------------[ cut here ]------------
[ 1627.491911] WARNING: CPU: 0 PID: 2004 at ../arch/x86/xen/multicalls.c:129 
xen_mc_flush+0x1c5/0x1d0()
[ 1627.492739] Modules linked in: dm_mod af_packet iscsi_ibft iscsi_boot_sysfs 
coretemp crct10dif_pclmul joydev crc32_pclmul crc32c_intel xen_kbdfront 
xen_fbfront fb_sys_fops syscopyarea sysfillrect sysimgblt xen_netfront 
aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd pcspkr 
xen_blkfront sg
[ 1627.494511] CPU: 0 PID: 2004 Comm: t Tainted: G        W       
4.4.2-1-default #1
[ 1627.494958]  ffffffff81a47bf1 ffff88000240fc10 ffffffff8137eb99 
0000000000000000
[ 1627.495417]  ffff88000240fc48 ffffffff8107c552 ffff88003f80a2e0 
0000000000000001
[ 1627.495881]  00007f53e5e81000 0000000000000000 00007f53e5e81000 
ffff88000240fc58
[ 1627.496365] Call Trace:
[ 1627.496834]  [<ffffffff8101a095>] try_stack_unwind+0x175/0x190
[ 1627.497315]  [<ffffffff81018fe9>] dump_trace+0x69/0x3a0
[ 1627.497792]  [<ffffffff8101a0fb>] show_trace_log_lvl+0x4b/0x60
[ 1627.498274]  [<ffffffff8101942c>] show_stack_log_lvl+0x10c/0x180
[ 1627.498751]  [<ffffffff8101a195>] show_stack+0x25/0x50
[ 1627.499225]  [<ffffffff8137eb99>] dump_stack+0x4b/0x72
[ 1627.499695]  [<ffffffff8107c552>] warn_slowpath_common+0x82/0xc0
[ 1627.500179]  [<ffffffff8107c64a>] warn_slowpath_null+0x1a/0x20
[ 1627.500652]  [<ffffffff81006b05>] xen_mc_flush+0x1c5/0x1d0
[ 1627.501126]  [<ffffffff81007365>] xen_leave_lazy_mmu+0x15/0x30
[ 1627.501599]  [<ffffffff811b584d>] remap_pfn_range+0x34d/0x430
[ 1627.502078]  [<ffffffff8149518f>] mmap_mem+0xcf/0x120
[ 1627.502552]  [<ffffffff811bbd37>] mmap_region+0x3f7/0x680
[ 1627.503025]  [<ffffffff811bc2f3>] do_mmap+0x333/0x420
[ 1627.503495]  [<ffffffff811a28c1>] vm_mmap_pgoff+0x91/0xc0
[ 1627.503961]  [<ffffffff811ba6cf>] SyS_mmap_pgoff+0x19f/0x260
[ 1627.504437]  [<ffffffff8101c0db>] SyS_mmap+0x1b/0x30
[ 1627.504899]  [<ffffffff816a96f6>] entry_SYSCALL_64_fastpath+0x16/0x75
[ 1627.506910] DWARF2 unwinder stuck at entry_SYSCALL_64_fastpath+0x16/0x75
[ 1627.507380] 
[ 1627.507841] Leftover inexact backtrace:
[ 1627.507841] 
[ 1627.508736] ---[ end trace 3451e822401d3468 ]---
[ 1627.509990] audit: type=1701 audit(1456849316.138:97): auid=0 uid=0 gid=0 
ses=1 pid=2004 comm="t" exe="/root/t" sig=7
Bus error (core dumped)


Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.