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 4F2EAC433F5 for ; Tue, 22 Feb 2022 18:11:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E1358D0002; Tue, 22 Feb 2022 13:11:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 867DA8D0001; Tue, 22 Feb 2022 13:11:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 730A38D0002; Tue, 22 Feb 2022 13:11:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 5F8658D0001 for ; Tue, 22 Feb 2022 13:11:08 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1B3B0186AE402 for ; Tue, 22 Feb 2022 18:11:08 +0000 (UTC) X-FDA: 79171207416.29.FB42254 Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) by imf11.hostedemail.com (Postfix) with ESMTP id 74EF04000C for ; Tue, 22 Feb 2022 18:11:07 +0000 (UTC) Received: by mail-yb1-f174.google.com with SMTP id j2so43128025ybu.0 for ; Tue, 22 Feb 2022 10:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vv7itYaWRJkHxlIs8WR7327QmS0peJ/llMiCwV0cNp4=; b=ntHc747k5aYWBHe1Z4y8Fz2hJW4Fo8vJrUB6RCyrfijB27K/aykNq2x0JK92KJb0Va pwP/1ZtoHgqMRBWweSv0ilf1vQEpcsnawUZ0OAwYy6w/1iI/mrGqGG9vblnHUVZTtDJx MHpZPxOKwaHVUSPTyYbjSv/ykCPTrukRBMGvv6mW1RzTnRHsXjZ8lU2fDtFFAfNu41AY szR4OFwkl/O4caKzEa358VDkAMObruixk1FuzcCX5OkNRTe/Nx4uaLOmn2fq0PgYakiu 1FJqjif+5EnY6SbVyUHV785ILiApP/kChvVG7PCui2yjHtDnm9qcBmgOF6psQ6T3yPVo pMJg== 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=vv7itYaWRJkHxlIs8WR7327QmS0peJ/llMiCwV0cNp4=; b=TTgc4tjFocmyWH+acne2VEdti4VVUmterQ3F2/56U5DwfJLihBOcD0QR6+f7AFiPL6 vyl06jHqZiFScZ/gMaR2aF4GNReQE930yKw9uKV6LSizqnYptLQCU1QmwsQFm3oelwk0 hrkP57TdrH2EMrifpL/DGlyANyUMV3c2zMaKof76mWeXQB2xaZ1rYpnh6oAZZ4OU0qyb eDrK5P5lcO8e0BoyNGiSkHlmjXn/lkEBDy/Rn65JztJ3uf2MqeH0SGUuAb/OPEq8aRUB SR5uw3Jm4wXSzMAVJekrfrePdC7xZBj1x5/uYW6oRazKtLlfijP/CN20q2OaRuolv387 fv/Q== X-Gm-Message-State: AOAM533qqA7nBeC42u/FFZIWk/SnBiku+9f0J9aCEI5vcqlviAqa/imr 4ebsgVDPlq01cxV6KJwKZVwApOPA/ESJrRG+Ea/pRQ== X-Google-Smtp-Source: ABdhPJwaQcThOmQlZPbhYVDEyVpHw2j2uPxfEwpatir200X9OqS1YlFR+Zo074lIz0Rev1o0RmzFhEcmDSaxOvOkHZI= X-Received: by 2002:a25:e057:0:b0:624:2ade:2a8f with SMTP id x84-20020a25e057000000b006242ade2a8fmr23575031ybg.87.1645553466469; Tue, 22 Feb 2022 10:11:06 -0800 (PST) MIME-Version: 1.0 References: <2d44632c4067be35491b58b147a4d1329fdfcf16.1645549750.git.andreyknvl@google.com> In-Reply-To: From: Marco Elver Date: Tue, 22 Feb 2022 19:10:55 +0100 Message-ID: Subject: Re: [PATCH mm] another fix for "kasan: improve vmalloc tests" To: Andrey Konovalov 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-Rspamd-Queue-Id: 74EF04000C X-Stat-Signature: 15w8641z6ahqfboope9mi1ucau54mqqz X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ntHc747k; spf=pass (imf11.hostedemail.com: domain of elver@google.com designates 209.85.219.174 as permitted sender) smtp.mailfrom=elver@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam05 X-HE-Tag: 1645553467-626096 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, 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?).