Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3234220ybb; Tue, 31 Mar 2020 00:45:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtmbOWR3lisjzZrT9WbWEdPqpkXr5I2WXqJlO85nltNYjsHLgqrqnyMJe/nb3VJ4hjqM+uz X-Received: by 2002:a9d:5187:: with SMTP id y7mr11789487otg.159.1585640740744; Tue, 31 Mar 2020 00:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585640740; cv=none; d=google.com; s=arc-20160816; b=p3zxCdA717HJO7rrjENRm/7ROrLSeJBlsJkBZC1KlgTzGKi3ITgweiOjEvNt+j6S5J v563dFABAZ+Pm8nu/zyqiuJ/SKuidL4OrNSFmb0cjoZQeGHQpxrQ6LPprO3DdThoQSfp IXcT40+RnLdQ5r+mwFtRGobPwqEb5YW/Qlfhh/78hjGw4ZcwpkrrZHCxm0mrSYCPboGV qidfUzmkHRSb88fnBO38BvdsOg6iWqpyIUJ18+AV2PvGzG+vpvu/oO/rL75XFVluxTqx U5Qao+tHHMO+eRbG74Avffy96o7pLten47fgJtEB2l8bpe7euEw7jrjN+xWpGGMkLNM3 1ocA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=mY+wh5Q6q1wCCnpfeGfqbJIfuTMV93y/MYraoa9jzyA=; b=ofBmAflETthnDzuZ20hwSfXxCGVhEYKciAREbe/KV82x95h0LgMZYkQKBhP84cUJwN BaFvBxuOLxSnzu2JE5vA/xaI/ZhcHAtH45k+5ABcxS83w335Acbd/xZZRw5dg7L//ELt 7kIb5QVUBoDXBzHHnXRuDy/09awpoEw5xl+uT3IsMuw6jt1nAHMCScjm76rwhU5gAJeR opN09hHbi4YynNo9CfzEf3tykpgMHhrjQyn/X+ykiCVPQWLRll7Ihs04Y4HD53I7slWA BATyuoHYRTGp1SVZkgmMKyaLEpArwM3EmShlLhuHOFTyz69Kxrsg3rnAyo7hqmKoDZd4 luEg== ARC-Authentication-Results: i=1; mx.google.com; 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 i14si8164302otk.123.2020.03.31.00.45.28; Tue, 31 Mar 2020 00:45:40 -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; 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 S1730058AbgCaHoM (ORCPT + 99 others); Tue, 31 Mar 2020 03:44:12 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:56756 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726397AbgCaHoM (ORCPT ); Tue, 31 Mar 2020 03:44:12 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jJBZ3-008Kx7-9S; Tue, 31 Mar 2020 09:44:01 +0200 Message-ID: <19cf82d3c3d76ad62a47beee162fa9ff768a3a01.camel@sipsolutions.net> Subject: Re: [PATCH] UML: add support for KASAN under x86_64 From: Johannes Berg To: David Gow Cc: Dmitry Vyukov , Patricia Alfonso , Jeff Dike , Richard Weinberger , Anton Ivanov , Andrey Ryabinin , Brendan Higgins , linux-um , LKML , kasan-dev Date: Tue, 31 Mar 2020 09:43:59 +0200 In-Reply-To: (sfid-20200331_081511_061239_730E62F6) References: <20200226004608.8128-1-trishalfonso@google.com> <4b8c1696f658b4c6c393956734d580593b55c4c0.camel@sipsolutions.net> <674ad16d7de34db7b562a08b971bdde179158902.camel@sipsolutions.net> <2cee72779294550a3ad143146283745b5cccb5fc.camel@sipsolutions.net> (sfid-20200331_081511_061239_730E62F6) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-03-30 at 23:14 -0700, David Gow wrote: > > I spent a little time playing around with this, and was able to get > mac80211 mac80211, or mac80211-hwsim? I can load a few modules, but then it crashes on say the third (usually, but who knows what this depends on). > loading if I force-enabled CONFIG_KASAN_VMALLOC (alongside > bumping up the shadow memory address). Not sure I tried that combination though. > The test-bpf module was still failing, though — which may or may not > have been related to how bpf uses vmalloc(). I think I got some trouble also with just stack unwinding and other random things faulting in the vmalloc and/or shadow space ... > I do like the idea of trying to push the shadow memory allocation > through UML's PTE code, but confess to not understanding it > particularly well. Me neither. I just noticed that all the vmalloc and kasan-vmalloc do all the PTE handling, so things might easily clash if you have CONFIG_KASAN_VMALLOC, which we do want eventually. > I imagine it'd require pushing the KASAN > initialisation back until after init_physmem, and having the shadow > memory be backed by the physmem file? Unless there's a clever way of > allocating the shadow memory early, and then hooking it into the page > tables/etc when those are initialised (akin to how on x86 there's a > separate early shadow memory stage while things are still being set > up, maybe?) Pretty sure we should be able to hook it up later, but I haven't really dug deeply yet. johannes