Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp284912rwe; Wed, 31 Aug 2022 02:48:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ZK0MZATS5+Y8sNFXu0eGcyR4k9eEwAdhvnZd+cgDBTqciEWG/SouxUiTc+0xfJ1HtrMvy X-Received: by 2002:a63:e953:0:b0:42a:2b07:3ff5 with SMTP id q19-20020a63e953000000b0042a2b073ff5mr20637728pgj.348.1661939336246; Wed, 31 Aug 2022 02:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661939336; cv=none; d=google.com; s=arc-20160816; b=ZSJLKMMD4If0H5a5wH5uagNYFlktwxIw2m4zKCTRoFv9qugaOdat+S0clXL79CPycI iempK0zDlfpn5bDbrZNHsVr47XwnRHumlQxv+gMbXe3xFjYBMa5y76Dn/5/rDzwQ2UF6 2ID8X8QTAwluDfKkfRjfwxjNrMC1lPdoFS1oCGa3W4JBbD5/MGkDY4Txdu/YD0Vxw/4k bKpbMspiXGHP8jWT1JcToa6LY5b6Whsozc4UARO5l1M6FMCx6H2w74oBL5CrdNitQlRA rT3hg99XoJh18R5MoLHC++4IESO1qf33aGEhY7dHNbCocxh3yDKdD1DiD8XNfAB9K83G 3oqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mTMJgxNUn3NdL2Te+hOt7Np5Z6vrIBnPT95qbu1ijYo=; b=Oi5spberVi3VqWrJ+p34nP5WEnxQfzH0jEVjByszxK89FqL7MaDAOySdXXzg/fZWL9 ikOxoh23UwDv4fAbw/3uBQEwIPP0JSSvm2r/g3KnKvgKXQ1DuYCH5zUFraidctZI+Tf5 93YL38Dy2Psqo31yZHOGzQncpCoQKSo5y4EnCWscGukVad/xGHTXcgqW1MQv7r07abR3 zLWxZ/McjlFCBwlZCd2+7p+6Bk+gK/TsM2YUCick9569OSVbPMvCzYJyvXOnnJh0pJLO 3cBZ3vu9SJBMLSIbTXq2VXrD7rKPUGBhoXHyIdkWw5gpd9WUS8XufrBnQRqkEnbjhEoc Qk9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z3JWHYIE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 17-20020a630311000000b0042b60954b4fsi4492278pgd.324.2022.08.31.02.48.44; Wed, 31 Aug 2022 02:48:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z3JWHYIE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231905AbiHaJbL (ORCPT + 99 others); Wed, 31 Aug 2022 05:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231917AbiHaJbI (ORCPT ); Wed, 31 Aug 2022 05:31:08 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABF06C6FF4 for ; Wed, 31 Aug 2022 02:31:06 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id lx1so27110239ejb.12 for ; Wed, 31 Aug 2022 02:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=mTMJgxNUn3NdL2Te+hOt7Np5Z6vrIBnPT95qbu1ijYo=; b=z3JWHYIEKt1HnNwSz7g2jiDwM7uqhF3iqPTxL23i2Z/5BSDL75qHHMgDA9viIprqHf kTQy0DiTPJI6k36aeUKIs9Gz22Q7CCKMCLRHUTKEdtzA4p1A7ViQuHlQPerO6xE7ZARL pYQYPJOOuFtFmp0Lm2cn8WE9RMA0bqD/XgVpj0sa/g5itUZoaI4ln99bwcFDKCk2PKpH 4cNpt3T1uNlC4iwXS+fO87q8yKpMPu8yPGXTo3rEpyHyzc2eh2dof91JZkBJr9P6rkUR T3sd8wAmR/ugyXz/4lwOGUiMr5v+nWKBjK2Cw8XJIP7tMrunvUr3IWn90MtjwmNRey1A HANw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=mTMJgxNUn3NdL2Te+hOt7Np5Z6vrIBnPT95qbu1ijYo=; b=una9yRkEB6NhWYbfnkiGUy/hU3kT9kAnpwwXhKwi4D/xzonZrGHKYL++cxQJVZfWWf qA6ve2JSbF0dBLQnhQDxNfw0xB9CRX4/GTZytOa/K7T5LufKL8McXg+McER6LAkYA1uk q4qiLw1qyb7Gr8yii0ZZ6/oeouj3hKU7yDa+gJ9XCklTADS1Wsy9p8SvKMYo0WOfdFNh 3RTO5hqCQrPbvyYleqAoEm+CkahQN0II0qieGIMQd/2N0Eb3BHbogp8h0RKuadIh+C9L pbQPnAIur+16dsBuInrIvvSoNGzk0ayYk7EePyuiaEkbXphAA2+aMTndzcYAkkqZtl0j /8wQ== X-Gm-Message-State: ACgBeo2w5LTfsX3Krqofkvn6kfD655+C13ZHIlgYJS6qnPD+oWTK1FCw b2C9wJ13LVLzVSDyDj185BhiDKZQP0CLULNAj5lxaQ== X-Received: by 2002:a17:906:9b86:b0:73d:72cf:72af with SMTP id dd6-20020a1709069b8600b0073d72cf72afmr19921832ejc.440.1661938265272; Wed, 31 Aug 2022 02:31:05 -0700 (PDT) MIME-Version: 1.0 References: <20220827213009.44316-1-alexander.sverdlin@nokia.com> In-Reply-To: <20220827213009.44316-1-alexander.sverdlin@nokia.com> From: Linus Walleij Date: Wed, 31 Aug 2022 11:30:53 +0200 Message-ID: Subject: Re: [PATCH] ARM: kasan: Only map modules if CONFIG_KASAN_VMALLOC=n To: Alexander A Sverdlin Cc: kasan-dev@googlegroups.com, Lecopzer Chen , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 27, 2022 at 11:32 PM Alexander A Sverdlin wrote: > - create_mapping((void *)MODULES_VADDR, (void *)(PKMAP_BASE + PMD_SIZE)); > + if (!IS_ENABLED(CONFIG_KASAN_VMALLOC) && IS_ENABLED(CONFIG_MODULES)) > + create_mapping((void *)MODULES_VADDR, (void *)(MODULES_END)); So the way I understand it is that modules are first and foremost loaded into the area MODULES_VADDR .. MODULES_END, and then after that is out, they get loaded into VMALLOC. See arch/arm/kernel/module.c, module_alloc(). If you do this, how are the addresses between MODULES_VADDR..MODULES_END shadowed when using CONFIG_KASAN_VMALLOC? > + create_mapping((void *)PKMAP_BASE, (void *)(PKMAP_BASE + PMD_SIZE)); (Splitting this in two steps if probably good in any case.) Pls keep me on CC for Kasan ARM patches, thanks! (Maybe I should add some MAINTAINERS blurb.) Yours, Linus Walleij