Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3531776pxp; Tue, 8 Mar 2022 16:47:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEDCzJId1ACNYzbsH1vQtWUOHI77V9Dbu2Jo8jp7OlJqhanRkBv32GUQ3lvn/Iw7W4tH3s X-Received: by 2002:a17:90b:e08:b0:1bc:2b0c:65aa with SMTP id ge8-20020a17090b0e0800b001bc2b0c65aamr7484835pjb.102.1646786821842; Tue, 08 Mar 2022 16:47:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646786821; cv=none; d=google.com; s=arc-20160816; b=QeZa8oMpcHMmpcdBvQctanb9xcEJFbsCqF9aZoF4ko1+ofrdPS5LMmrXEb1qyPDhNN GoMUKDxjGu5VTXjecs/mUzPSr9ZDAa98FK1zg7PyLm8RUfZ8iaTT2h+LHNdObye5qhMi y9udqJkB0Dhho7V69O9rOeSpGysOSkJk5XOFfefaXCs7GFiL/z7G8ZIFJwfNZFY1dzG3 fNwV1V1yIsTxKATH3dyu99MXgmQ2IneTFmzbMQbVeG7U1/aD7rqng+O9d61fnN02vsjF eaFWtrhx63Uv9y5yMGBuAjBvA7eLFylEW7gZn9XOuDdb+YE6d2HKSaZ54uGVz9jPUJ1C TWLA== 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=QL+ZtmXXGFLuTx2y9WXZomB2eATV+ikv3E06Gw8vFq0=; b=g0o19FGgZENBc1nyZrFMNeohG7fNy8r/LJphCMuDnM93mQUor22CaHY4ft8SFmA7RZ ypcATuJYr/6shHSUwAAN5S2mDpg3Twe4YsIc+FuQYSYbyYlwH1dXX6izldznd0CoKXSm Futjt8yhX7tBQ+c3oy/I2apQXvZnnwbOk4HWQK3wZ/FQyXtECTJqachX6IU4Lx9XM4z/ 88mT1fIPC9iRx3uN5LTnB4qUZ1jSDHbpK/WP/a/ByzFKOK2LuStQcjDy2NxbUbKyL1tn jkmk//C/1wlDLZwRsrcK6jvEFC4Y8Wg/uwU2J8qpRy8SQchlShgAo6Cjn0kTyS1b7rZp VPdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I68j85a6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n18-20020a170902f61200b0015025d1d305si439799plg.465.2022.03.08.16.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 16:47:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I68j85a6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C05513CA15; Tue, 8 Mar 2022 15:59:28 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242991AbiCHPbz (ORCPT + 99 others); Tue, 8 Mar 2022 10:31:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231561AbiCHPbx (ORCPT ); Tue, 8 Mar 2022 10:31:53 -0500 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 967124E395 for ; Tue, 8 Mar 2022 07:30:57 -0800 (PST) Received: by mail-il1-x130.google.com with SMTP id b5so11602526ilj.9 for ; Tue, 08 Mar 2022 07:30:57 -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=QL+ZtmXXGFLuTx2y9WXZomB2eATV+ikv3E06Gw8vFq0=; b=I68j85a6/qjvW0V3IavZmXBtBc8pD6pwX7yGYgP70N3qfY/KekXPn14gqHuXHQi3iz 45y3wjsfeAJoSBGDTb3kxwyUuzILLoXo2eFo4z3nCSjYHUU1aBHr+B04M3kP/DctZcqU FaE5+rdNtdNZSVsKxPIjL2TKvhOwT8EAqwk6x0LlVDTkAwSZt0rUy3ePzZmsgeFzrtgj IcJ9yy+JXS0yPZEfdAsbdDcR8t9w2+5GyzVroPUq4B5oDrMBfwsfDFPB6QqHpu/tXFOv cMBPSu+cM5zifvwDyOWdetr6U++L+xykJjh1Zou3iBXvPcrzyzw1BY2lrHkSovZ8zh++ GxXw== 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=QL+ZtmXXGFLuTx2y9WXZomB2eATV+ikv3E06Gw8vFq0=; b=GB85ffSYopOdsVyjfYoYgfz8yEhqJ1Mupj4vjsMH15nE+TeiY4G/EEZHQ3OIDYhOyg zDiycAp8lfCBuGFDqyQZJDEEa11VkntdhUvPqNIacgKmVIBFmJnIkrbA0U2bk5a2i+Fh utAZK8hGlGV10k2TJUQ10+UzKyDLA+lGEpcPzkugLVs691OnXAnq0p4ra4/z5vSolOSG ZPCdHtvhIx6XhJLWw/dnafLZUsNqcR6CBfSMHImCBKF7y8fAFNgjRlWV7oj3Gdllu+dG YcFvyVqd8NEMrQzPxlod5OC8n/BSQmq8JxmamhWwDLg/tbODHpM0CIQ1tpu8Hirs0d9E jEnA== X-Gm-Message-State: AOAM532yTnwoCC9bNMLzXfSEzmdj4zTQD0s0VrGCsHNS8QZomim39wMO Sn6+ykrlZbEenHiy8ULY6w9m9nfd7PX0Z2QXgkc= X-Received: by 2002:a05:6e02:20c3:b0:2c2:9e23:8263 with SMTP id 3-20020a056e0220c300b002c29e238263mr16510481ilq.248.1646753456934; Tue, 08 Mar 2022 07:30:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Tue, 8 Mar 2022 16:30:46 +0100 Message-ID: Subject: Re: [PATCH v6 31/39] kasan, vmalloc: only tag normal vmalloc allocations To: Vasily Gorbik Cc: andrey.konovalov@linux.dev, Andrew Morton , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev , Linux Memory Management List , Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , Linux ARM , Peter Collingbourne , Evgenii Stepanov , LKML , Andrey Konovalov , Ilya Leoshkevich Content-Type: multipart/mixed; boundary="000000000000d579e505d9b6aa3d" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 --000000000000d579e505d9b6aa3d Content-Type: text/plain; charset="UTF-8" On Tue, Mar 8, 2022 at 4:17 PM Vasily Gorbik wrote: > > On Mon, Jan 24, 2022 at 07:05:05PM +0100, andrey.konovalov@linux.dev wrote: > > From: Andrey Konovalov > > > > The kernel can use to allocate executable memory. The only supported way > > to do that is via __vmalloc_node_range() with the executable bit set in > > the prot argument. (vmap() resets the bit via pgprot_nx()). > > > > Once tag-based KASAN modes start tagging vmalloc allocations, executing > > code from such allocations will lead to the PC register getting a tag, > > which is not tolerated by the kernel. > > > > Only tag the allocations for normal kernel pages. > > > > Signed-off-by: Andrey Konovalov > > This breaks s390 and produce huge amount of false positives. > I haven't been testing linux-next with KASAN for while, now tried it with > next-20220308 and bisected false positives to this commit. > > Any idea what is going wrong here? Hi Vasily, Could you try the attached fix? Thanks! --000000000000d579e505d9b6aa3d Content-Type: application/octet-stream; name="s390-kasan-vmalloc.fix" Content-Disposition: attachment; filename="s390-kasan-vmalloc.fix" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l0iafuk20 ZGlmZiAtLWdpdCBhL21tL2thc2FuL3NoYWRvdy5jIGIvbW0va2FzYW4vc2hhZG93LmMKaW5kZXgg NzI3MmUyNDhkYjg3Li42OTM5NTRmNzcxZWMgMTAwNjQ0Ci0tLSBhL21tL2thc2FuL3NoYWRvdy5j CisrKyBiL21tL2thc2FuL3NoYWRvdy5jCkBAIC00OTIsNyArNDkyLDggQEAgdm9pZCAqX19rYXNh bl91bnBvaXNvbl92bWFsbG9jKGNvbnN0IHZvaWQgKnN0YXJ0LCB1bnNpZ25lZCBsb25nIHNpemUs CiAJICogRG9uJ3QgdGFnIGV4ZWN1dGFibGUgbWVtb3J5LgogCSAqIFRoZSBrZXJuZWwgZG9lc24n dCB0b2xlcmF0ZSBoYXZpbmcgdGhlIFBDIHJlZ2lzdGVyIHRhZ2dlZC4KIAkgKi8KLQlpZiAoIShm bGFncyAmIEtBU0FOX1ZNQUxMT0NfUFJPVF9OT1JNQUwpKQorCWlmIChJU19FTkFCTEVEKENPTkZJ R19LQVNBTl9TV19UQUdTKSAmJgorCSAgICAhKGZsYWdzICYgS0FTQU5fVk1BTExPQ19QUk9UX05P Uk1BTCkpCiAJCXJldHVybiAodm9pZCAqKXN0YXJ0OwogCiAJc3RhcnQgPSBzZXRfdGFnKHN0YXJ0 LCBrYXNhbl9yYW5kb21fdGFnKCkpOwo= --000000000000d579e505d9b6aa3d--