From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B02AAC433F5 for ; Tue, 22 Feb 2022 18:27:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 350D78D0003; Tue, 22 Feb 2022 13:27:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D8BD8D0001; Tue, 22 Feb 2022 13:27:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A00C8D0003; Tue, 22 Feb 2022 13:27:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 050748D0001 for ; Tue, 22 Feb 2022 13:27:34 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id C78671202E0 for ; Tue, 22 Feb 2022 18:27:33 +0000 (UTC) X-FDA: 79171248786.03.6CC9175 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by imf10.hostedemail.com (Postfix) with ESMTP id 55E77C0010 for ; Tue, 22 Feb 2022 18:27:33 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id r7so15943564iot.3 for ; Tue, 22 Feb 2022 10:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oObgooNlIOOo2XH59U0uuMMQ0kQeglBbkBAVHE8QeMY=; b=X1llFE4v/VRY2AuGSXbi23JXDtqqNaDh8fsyxisBfmcm7wEEv4bWP72G2JYWO6xIzm SeGiigJk+ptFVCouzFfg3QnP+4I0eLjF8kaTLVDdxTZOZxMvLR6QyZPhd6fYSMQM145L PSnL+n5akM1CZs6QQjmwCu/NWE4cckJNyfw8u4Po0NmGPCC1qOJ+gKj3SWYdgh4jmfDd zF+aEAirtu+m2K3aF1ZOfPZJQhmUgKCnfYceLtv83Kujk3tL25Rvc2IJWPp1j1e/rmyY B7JNBRDn8IwZ3tirtUqsUPQvIFKa9XpxRvBZiKn1gTxymYRFJGdm9yqjK3sO9qBieHye TYYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oObgooNlIOOo2XH59U0uuMMQ0kQeglBbkBAVHE8QeMY=; b=2b6qyGGb/0vV+YyKR9A7MsCQH9b+SXLc1Nh1cH5bzqhqx7MG7+9zPvIftnlvVeySOZ 3HtROn2hlhQ5txy6vlX3m0ZbfTua0V2b+p2FBthXy7chF+nddpggl5m2ZePSnO1OJdA6 vq7ryXwylo553cbowhac8GF0Ya9VKcDmxagxPG/yDUWiHNU4sECBTafwcra7IxtS2FYT wy5CxKFVNwlhUIykQSOfvZu4SZS5xbRCxJdfPDOm+XL4HJZfH6t6gH+RzsaNyv4QLP9d P7nwfm2ldowtdGYh2zNozWZDl/8j8UQsnBt0KbK6X1NLlysilDfdAc/X22MtEDb3nn3A XhoQ== X-Gm-Message-State: AOAM531bKr7QKXwQ61SIiJWpIQz/OxS0+Pi6zu/ebezg3F01JIhS/HVE slkxIqA6k/pW7TGFvwdLKeSHKABFmEdWmlk8btQ= X-Google-Smtp-Source: ABdhPJxKwsq7f7dnfDsFJ6WHUNfvkDEUzXGGIJmptnXcDExfCbRTViGGivFLy7UWteShDO/PE95/U+nRjeCf+HgkBd0= X-Received: by 2002:a05:6638:10b:b0:314:ef3d:bfe4 with SMTP id x11-20020a056638010b00b00314ef3dbfe4mr6978543jao.218.1645554452615; Tue, 22 Feb 2022 10:27:32 -0800 (PST) MIME-Version: 1.0 References: <2d44632c4067be35491b58b147a4d1329fdfcf16.1645549750.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Tue, 22 Feb 2022 19:27:21 +0100 Message-ID: Subject: Re: [PATCH mm] another fix for "kasan: improve vmalloc tests" To: Marco Elver Cc: andrey.konovalov@linux.dev, Andrew Morton , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev , Linux Memory Management List , LKML , Andrey Konovalov , kernel test robot Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: 7dinni76ehpxytn73inahwkxxrx6if11 X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=X1llFE4v; spf=pass (imf10.hostedemail.com: domain of andreyknvl@gmail.com designates 209.85.166.50 as permitted sender) smtp.mailfrom=andreyknvl@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 55E77C0010 X-HE-Tag: 1645554453-535108 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Feb 22, 2022 at 7:11 PM Marco Elver wrote: > > On Tue, 22 Feb 2022 at 19:08, Andrey Konovalov wrote: > > > > On Tue, Feb 22, 2022 at 6:50 PM Marco Elver wrote: > > > > > > On Tue, 22 Feb 2022 at 18:10, wrote: > > > > > > > > From: Andrey Konovalov > > > > > > > > set_memory_rw/ro() are not exported to be used in modules and thus > > > > cannot be used in KUnit-compatible KASAN tests. > > > > > > > > Drop the checks that rely on these functions. > > > > > > > > Reported-by: kernel test robot > > > > Signed-off-by: Andrey Konovalov > > > > --- > > > > lib/test_kasan.c | 6 ------ > > > > 1 file changed, 6 deletions(-) > > > > > > > > diff --git a/lib/test_kasan.c b/lib/test_kasan.c > > > > index ef99d81fe8b3..448194bbc41d 100644 > > > > --- a/lib/test_kasan.c > > > > +++ b/lib/test_kasan.c > > > > @@ -1083,12 +1083,6 @@ static void vmalloc_helpers_tags(struct kunit *test) > > > > KUNIT_ASSERT_TRUE(test, is_vmalloc_addr(ptr)); > > > > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, vmalloc_to_page(ptr)); > > > > > > > > - /* Make sure vmalloc'ed memory permissions can be changed. */ > > > > - rv = set_memory_ro((unsigned long)ptr, 1); > > > > - KUNIT_ASSERT_GE(test, rv, 0); > > > > - rv = set_memory_rw((unsigned long)ptr, 1); > > > > - KUNIT_ASSERT_GE(test, rv, 0); > > > > > > You can still test it by checking 'ifdef MODULE'. You could add a > > > separate test which is skipped if MODULE is defined. Does that work? > > > > Yes, putting it under ifdef will work. I thought that having a > > discrepancy between built-in and module tests is weird, but I see the > > kprobes tests doing this, so maybe it's not such a bad idea. Will do > > in v2. > > Additionally you could have the test skip with kunit_skip(), so it's > at least visible. The code itself has to be #ifdef'd I guess because > set_memory_*() aren't even declared ifdef MODULE (I think?). I sent v2 with the simplest approach without an additional test. I hope that's OK with you.