Received: by 10.213.65.68 with SMTP id h4csp2404524imn; Mon, 9 Apr 2018 03:02:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx49SFGfJQ5PLM/lTKi1WG/wbMtvttPyVcfxYb4seA5MM3cWTkQahi95fKxYDNvUyWWXP7EiH X-Received: by 2002:a17:902:64cf:: with SMTP id y15-v6mr38710064pli.49.1523268175419; Mon, 09 Apr 2018 03:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523268175; cv=none; d=google.com; s=arc-20160816; b=wQsBu/V3nyuRYRpplp1GlDV9RbHCCPXTrUa8JhnPPm9JUCKevz/kzZaQu8e7jqxUeb nbQMEwq3QgnDPul78y24LoN4/qf9n0v2NCHllU3IDiqpqAHI3say1bjNZdAXZGx3F104 9LM2dY89DfHUjeLaM/spWEXcP/rkrOAXxk0SQN9r6E4YFPa9/kVp+0zP0wGQw6K5/Nop Lt8617H2SzZqXim1tqfKof6eRGfeURBhnU42/+L7zdUTeKMMJ3vKCQv/WT/dQpwavCb4 BvsHZjSKFZHwdUCm+lMwQ0P7eydeCpjundb5DDyoz3VajNrt+THrXPjL4um9KFshd4Bb VF1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=1fEyUvTngP19xdsmT5op+fz5kwJnYZRRTChEjVbMnPc=; b=nP7ukuav1T95m6z23RzKWt/4BM3+QcZC8AYipDesmlKbQWbLCRgYBoP8DOxrF7JvSs SErskAa93McN1ofzv6JSYwLHCrE7md7WtOefmnG6d1em7Y+VuKEAPzvdppUx832/6CBw YPoXf7miYqIswIRnO0M7PMAkG/DW06tKVNmqHsSNqWAHAIihUaRo+FVTpc+AEosvqQFL Sl6HGpxvrqa1+bnI+UduAlwACj8yqjhy6xYIBpxKwubobYC6bO/MgyTdS3QIV4HwHccQ OGWYl0Afj/pyaThTJaw6B09BJEqLtJd++7CnyCqHhxy3gDIWHzsZZ+h9eE3qgQHokCEt xTyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@essential-com.20150623.gappssmtp.com header.s=20150623 header.b=m7TJCwGu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r77si5156528pfa.359.2018.04.09.03.02.18; Mon, 09 Apr 2018 03:02:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@essential-com.20150623.gappssmtp.com header.s=20150623 header.b=m7TJCwGu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751635AbeDIJ6C (ORCPT + 99 others); Mon, 9 Apr 2018 05:58:02 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:36101 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750863AbeDIJ6A (ORCPT ); Mon, 9 Apr 2018 05:58:00 -0400 Received: by mail-pl0-f65.google.com with SMTP id 91-v6so4804471pld.3 for ; Mon, 09 Apr 2018 02:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=essential-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1fEyUvTngP19xdsmT5op+fz5kwJnYZRRTChEjVbMnPc=; b=m7TJCwGu7L2hAzqtg61kyRL5qM9nFZff6QVrTHFw5ud2pPMitjSfhPYOCGwiSfiBC6 IIgmT+ya0xJbolVk9r5/2JFpBVEmwnOrZ4iQ8RXBPScr3+vcrFxaHZmYec14gYM32//0 RpxCwCYSlGpVDjRMnMW9s0HIWzWs2n7V+RL2ihyhXjrP3djPHurxz8tHnfB52wi++j8O mvhnO1vYWQd8rz26Nhri5+gqDBJgiLLJupXU/xtz6PYtZmI/86su9HPdeVJsySZddGG8 5e/llvuPb90mQ/aYIPA52NPIPwmrCLARWhHeD8DkLqJj4a2KC3yh+58KIdgeI2bX9Gx/ dXdw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=1fEyUvTngP19xdsmT5op+fz5kwJnYZRRTChEjVbMnPc=; b=L48EyxptPoWy3fLIzldN+45vGolhTi1E/WSC50nwMEaYaGGZAd68YcGGy8hn2aQpy8 U5V5uG5FypvdVnLjSFovTMPX270hDGIlivh+0HbCCHS9PT+wwTt7uGiSImhJn6QC+bml Ir0z3PXeDvU1QMd5qT0d6UoFppxBrKtwjwCfUzTCcvVLNt1FJLoSNrGdaGA32l8swxGp vcZtXR/T2WWpaVF7JaaXmvVQsMc841rnltobz7yPo9sHUOgPkl3USZpRy8GrAzqbwHfo Nga7QcL3XOkaeF5Fi/e/LqFko5RnDvSy6u9njIY0wphj8ihRjTJGIcamqT/pvIWDerHP KWcg== X-Gm-Message-State: AElRT7Gn/iG0rPtobRaPFP43xnQaak33bPzfnLK7+i1Iy/F8zt956fbd 8yRff5hjpWWQjI+KJcYs87m7Ww== X-Received: by 2002:a17:902:7804:: with SMTP id p4-v6mr38521353pll.17.1523267879893; Mon, 09 Apr 2018 02:57:59 -0700 (PDT) Received: from jbtheou ([203.215.133.124]) by smtp.gmail.com with ESMTPSA id i186sm32551460pfg.53.2018.04.09.02.57.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 02:57:59 -0700 (PDT) Date: Mon, 9 Apr 2018 18:57:51 +0900 From: Jean-Baptiste Theou To: Ard Biesheuvel Cc: Greg KH , Mark Rutland , Linux Kernel Mailing List , Will Deacon , Dan Rue , Mark Brown , Marc Zyngier , Greg Hackmann Subject: Re: Linux 4.9.93 Message-ID: <20180409185751.247a0ac7@jbtheou> In-Reply-To: References: <20180409180534.1768583293d0abe207168c5a@essential.com> <20180409093028.GA3398@kroah.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Apr 2018 11:49:37 +0200 Ard Biesheuvel wrote: > On 9 April 2018 at 11:30, Greg KH wrote: > > On Mon, Apr 09, 2018 at 06:05:34PM +0900, Jean-Baptiste Theou wrote: =20 > >> Hi, > >> > >> After this patchset, a kernel built with CFI fails. Disabling > >> UNMAP_KERNEL_AT_EL0 fix the issue obviously. =20 >=20 > How does one 'build a kernel with CFI' for arm64? =46rom Google work on Android-4.9 https://android.googlesource.com/kernel/common/+/00a195e7c0752ff5d65c9caadf= bcc226270ca232 I am not sure what is the plan on their side to upstream (Greg?), but defin= itely useful to isolate actual issues. >=20 > > > > Is this a "clean" 4.9.93 tree or a "4.9.93 merged into > > android-common-4.9? It's a "clean 4.9.93" + whatever is needed for Clang/CFI support My take is that CFI doesn't like=20 * void __kpti_install_ng_mappings(int cpu, int num_cpus, phys_addr_t swapp= er) and=20 remap_fn =3D (void *)__pa_symbol(idmap_kpti_install_ng_mappings); Maybe just flag this function to not use CFI? I remember that Sami Tolvanen= did similar changes. I know it's a bit out of context since CFI support for ARM64 is not upstrea= m yet, but unfortunate that an stable patchset trigger such failures. Thanks a lot Best regards > > =20 > >> Wondering if there is one of the test suite used on the review patchse= t that covers the CFI usecase. > >> > >> Best regards, > >> > >> [ 0.249191] CPU features: detected feature: GIC system register CPU= interface > >> [ 0.256391] CPU features: detected feature: Privileged Access Never > >> [ 0.262719] CPU features: detected feature: User Access Override > >> [ 0.268791] CPU features: detected feature: 32-bit EL0 Support > >> [ 0.274683] CPU features: detected feature: Kernel page table isola= tion (KPTI) > >> [ 0.282166] CFI failure: > >> [ 0.282169] CFI failure: > >> [ 0.282172] CFI failure: > >> [ 0.282173] CFI failure: > >> [ 0.282175] CFI failure: > >> [ 0.282176] CFI failure: > >> [ 0.282177] CFI failure: > >> [ 0.282178] CFI failure: > >> [ 0.282188] ------------[ cut here ]------------ > >> [ 0.282189] ------------[ cut here ]------------ > >> [ 0.282190] ------------[ cut here ]------------ > >> [ 0.282191] ------------[ cut here ]------------ > >> [ 0.282193] ------------[ cut here ]------------ > >> [ 0.282196] kernel BUG at kernel/cfi.c:32! > >> [ 0.282198] ------------[ cut here ]------------ > >> [ 0.282201] kernel BUG at kernel/cfi.c:32! > >> [ 0.282202] ------------[ cut here ]------------ > >> [ 0.282204] kernel BUG at kernel/cfi.c:32! > >> [ 0.282207] kernel BUG at kernel/cfi.c:32! > >> [ 0.282209] kernel BUG at kernel/cfi.c:32! > >> [ 0.282211] kernel BUG at kernel/cfi.c:32! > >> [ 0.282214] kernel BUG at kernel/cfi.c:32! > >> [ 0.282215] ------------[ cut here ]------------ > >> [ 0.282216] kernel BUG at kernel/cfi.c:32! > >> [ 0.282218] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP > >> [ 0.282224] Modules linked in: > >> [ 0.282230] CPU: 2 PID: 25 Comm: migration/2 Not tainted 4.9.93-per= f+ #39 > >> [ 0.282232] Hardware name: > >> [ 0.282235] task: fffffffbb3b36580 task.stack: fffffffbb30cc000 > >> [ 0.282250] PC is at __cfi_check_fail+0x14/0x1c > >> [ 0.282253] LR is at __cfi_check_fail+0x14/0x1c > >> [ 0.282255] pc : [] lr : [] pst= ate: 60c00085 > >> [ 0.282256] sp : fffffffbb30cfc30 > >> [ 0.282259] x29: fffffffbb30cfc30 x28: ffffff93b6415000 > >> [ 0.282261] x27: 00000013b65c1000 x26: ffffff93b5ce6000 > >> [ 0.282264] x25: ffffff93b5ce6000 x24: ffffff93b6419000 > >> [ 0.282266] x23: ffffff93b65c1000 x22: ffffff93b65c4000 > >> [ 0.282268] x21: 9d12f8172cb2f296 x20: 000000008180e3e0 > >> [ 0.282271] x19: 0000000000000000 x18: 000000000000002c > >> [ 0.282274] x17: 00000000000fd054 x16: 0000000000000000 > >> [ 0.282276] x15: ffffff93b65ec000 x14: 000000000000000c > >> [ 0.282279] x13: 0000000000000004 x12: 0000000000000000 > >> [ 0.282281] x11: 0000000000000000 x10: 0000000001440144 > >> [ 0.282283] x9 : 260822e8751d5000 x8 : 260822e8751d5000 > >> [ 0.282286] x7 : 0000000000000000 x6 : fffffffbbac75b60 > >> [ 0.282288] x5 : 0000000000000000 x4 : 0000000000000000 > >> [ 0.282290] x3 : 000000003a657275 x2 : 0000000000000000 > >> [ 0.282292] x1 : 0000000000000000 x0 : 000000000000000c > >> [ 0.282294] > >> [ 0.282294] PC: 0xffffff93b3f03d50: > >> [ 0.282308] 3d50 b9001ac8 f94002c8 370ffec8 17ffffbe d4210000 1400= 0000 aa1603e0 f90007e8 > >> [ 0.282315] 3d70 94536017 f94007e8 17ffffe2 a9bf7bfd 910003fd d000= d100 913ee400 94533cc7 > >> [ 0.282322] 3d90 d4210000 14000000 b0013788 2a1f03e0 f901c51f d65f= 03c0 f940406b 2a0203e8 > >> [ 0.282329] 3db0 2a0103e9 aa0003ea b400008b f9000145 f94000cb b400= 01ab a9bf7bfd 910003fd > >> [ 0.282330] > >> [ 0.282330] LR: 0xffffff93b3f03d50: > >> [ 0.282336] 3d50 b9001ac8 f94002c8 370ffec8 17ffffbe d4210000 1400= 0000 aa1603e0 f90007e8 > >> [ 0.282343] 3d70 94536017 f94007e8 17ffffe2 a9bf7bfd 910003fd d000= d100 913ee400 94533cc7 > >> [ 0.282350] 3d90 d4210000 14000000 b0013788 2a1f03e0 f901c51f d65f= 03c0 f940406b 2a0203e8 > >> [ 0.282357] 3db0 2a0103e9 aa0003ea b400008b f9000145 f94000cb b400= 01ab a9bf7bfd 910003fd > >> [ 0.282358] > >> [ 0.282358] SP: 0xfffffffbb30cfbf0: > >> [ 0.282365] fbf0 b3f03d90 ffffff93 b30cfc30 fffffffb b3f03d90 ffff= ff93 60c00085 00000000 > >> [ 0.282372] fc10 b6415000 ffffff93 b642fa00 ffffff93 ffffffff ffff= ffff b3f03d90 ffffff93 > >> [ 0.282378] fc30 b30cfc70 fffffffb b3d458c0 ffffff93 00000080 0000= 0000 00000001 00000000 > >> [ 0.282385] fc50 b65c4000 ffffff93 b64420f0 ffffff93 8180e3e0 0000= 0000 00000002 00000000 > >> [ 0.282387] Process migration/2 (pid: 25, stack limit =3D 0xfffffff= bb30cc000) > >> [ 0.282389] Call trace: > >> [ 0.282391] Exception stack(0xfffffffbb30cfb00 to 0xfffffffbb30cfc3= 0) > >> [ 0.282395] fb00: 000000000000000c 0000000000000000 000000000000000= 0 000000003a657275 > >> [ 0.282397] fb20: 0000000000000000 0000000000000000 fffffffbbac75b6= 0 0000000000000000 > >> [ 0.282400] fb40: 260822e8751d5000 260822e8751d5000 000000000144014= 4 0000000000000000 > >> [ 0.282403] fb60: 0000000000000000 0000000000000004 000000000000000= c ffffff93b65ec000 > >> [ 0.282405] fb80: 0000000000000000 00000000000fd054 000000000000002= c 0000000000000000 > >> [ 0.282408] fba0: 000000008180e3e0 9d12f8172cb2f296 ffffff93b65c400= 0 ffffff93b65c1000 > >> [ 0.282411] fbc0: ffffff93b6419000 ffffff93b5ce6000 ffffff93b5ce600= 0 00000013b65c1000 > >> [ 0.282413] fbe0: ffffff93b6415000 fffffffbb30cfc30 ffffff93b3f03d9= 0 fffffffbb30cfc30 > >> [ 0.282416] fc00: ffffff93b3f03d90 0000000060c00085 ffffff93b641500= 0 ffffff93b642fa00 > >> [ 0.282418] fc20: ffffffffffffffff ffffff93b3f03d90 > >> [ 0.282421] [] __cfi_check_fail+0x14/0x1c > >> [ 0.282430] [] name_to_dev_t+0x0/0x47c > >> [ 0.282436] [] kpti_install_ng_mappings+0x178/0x2= e0 > >> [ 0.282443] [] multi_cpu_stop+0x114/0x170 > >> [ 0.282445] [] cpu_stopper_thread+0x128/0x2e8 > >> [ 0.282452] [] smpboot_thread_fn+0x230/0x558 > >> [ 0.282455] [] kthread+0x21c/0x238 > >> [ 0.282459] [] ret_from_fork+0x10/0x20 > >> [ 0.282464] Code: 910003fd d000d100 913ee400 94533cc7 (d4210000) =20 > > > > Oh fun :( > > > > Dragging in a bunch more people to the cc: and to: lines to have them > > look at this... > > > > thanks, > > > > greg k-h =20