Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3545055pxp; Tue, 8 Mar 2022 17:06:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeKBeBcjr4L8jO3BaCXetld/xz0S7w63PdZ2IvvBR+PHE9bA0FWxu+rIv3DHBf8DTRiwq3 X-Received: by 2002:a17:903:32d2:b0:151:e18b:5411 with SMTP id i18-20020a17090332d200b00151e18b5411mr14830314plr.29.1646787959965; Tue, 08 Mar 2022 17:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646787959; cv=none; d=google.com; s=arc-20160816; b=ACULjOSJ9PYHbxsP0xlh2HL778kjn9wDCALyuhoJUqzLB1H2cRR97sciZxAgBmo20a x656B/v5THxfXZtgn0xBfLaqih4fffmQPF5uuhkxMmjfeaQcakBTP0bqVu4b4WZfbTUl GkUqInf1ICoeXQ2rIhmLvbyt36KXji7LRmyhixJCYxBRDn+pp/AUNl+dKE5oCEpHIfdP 0W/VM6L8K92DcPBGs5y9otHYf1sNTjdnXFSeGEdPHhMoj9A1bvtga/WqK7Bz8N985Bm8 ZymCqYHcrDQ0zH3cjJoG76Qy39NBOHEtOw+Cm+nunJ8GjwEy9gqdAd9iUq88sih7Ich7 n25w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=389I0VekDwwKFjdESH9plHsPrSJCLzJsP3F8jIyG3CQ=; b=vfEE1FmCCeUavUdbjc+zsEgXwukPUDnX84yR8WNJR/gVh2O/FnVTmcnq4hJXHLeyck IyxNbRNah5Vd0e1u8wPh8jSp+u8+OhdcLDisBFngnd7YNweW+1DUOZpLioE3pDTFkd+C HBFXBvQJrheOo53/CWkgbhKX7PQfICp+VGISVYgDQG2Fvw3MsYr0cmaR5nL92NYc+5pS ayXjgWVYNgAGKVAwr4uwLAFCsB/CVfP0T6Bbu1r9vWCJ2Yf2sFzNgIav8sDEelcoKNRs Xe2OF7BWXq4nJEvN7nDysuM2Q6bM5pxuaKZU+UYhghjveZ9LL9gqVJS5lJX1dk5wvoOc 3Lbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=k0Rh9qRi; 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=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b28-20020a630c1c000000b00373adabc9a3si404321pgl.577.2022.03.08.17.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:05:59 -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=@ibm.com header.s=pp1 header.b=k0Rh9qRi; 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=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 854FD172E57; Tue, 8 Mar 2022 16:11:23 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234676AbiCHPtX (ORCPT + 99 others); Tue, 8 Mar 2022 10:49:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231458AbiCHPtW (ORCPT ); Tue, 8 Mar 2022 10:49:22 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC66536B58 for ; Tue, 8 Mar 2022 07:48:25 -0800 (PST) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 228FjCGK012295; Tue, 8 Mar 2022 15:48:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=389I0VekDwwKFjdESH9plHsPrSJCLzJsP3F8jIyG3CQ=; b=k0Rh9qRiWn8uZW60/j8lNA2V8qQqifmmn0NvxnXcwllG6u34i+4vEiwGh5AnPxJGu+9q 2nQDhZzeosmI34cXCpE/o3yWRCNWMA94ZQow6cyxLpsOylHLgg6zP3H6bEminH+7AXmq hsiMZL1vwZ2PXVVBFrlinVDz2fVnN2HPF86UQvHBWHe5ZoNdWxM0zm6EI5YCqT/mo6iJ tN/CH5veMzwjaMmo2QFd9hBeaabW6VZqAcwmnkXWvrnUYyA4jVjfLV2/HyW1CIebgTLp xdsg8BVexfB09VtzSe8kxrc05NHa3Qucnz7Zx/KbqYuFyGexgQ1oFaj0ffpZK5VNzhnU gA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ep03vmx3x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Mar 2022 15:48:11 +0000 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 228Fit4i026728; Tue, 8 Mar 2022 15:48:10 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ep03vmx2u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Mar 2022 15:48:10 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 228Flwmu020523; Tue, 8 Mar 2022 15:48:07 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03fra.de.ibm.com with ESMTP id 3enpk2t7un-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Mar 2022 15:48:07 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 228FatBU37814606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Mar 2022 15:36:55 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 502074C040; Tue, 8 Mar 2022 15:48:04 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0C7C4C04E; Tue, 8 Mar 2022 15:48:03 +0000 (GMT) Received: from localhost (unknown [9.171.12.198]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 8 Mar 2022 15:48:03 +0000 (GMT) Date: Tue, 8 Mar 2022 16:48:02 +0100 From: Vasily Gorbik To: Andrey Konovalov 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 Subject: Re: [PATCH v6 31/39] kasan, vmalloc: only tag normal vmalloc allocations Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: cnJS0jaZ73zICUKHNxVHC0PllMeIiWKp X-Proofpoint-ORIG-GUID: SJYIB1z1q2pLAWtXKFCctbL9yPjmQfqd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-08_06,2022-03-04_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 mlxscore=0 spamscore=0 clxscore=1015 malwarescore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 phishscore=0 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203080081 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 On Tue, Mar 08, 2022 at 04:30:46PM +0100, Andrey Konovalov wrote: > 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? > > Could you try the attached fix? Wow, that was quick! Yes, it fixes the issue for s390, kasan tests pass as well. Thank you!