Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp543359pxb; Mon, 16 Aug 2021 11:14:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjBE/oYQwnocthbDMt9WVR0+ehFX8vLjiLOSxwTGVirkiPjYZYcXfBtzYOfvp4kFMcBwdy X-Received: by 2002:a17:906:379a:: with SMTP id n26mr14746828ejc.501.1629137694410; Mon, 16 Aug 2021 11:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629137694; cv=none; d=google.com; s=arc-20160816; b=gEeo6InYnhozBDzH8QORMlQS5G+lYu6qC/egyVcC+KFA3BYGBd09b6tP84IO+2jYRq uBZY2A311wD8FWBdP0VckgmKstDMF85DjRiPPfNjckZrpYhDlsYJBKXoPhv6OhFjcZ0Z DsIov8qgNc+bJrv+D67r7pRGSUwey64c98+aDnkE11RkT4CFEjfru8/H7Y5rIeo/AnfM 352YyAAB/1dTMb/9Z05g7DiniTx05AsEqMcfCKUZ8zrLIw9vRuII/fsmWOqKMGfDscGC TLUYNpubG7bJdesD3Yy4xn55FB6W77I2hXn/wN/oNhkqCk1EbXgK8qTr5Lt1xOpmhskN l66A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ObwAiK1SanC6EIqEOVjwPOQt8lDrmZK5pIQ+0d+6crA=; b=W1uwAl5xRYxBHmyrUId8kHJJ/WML8sbzOcsCELhpEKuGw8obrzLn/s2i+AhlKi4Hdl udQ+Pd6loEck0jtMTrkhfjX+z+oUdXShWt6P30GjKBfFJst9o0pQll202RYLaNwmW/e/ vdfw8v/2FQbhm9lcZGvu4oYVazTPEiVj6p+2WLcQvRZ1HpMU95yaWPO6jKRMwUG6Df+Z 6K1bDqdXNdPxhpjjGsvWnsPgEO2jdJJL8EflnqY6MZYRhxsUdaY4AYRJ3oeT0pVOiOHI jsJV7jtLbdQUY8QamLDIgmbcaJMgohbWHTqREIUXVDZZS59W4lxrAJvL0OQFs9kNPatt q23Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZRCsMd11; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si11257650ejo.293.2021.08.16.11.14.30; Mon, 16 Aug 2021 11:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZRCsMd11; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbhHPSNg (ORCPT + 99 others); Mon, 16 Aug 2021 14:13:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20897 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbhHPSNg (ORCPT ); Mon, 16 Aug 2021 14:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629137583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ObwAiK1SanC6EIqEOVjwPOQt8lDrmZK5pIQ+0d+6crA=; b=ZRCsMd11GJy5nSKOd5jGFMPLKAWR7lnREhW8rxxJc1Z43axPu3a2GkwDsV1rQIVAe6giAN 5vUfa0utXNgcX7JJN39lxCb3Tuqt3Lb9m37hNnyX798CE4cI51leOMCJq3qLQENa61WtjU g87BSoPpkroyetosdZiFwXFBJei6db0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-RPL-AnGXOtST2hleI73Gow-1; Mon, 16 Aug 2021 14:13:01 -0400 X-MC-Unique: RPL-AnGXOtST2hleI73Gow-1 Received: by mail-wr1-f69.google.com with SMTP id h24-20020adfa4d8000000b00156d9931072so63910wrb.15 for ; Mon, 16 Aug 2021 11:13:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ObwAiK1SanC6EIqEOVjwPOQt8lDrmZK5pIQ+0d+6crA=; b=BZJqC7uLjIa+8UPC25LBB+ieXVilnyDSyQwa9Hk/1qG099ZeZsnxsnuksfRKDtF0k9 LoutjyMFZ1hV/1SvTVwMYXxlQWCQHbyaoorCIE36e9Y1tssFSnCLZDfkqRo5Mcxs1Qqp XSnilgUQ6k9TZVxT3zuXw4qc2zNMqht+dS3JY6ZSkDV1Y/MRMu9uE8fxSZjgeEIR/ww5 3qnQEri5jV3/2cHIGVxqe56oMHmXT1ECFVapCSXxNgcLVbAm9XA1U6x37cMJ4YOUABFI DnsvmoDTvXmxvUOmTW0sJttPyPGadPr31RhHkIsvcywBkqT7aYa3rDNemt0lylH5pqQL +8wg== X-Gm-Message-State: AOAM530IT98GPhhXp87TsFYGSLhlWe8+f7UaaXBROOcl+asOeG6nnrXZ CSuic4grkABMMOIg6oBXp5sfiX5Tx0/5w/yuKHS5LA9Ps8ei+sjAgarjq5FjtDIw1qe5iw+t5mA V6L4aDGo3/+gt+oNJNNu2C4kV X-Received: by 2002:adf:f403:: with SMTP id g3mr20183228wro.222.1629137580064; Mon, 16 Aug 2021 11:13:00 -0700 (PDT) X-Received: by 2002:adf:f403:: with SMTP id g3mr20183201wro.222.1629137579804; Mon, 16 Aug 2021 11:12:59 -0700 (PDT) Received: from krava ([83.240.61.5]) by smtp.gmail.com with ESMTPSA id n16sm12471749wru.79.2021.08.16.11.12.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 11:12:59 -0700 (PDT) Date: Mon, 16 Aug 2021 20:12:58 +0200 From: Jiri Olsa To: David Hildenbrand Cc: Mike Rapoport , Andrew Morton , Oscar Salvador , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [BUG] general protection fault when reading /proc/kcore Message-ID: References: <1a05d147-e249-7682-2c86-bbd157bc9c7d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <1a05d147-e249-7682-2c86-bbd157bc9c7d@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 16, 2021 at 07:49:15PM +0200, David Hildenbrand wrote: > On 16.08.21 19:34, Jiri Olsa wrote: > > hi, > > I'm getting fault below when running: > >=20 > > # cat /proc/kallsyms | grep ksys_read > > ffffffff8136d580 T ksys_read > > # objdump -d --start-address=3D0xffffffff8136d580 --stop-address=3D0xf= fffffff8136d590 /proc/kcore > >=20 > > /proc/kcore: file format elf64-x86-64 > >=20 > > Segmentation fault > >=20 > > any idea? config is attached >=20 > Just tried with a different config on 5.14.0-rc6+ >=20 > [root@localhost ~]# cat /proc/kallsyms | grep ksys_read > ffffffff8927a800 T ksys_readahead > ffffffff89333660 T ksys_read >=20 > [root@localhost ~]# objdump -d --start-address=3D0xffffffff89333660 > --stop-address=3D0xffffffff89333670 >=20 > a.out: file format elf64-x86-64 >=20 >=20 >=20 > The kern_addr_valid(start) seems to fault in your case, which is weird, > because it merely walks the page tables. But it seems to complain about a > non-canonical address 0xf887ffcbff000 >=20 > Can you post your QEMU cmdline? Did you test this on other kernel version= s? I'm using virt-manager so: /usr/bin/qemu-system-x86_64 -name guest=3Dfedora33,debug-threads=3Don -S -o= bject secret,id=3DmasterKey0,format=3Draw,file=3D/var/lib/libvirt/qemu/doma= in-13-fedora33/master-key.aes -machine pc-q35-5.1,accel=3Dkvm,usb=3Doff,vmp= ort=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram -cpu Skylake-Server= -IBRS,ss=3Don,vmx=3Don,pdcm=3Don,hypervisor=3Don,tsc-adjust=3Don,clflushopt= =3Don,umip=3Don,pku=3Don,stibp=3Don,arch-capabilities=3Don,ssbd=3Don,xsaves= =3Don,ibpb=3Don,amd-stibp=3Don,amd-ssbd=3Don,skip-l1dfl-vmentry=3Don,pschan= ge-mc-no=3Don -m 8192 -object memory-backend-ram,id=3Dpc.ram,size=3D8589934= 592 -overcommit mem-lock=3Doff -smp 20,sockets=3D20,cores=3D1,threads=3D1 -= uuid 2185d5a9-dbad-4d61-aa4e-97af9fd7ebca -no-user-config -nodefaults -char= dev socket,id=3Dcharmonitor,fd=3D36,server,nowait -mon chardev=3Dcharmonito= r,id=3Dmonitor,mode=3Dcontrol -rtc base=3Dutc,driftfix=3Dslew -global kvm-p= it.lost_tick_policy=3Ddelay -no-hpet -no-shutdown -global ICH9-LPC.disable_= s3=3D1 -global ICH9-LPC.disable_s4=3D1 -boot strict=3Don -kernel /home/jols= a/qemu/run/vmlinux -initrd /home/jolsa/qemu/run/initrd -append root=3D/dev/= mapper/fedora_fedora-root ro rd.lvm.lv=3Dfedora_fedora/root console=3Dtty0 = console=3DttyS0,115200 -device pcie-root-port,port=3D0x10,chassis=3D1,id=3D= pci.1,bus=3Dpcie.0,multifunction=3Don,addr=3D0x2 -device pcie-root-port,por= t=3D0x11,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr=3D0x2.0x1 -device pcie-ro= ot-port,port=3D0x12,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr=3D0x2.0x2 -dev= ice pcie-root-port,port=3D0x13,chassis=3D4,id=3Dpci.4,bus=3Dpcie.0,addr=3D0= x2.0x3 -device pcie-root-port,port=3D0x14,chassis=3D5,id=3Dpci.5,bus=3Dpcie= =2E0,addr=3D0x2.0x4 -device pcie-root-port,port=3D0x15,chassis=3D6,id=3Dpci= =2E6,bus=3Dpcie.0,addr=3D0x2.0x5 -device pcie-root-port,port=3D0x16,chassis= =3D7,id=3Dpci.7,bus=3Dpcie.0,addr=3D0x2.0x6 -device qemu-xhci,p2=3D15,p3=3D= 15,id=3Dusb,bus=3Dpci.2,addr=3D0x0 -device virtio-serial-pci,id=3Dvirtio-se= rial0,bus=3Dpci.3,addr=3D0x0 -blockdev {"driver":"file","filename":"/var/li= b/libvirt/images/fedora33.qcow2","node-name":"libvirt-2-storage","auto-read= -only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-2-format","r= ead-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null}= -device virtio-blk-pci,bus=3Dpci.4,addr=3D0x0,drive=3Dlibvirt-2-format,id= =3Dvirtio-disk0,bootindex=3D1 -device ide-cd,bus=3Dide.0,id=3Dsata0-0-0 -ne= tdev tap,fd=3D38,id=3Dhostnet0,vhost=3Don,vhostfd=3D39 -device virtio-net-p= ci,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:f3:c6:e7,bus=3Dpci.1,addr=3D0= x0 -chardev pty,id=3Dcharserial0 -device isa-serial,chardev=3Dcharserial0,i= d=3Dserial0 -chardev socket,id=3Dcharchannel0,fd=3D40,server,nowait -device= virtserialport,bus=3Dvirtio-serial0.0,nr=3D1,chardev=3Dcharchannel0,id=3Dc= hannel0,name=3Dorg.qemu.guest_agent.0 -chardev spicevmc,id=3Dcharchannel1,n= ame=3Dvdagent -device virtserialport,bus=3Dvirtio-serial0.0,nr=3D2,chardev= =3Dcharchannel1,id=3Dchannel1,name=3Dcom.redhat.spice.0 -device usb-tablet,= id=3Dinput0,bus=3Dusb.0,port=3D1 -spice port=3D5900,addr=3D127.0.0.1,disabl= e-ticketing,image-compression=3Doff,seamless-migration=3Don -device qxl-vga= ,id=3Dvideo0,ram_size=3D67108864,vram_size=3D67108864,vram64_size_mb=3D0,vg= amem_mb=3D16,max_outputs=3D1,bus=3Dpcie.0,addr=3D0x1 -device ich9-intel-hda= ,id=3Dsound0,bus=3Dpcie.0,addr=3D0x1b -device hda-duplex,id=3Dsound0-codec0= ,bus=3Dsound0.0,cad=3D0 -chardev spicevmc,id=3Dcharredir0,name=3Dusbredir -= device usb-redir,chardev=3Dcharredir0,id=3Dredir0,bus=3Dusb.0,port=3D2 -cha= rdev spicevmc,id=3Dcharredir1,name=3Dusbredir -device usb-redir,chardev=3Dc= harredir1,id=3Dredir1,bus=3Dusb.0,port=3D3 -device virtio-balloon-pci,id=3D= balloon0,bus=3Dpci.5,addr=3D0x0 -object rng-random,id=3Dobjrng0,filename=3D= /dev/urandom -device virtio-rng-pci,rng=3Dobjrng0,id=3Drng0,bus=3Dpci.6,add= r=3D0x0 -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,r= esourcecontrol=3Ddeny -msg timestamp=3Don so far I tested just bpf-next/master: git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git and jsut removed my changes to make sure it wasn't me ;-) I'll try to find a version that worked for me before thanks, jirka