Content-Type: multipart/mixed; boundary="===============8222095269308955659==" MIME-Version: 1.0 From: Fengguang Wu To: lkp@lists.01.org Subject: [x86, mm] WARNING: CPU: 0 PID: 1 at arch/x86/mm/pageattr.c:1086 __cpa_process_fault() Date: Sat, 15 Nov 2014 18:26:33 +0800 Message-ID: <20141115102633.GC6679@wfg-t540p.sh.intel.com> In-Reply-To: <20141115102225.GA6679@wfg-t540p.sh.intel.com> List-Id: --===============8222095269308955659== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Kees, FYI, one more warning message and call trace. git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git x86/pmd-nx commit 3622dcc2b4f4eaf23bae2511a30fc449d0e5f0d9 Author: Kees Cook AuthorDate: Fri Nov 14 11:36:17 2014 -0800 Commit: Kees Cook CommitDate: Fri Nov 14 13:36:37 2014 -0800 x86, mm: set NX across entire PMD at boot = When setting up permissions on kernel memory at boot, the end of the PMD that was split from bss remained executable. It should be NX like the rest. This performs a PMD alignment instead of a PAGE alignment to get the correct span of memory, and should be freed. = Before: ---[ High Kernel Mapping ]--- ... 0xffffffff8202d000-0xffffffff82200000 1868K RW GLB NX pte 0xffffffff82200000-0xffffffff82c00000 10M RW PSE GLB NX pmd 0xffffffff82c00000-0xffffffff82df5000 2004K RW GLB NX pte 0xffffffff82df5000-0xffffffff82e00000 44K RW GLB x pte 0xffffffff82e00000-0xffffffffc0000000 978M pmd = After: ---[ High Kernel Mapping ]--- ... 0xffffffff8202d000-0xffffffff82200000 1868K RW GLB NX pte 0xffffffff82200000-0xffffffff82c00000 10M RW PSE GLB NX pmd 0xffffffff82c00000-0xffffffff82df5000 2004K RW GLB NX pte 0xffffffff82df5000-0xffffffff82e00000 44K RW NX pte 0xffffffff82e00000-0xffffffffc0000000 978M pmd = Signed-off-by: Kees Cook +---------------------------------------------------------+------------+---= ---------+------------+ | | b23dc5a7cc | 36= 22dcc2b4 | 082b92dbde | +---------------------------------------------------------+------------+---= ---------+------------+ | boot_successes | 60 | 0 = | 0 | | boot_failures | 0 | 20= | 12 | | WARNING:at_arch/x86/mm/pageattr.c:__cpa_process_fault() | 0 | 20= | 12 | | backtrace:set_memory_np | 0 | 20= | 12 | | backtrace:free_init_pages | 0 | 20= | 12 | | backtrace:mark_rodata_ro | 0 | 20= | 12 | | Kernel_panic-not_syncing:No_working_init_found | 0 | 0 = | 12 | | backtrace:panic | 0 | 0 = | 12 | +---------------------------------------------------------+------------+---= ---------+------------+ [ 16.701884] Write protecting the kernel read-only data: 16384k [ 16.703198] debug: unmapping init [mem 0xffffffff8385d000-0xffffffff839f= ffff] [ 16.703893] ------------[ cut here ]------------ [ 16.704426] WARNING: CPU: 0 PID: 1 at arch/x86/mm/pageattr.c:1086 __cpa_= process_fault+0x2be/0x2e3() [ 16.705450] CPA: called for zero pte. vaddr =3D ffffffff8385d000 cpa->va= ddr =3D ffffffff8385d000 [ 16.706259] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc4-g3622dc= c2 #13 [ 16.706965] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 16.707528] 0000000000000009 ffff88000018bbc8 ffffffff819252f3 ffff8800= 0018bc18 [ 16.708301] 0000000000000009 ffff88000018bc08 ffffffff8108806b ffff8800= 0018bc28 [ 16.709121] ffffffff810358fe ffff88000018bdf8 ffffffff8385d000 00000000= 00000000 [ 16.709898] Call Trace: [ 16.710157] [] dump_stack+0x51/0xaa [ 16.710659] [] warn_slowpath_common+0x7c/0x96 [ 16.711231] [] ? __cpa_process_fault+0x2be/0x2e3 [ 16.711831] [] warn_slowpath_fmt+0x46/0x48 [ 16.712398] [] __cpa_process_fault+0x2be/0x2e3 [ 16.713001] [] ? lookup_address_in_pgd+0x6e/0xd9 [ 16.713608] [] __change_page_attr_set_clr+0xe0/0x73e [ 16.714264] [] ? vm_unmap_aliases+0x169/0x178 [ 16.714852] [] change_page_attr_set_clr+0x1e1/0x428 [ 16.715476] [] change_page_attr_clear+0x21/0x23 [ 16.716109] [] set_memory_np+0x21/0x23 [ 16.716620] [] free_init_pages+0xbb/0xca [ 16.717157] [] mark_rodata_ro+0xb1/0x125 [ 16.717698] [] ? rest_init+0xc1/0xc1 [ 16.718202] [] kernel_init+0x1d/0xda [ 16.718717] [] ret_from_fork+0x7c/0xb0 [ 16.719234] [] ? rest_init+0xc1/0xc1 [ 16.719820] ---[ end trace 98571e0ac619c2b1 ]--- [ 16.720325] debug: unmapping init [mem 0xffff880001939000-0xffff8800019f= ffff] git bisect start 082b92dbdee2006706aff377ae38d6ceacea91c5 206c5f60a3d902bc4= b56dab2de3e88de5eb06108 -- git bisect bad 156311ecaa588b59a508951a62431e24786e284e # 12:57 0- = 1 Merge 'kees/nak/fw-relative' into devel-snb-smoke-201411151150 git bisect good cbb20c815bbd7b0c37f68ac038ebda2ffe0072d3 # 13:13 20+ = 0 Merge 'linuxtv-media/master' into devel-snb-smoke-201411151150 git bisect good 00276f48b04f0d099b954197e86f9535d915cf28 # 13:42 20+ = 0 Merge 'kees/yama/extras' into devel-snb-smoke-201411151150 git bisect bad 63f537793215742753990ae83f610e578a39d871 # 13:56 0- = 1 Merge 'kees/ptdump' into devel-snb-smoke-201411151150 git bisect bad 86b9e4d12ff4737b3b0b172b6d942ddbbb331fdf # 14:13 0- = 1 Merge 'kees/x86/pmd-nx' into devel-snb-smoke-201411151150 git bisect bad 3622dcc2b4f4eaf23bae2511a30fc449d0e5f0d9 # 14:35 0- = 5 x86, mm: set NX across entire PMD at boot # first bad commit: [3622dcc2b4f4eaf23bae2511a30fc449d0e5f0d9] x86, mm: set= NX across entire PMD at boot git bisect good b23dc5a7cc6ebc9a0d57351da7a0e8454c9ffea3 # 14:46 60+ = 0 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/g= it/mst/vhost git bisect bad 082b92dbdee2006706aff377ae38d6ceacea91c5 # 14:46 0- = 12 0day head guard for 'devel-snb-smoke-201411151150' git bisect good 56c381f93d57b88a3e667a2f55137947315c17e2 # 14:50 60+ = 0 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kerne= l/git/dtor/input git bisect good d7e5a72b951a4ef6d97b2aa43cad37f237ba8030 # 14:59 60+ = 0 Add linux-next specific files for 20141114 This script may reproduce the error. ---------------------------------------------------------------------------- #!/bin/bash kernel=3D$1 initrd=3Dyocto-minimal-x86_64.cgz wget --no-clobber https://github.com/fengguang/reproduce-kernel-bug/raw/mas= ter/initrd/$initrd kvm=3D( qemu-system-x86_64 -cpu kvm64 -enable-kvm -kernel $kernel -initrd $initrd -m 320 -smp 1 -net nic,vlan=3D1,model=3De1000 -net user,vlan=3D1 -boot order=3Dnc -no-reboot -watchdog i6300esb -rtc base=3Dlocaltime -serial stdio -display none -monitor null = ) append=3D( hung_task_panic=3D1 earlyprintk=3DttyS0,115200 debug apic=3Ddebug sysrq_always_enabled rcupdate.rcu_cpu_stall_timeout=3D100 panic=3D-1 softlockup_panic=3D1 nmi_watchdog=3Dpanic oops=3Dpanic load_ramdisk=3D2 prompt_ramdisk=3D0 console=3DttyS0,115200 console=3Dtty0 vga=3Dnormal root=3D/dev/ram0 rw drbd.minor_count=3D8 ) "${kvm[@]}" --append "${append[*]}" ---------------------------------------------------------------------------- Thanks, Fengguang --===============8222095269308955659==--