Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp469038pxt; Thu, 12 Aug 2021 02:44:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjjpoU85pL7JsR/UWyXm2h31Xqc5Erg9rDArdVYFNcT8RCkW1m9ETYWpkvxP/PS3hIrcKa X-Received: by 2002:a5d:8b8b:: with SMTP id p11mr2399057iol.77.1628761496628; Thu, 12 Aug 2021 02:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628761496; cv=none; d=google.com; s=arc-20160816; b=Kvb7uGwzVILv3CqbnrzD5gBvU+nrj90yM4Oh3lMspIiXUttTMIcJgeciBP1dHazswf lAgO29I9l0+ApUNLu4IbYUB2EJue6HY6d8wcDKgpGkO6j1u6L7G+v+uiaXAEY7fsvftZ 5Xec9o9qxKuz+2jKecAJ4sPIEGlWhQftNfKu4iFjpw6KDI/bE6v8Mw5V3SFHwvcaOurm uWeXiY3Vdi77dpVQqle4+mSxdbqAO+Rgya+vdBFhvMyemluTTLKypQL0fWtkTobpVcAw sMy+/aQA5Oyb23PXSFVCTuX69GnIS7WQDaFUvSO4b641JrH7gGq43RtDDley6kg8e+xo oOdA== 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=glSRtZn0PFX+XapwdsQxtT//X4Ni5wcQnHCn2+naPE0=; b=n2YXL21eAX1Ga5Kw0fdZJ6ZFTnUI69Xf9WaVagAqyz8ecHADcx7zzy6rIOAm+zg7/X 3NeLvqPxCGjes3AWROV82wnZ8G1j3L7LutA3E8ul5jyHItikjX6hCYgRsmgBLyuNwa5q l5cClQKT/8r0xZsUzErIULeAOIZpNxqHN2Ari69RT36fUlvcq9Vfv1jECZIvIsx5wXo3 n7gGFAX9PbIQuxap4Ghtj3v5s87PRzZMxhppieBYBf6nb//k2sCabLClmylA+bDyCJxM l0T7hefWE6z/XzC8eDsWOAF1ouJ/irAc4E7jW8G3dnrI8f4RJkPzRFPEpGz1DMHQ1u3C PEFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UHg5LO9a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si2258654ilq.77.2021.08.12.02.44.45; Thu, 12 Aug 2021 02:44:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UHg5LO9a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235498AbhHLI7Y (ORCPT + 99 others); Thu, 12 Aug 2021 04:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234600AbhHLI7X (ORCPT ); Thu, 12 Aug 2021 04:59:23 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3549C061765 for ; Thu, 12 Aug 2021 01:58:58 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id bj40so9269167oib.6 for ; Thu, 12 Aug 2021 01:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=glSRtZn0PFX+XapwdsQxtT//X4Ni5wcQnHCn2+naPE0=; b=UHg5LO9a6h4YMLmtIURwo12v57QKDIMxCUykfKcMR4UqfxdWKLCkThvo4Zz4fnXZbO oPTjDMSeqwgGAUFRZL47F7L7dDap+mM9lQrpEbdTj+V1PPl2mDD0sMqoAnar7gxzq2tK cYaMYMloamBz+t6QO7cTKHRk51NzB+Ic6zfRoHcAdWbx7UP0vj/OSjR3aED9sEORUm1+ d6h08PAArp8Tk/cEYNCBdttUirJXx8yW2XhuJYG3BY/R9Mr5NJmGGc7ttrikeI+hVDfW YTBcxefrIvMsjgjYk8LvEVO/pppWtOVwtsIA/SPDqkM6fJ5j3LKWu1cdAmt3vfEgrIYV wQAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=glSRtZn0PFX+XapwdsQxtT//X4Ni5wcQnHCn2+naPE0=; b=HvdGVLVV013TMvGY1Ayok7n2Hx+b3Ou4dGR/yN8Y9g5CmVzPWRNrGMbqo46ZszoNmM i7XG8VU1PcAPa+Spv7bxF3WQajpzP2CJ+ohW1ReTivBxrzy97XBBwlDQgnPpAb1UxjHG MlTanWogQqOMDaTTh2RWmhewR7Zuc9IIOf9tDKukuXX+KNuBRrorOyjFDCjW4UpDPDu7 t48zwMXid3Ai5bqSh7DYCT/gCGG5+3+AKkakS3vjUfKj8OItOyElzklI052QZg+eOXjs uXq/g0kOOD3aVBLcH4ML/mT9TAn2bvJeeAPeeVcI5/hDHXVKlmX3vejLlYl3Wp0AEWz+ pu+g== X-Gm-Message-State: AOAM532j2Ylvb/jqFOtRpUbAb1TgJ/QJgejuk5Eth0DcEXFWtk+7sgHW SVYBDZoS2op4/0Qx8PgazDWKXiGztGsQVCS9ExJY2Q== X-Received: by 2002:aca:eb8a:: with SMTP id j132mr2513361oih.121.1628758737993; Thu, 12 Aug 2021 01:58:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Marco Elver Date: Thu, 12 Aug 2021 10:58:46 +0200 Message-ID: Subject: Re: [PATCH 0/8] kasan: test: avoid crashing the kernel with HW_TAGS To: andrey.konovalov@linux.dev Cc: Andrew Morton , Andrey Konovalov , Andrey Ryabinin , Dmitry Vyukov , Alexander Potapenko , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Aug 2021 at 21:21, wrote: > > From: Andrey Konovalov > > KASAN tests do out-of-bounds and use-after-free accesses. Running the > tests works fine for the GENERIC mode, as it uses qurantine and redzones. > But the HW_TAGS mode uses neither, and running the tests might crash > the kernel. > > Rework the tests to avoid corrupting kernel memory. Thanks for this! I think only 1 change is questionable ("kasan: test: avoid corrupting memory via memset") because it no longer checks overlapping valid to invalid range writes. > Andrey Konovalov (8): > kasan: test: rework kmalloc_oob_right > kasan: test: avoid writing invalid memory > kasan: test: avoid corrupting memory via memset > kasan: test: disable kmalloc_memmove_invalid_size for HW_TAGS > kasan: test: only do kmalloc_uaf_memset for generic mode > kasan: test: clean up ksize_uaf > kasan: test: avoid corrupting memory in copy_user_test > kasan: test: avoid corrupting memory in kasan_rcu_uaf > > lib/test_kasan.c | 74 ++++++++++++++++++++++++++++------------- > lib/test_kasan_module.c | 20 +++++------ > 2 files changed, 60 insertions(+), 34 deletions(-) > > -- > 2.25.1 >