Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp596403pxb; Wed, 27 Jan 2021 16:13:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSTD1hoj5vAchHlHg2yPqRdjkXl6/2knuVn053Q6da/qIDuSH5E7upISANgaSZFTY7pGn8 X-Received: by 2002:a17:906:a450:: with SMTP id cb16mr8952716ejb.167.1611792816095; Wed, 27 Jan 2021 16:13:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611792816; cv=none; d=google.com; s=arc-20160816; b=Eh5YoLrFppHXOZ8YMkCa7be1fAqgBYtWAN4dVk2zZpRFNRlrTsSwyAQZb76G8llGBR nzn6k+khag6sWgwP8h2JOlciS9CuC62C1kgYLpultikOl8E0UA+A4sp8hKPY91OhxzDs cjSyFUHJ1oQPsOeafKXQo7WfIL3jrh6z7DkwdQEkec5d4+W3HdLA7UH8+6VaswCc7lHF J731UsNgBd9Tsq0ZFLQEd7aHhmiJnK2DffCd/kIJ4OzgizI/YwsIguvutKWBIVuxrA5P wnpJSKMQdHSM63As8dH0CKCJxqA1tIMcKzxPcslLgurYHp/3ss6eXAk9/rYIqYX8fqLY gMLQ== 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=EUEoIQ9qWT1kGbtvZ5eDvB5BPzX/7KNE3wZ/wAEqoFw=; b=C4Npzi1ZxTvYr9yFeGMsDZcOHFrKroph2Gnxw2DEyrdsJ7W/DrI6gXyADvNIe1b0Go 59zcp7vA5rjcas4qOZvSpDqJ+minkq4GNhYvGgIqsioOLHtH3BUjwb9qT0DmER7PT7kn 5hr58XK4jbuFtLUpAGFPui6R3NOwmMReU+PrXNYkerT/4xBeifGXcn6c7u0EbYER7tW1 DethvftNT203hzBugRp3nVZcP5EUYUl54obIDbZKBjwBLB/perqL18lOiXyxDzHKAofa P0NSIwjyoX5grxeA8zg73DwWy5vXqThbfpqEMOnURo8Je+dFJ6nic5NIRIkZmVYcbC6O A0aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uzIRLSc0; 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 q18si1455051ejt.469.2021.01.27.16.13.12; Wed, 27 Jan 2021 16:13:36 -0800 (PST) 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=uzIRLSc0; 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 S232080AbhA0StI (ORCPT + 99 others); Wed, 27 Jan 2021 13:49:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231246AbhA0StB (ORCPT ); Wed, 27 Jan 2021 13:49:01 -0500 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C71E4C061574 for ; Wed, 27 Jan 2021 10:48:20 -0800 (PST) Received: by mail-qk1-x734.google.com with SMTP id u20so2773273qku.7 for ; Wed, 27 Jan 2021 10:48:20 -0800 (PST) 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=EUEoIQ9qWT1kGbtvZ5eDvB5BPzX/7KNE3wZ/wAEqoFw=; b=uzIRLSc0TOU1ddoC72VU6but+/NDZONq2N4qyfAWJHXSzRZ0y5RlIMeWrtCTRRs3cI EFPrDBoylPuFIUV5iq69uqRa3PxYK3di2Ez7NuFsadYoK5ZgYjwnRbQVi8fpaDuK/pQM mPT4UFyYZUrkFb5OAPdbiUdPr1INCMFixnvmX3wdfeQ4pnMxs5HF7J3ZEtD2sOadNMaD pbXUk911hKYsB0O7umukaCuy05nKM2XEHG5MROTawp6UO2ynMfJixaVW7UfopdLhBDjK 7ESFU9ueSy2dy7dAqBOpq7L70g1qlacWigu1Zk8zj7+o+3+hCaTxrq5U3ypwoZGsfvt8 yVsQ== 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=EUEoIQ9qWT1kGbtvZ5eDvB5BPzX/7KNE3wZ/wAEqoFw=; b=bmSt88VbGH9Fbl74SXvy04bzxOejpbQXTN2t5QX47wTVhVq1vhIosHo2AGqwCOhqej geQnPXe5VHX2DLwUePnwY9ivIzvB1eNtN40O4/GYyIxRP5ZIABz8AAecnDsjXc8+kqGH iRKXGKQTfJs9lMvR2ijhbsey1KL7hH3M/xEDVsMqPOzls5C8X1+SNrnFmPoqes8wL7et JBIiOPMWNvlEtnUA8xDa+mYVI98iPCZwUxfHBMg00syK6Yuj/KQJfgLaCqb4m7Ch5ST9 50CLHlpx9U5pPVDXvQtEuynEzUTL5yaCmVYs5/3jChm3KeFjn424dVIjdiFfGSJiLFyP qVAQ== X-Gm-Message-State: AOAM530iLIfwif9G6a8uky9qbxvtmeB9vvREmQ2TsTymGd9Ia09yTaHK wWgidEIavrSuFWZO1kyhiBuYeFbfS7kooQVRZ8OOLw== X-Received: by 2002:a05:620a:711:: with SMTP id 17mr10862573qkc.501.1611773299798; Wed, 27 Jan 2021 10:48:19 -0800 (PST) MIME-Version: 1.0 References: <1611684201-16262-1-git-send-email-george.kennedy@oracle.com> In-Reply-To: From: Dmitry Vyukov Date: Wed, 27 Jan 2021 19:48:08 +0100 Message-ID: Subject: Re: [PATCH 1/1] iscsi_ibft: KASAN false positive failure occurs in ibft_init() To: Konrad Rzeszutek Wilk Cc: George Kennedy , kasan-dev , Alexander Potapenko , Andrey Ryabinin , pjones@redhat.com, konrad@kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 27, 2021 at 7:44 PM Konrad Rzeszutek Wilk wrote: > > On Tue, Jan 26, 2021 at 01:03:21PM -0500, George Kennedy wrote: > > During boot of kernel with CONFIG_KASAN the following KASAN false > > positive failure will occur when ibft_init() reads the > > ACPI iBFT table: BUG: KASAN: use-after-free in ibft_init > > > > The ACPI iBFT table is not allocated, and the iscsi driver uses > > a pointer to it to calculate checksum, etc. KASAN complains > > about this pointer with use-after-free, which this is not. > > > > Andrey, Alexander, Dmitry, > > I think this is the right way for this, but was wondering if you have > other suggestions? > > Thanks! Hi George, Konrad, Please provide a sample KASAN report and kernel version to match line numbers. Why does KASAN think the address is freed? For that to happen that memory should have been freed. I don't remember any similar false positives from KASAN, so this looks a bit suspicious. > > Signed-off-by: George Kennedy > > --- > > drivers/firmware/Makefile | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile > > index 5e013b6..30ddab5 100644 > > --- a/drivers/firmware/Makefile > > +++ b/drivers/firmware/Makefile > > @@ -14,6 +14,9 @@ obj-$(CONFIG_INTEL_STRATIX10_SERVICE) += stratix10-svc.o > > obj-$(CONFIG_INTEL_STRATIX10_RSU) += stratix10-rsu.o > > obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o > > obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o > > +KASAN_SANITIZE_iscsi_ibft.o := n > > +KCOV_INSTRUMENT_iscsi_ibft.o := n > > + > > obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o > > obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o > > obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o > > -- > > 1.8.3.1 > >