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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 383FEC4360C for ; Tue, 8 Oct 2019 12:11:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0C91D2070B for ; Tue, 8 Oct 2019 12:11:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="m8OLP8o/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="eh8pCLow" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C91D2070B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kv9rbmpHFzT8k2/uhwqZcwpfhRS9OKfcBnlX7pt3XrI=; b=m8OLP8o/d1BL6Q 62myOvGJNlPiTP6yEJwfa7Kw9XQ+/AHh2ORno/wTwXGDPWOgPEpLZLcL+dmu0lhNPCgVDctrT66IX NLEl26u2VsbTuGKEQnGNym8o6DrdYunWHUa6C6boX67Y+5BTHUKmxYAKSYtk5oMs05cRBDH4kW/lv Uo7lS5EwXHk5yOLpZ7cPaQ+pvJqBhR8taZPHBzbAPFL9JPtOfooQJmsjNVCT3hEA1aeAseNJpk9UY lw2RfvxDLbTQGAPMdMwzgwfGMsThMxfVpUeYSqVeFF17vkd+ns4qRKl7sWg2BPVJbTMq2IYOzQZv1 wcxhBrLFRB0BnyTt+x4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHoL8-0007Q3-MY; Tue, 08 Oct 2019 12:11:42 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHoL4-0007Nd-SB for linux-arm-kernel@lists.infradead.org; Tue, 08 Oct 2019 12:11:40 +0000 Received: by mail-qk1-x742.google.com with SMTP id 201so16403367qkd.13 for ; Tue, 08 Oct 2019 05:11:36 -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=GMN6AE/Wckiy15zsiQVxc8Ha0nqrOTJmAoLEeM+N80A=; b=eh8pCLowBh+BgvZfmBoGRvtXPz9zE1aDs0RO30fbYsKrn8CCi0iz7dLb+5ZAUaoxjI h8+YdOrv4kFWisVv0+ypSez27VEQps+efiGk7jOMYv3keDR/Y6/soCbxUzNbJXsWmunL vpPylf8BdgPE/ZA1QeOokTinVOQWJUymEUANn2Y+dJMoeBbgBazYB8JxeoNrYQwBHkLP +Y93UIITl3fYH+rqskwFY4S7s0OHFw4upx8Nhqyxd6tVP1iDJRTOXsPTSYokzso/fTTr QdOgkswn28Rv8/n9whT/owI7R/u5774xcNIdbtAtjI/OLjhmtMk6lPra8liDCk+ffMra +nBQ== 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=GMN6AE/Wckiy15zsiQVxc8Ha0nqrOTJmAoLEeM+N80A=; b=EClDPiBcAzXUFRVOn/nOSGpB8cCa3bbv6tz5BgjnOUfEK+IK5p9VdfG3ebcUkCg1Gc b+Kr1Egk7HiolmGqu1O5XN6mg/f8hp5f4jJ2c+xqKyIccaVVH1yyJQZElaxEr4GrIiQE OxUGms4fLQpWJCcmo1I3kmTcRUG5yxtcV4syIF5a7D8aVHUbrTfSRT0DW7A2P5V0Teay kCU1/wR0YBA6xUSXb6AKESZcyfe50rC61k+HN/L2f7zphmFnRJLwV/7Fkp3HvVunYs1/ iH6foK61t7m6Uh/Z36t4F3gdRR0O1PZBuMO+oEZTuH1z22cTfcmNbkp7lwEeAHGcY8ca UelA== X-Gm-Message-State: APjAAAUvaqGVFHuHgOu7y2uWy5WZ6XPTDgx3ADdecElfOGD+29hENWj2 7hQ0+2AVoEhR+7s5WOze0jr+eRm95s7s6/3TFFMOVQ== X-Google-Smtp-Source: APXvYqyJTh5B6y0iJNFqTbgDhKIdXD1dXKap90/51GY/1HBwwtMG0+QVGVvei9Jaj15xHEza/1jKSqBJZkqQ4s2WLQ0= X-Received: by 2002:a37:d84:: with SMTP id 126mr26540903qkn.407.1570536695225; Tue, 08 Oct 2019 05:11:35 -0700 (PDT) MIME-Version: 1.0 References: <1570532528.4686.102.camel@mtksdccf07> In-Reply-To: From: Dmitry Vyukov Date: Tue, 8 Oct 2019 14:11:23 +0200 Message-ID: Subject: Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y To: Qian Cai X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191008_051138_937110_5AADA073 X-CRM114-Status: GOOD ( 12.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Walter Wu , wsd_upstream , linux-mediatek@lists.infradead.org, LKML , kasan-dev , Linux-MM , Alexander Potapenko , Matthias Brugger , Andrey Ryabinin , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Oct 8, 2019 at 1:42 PM Qian Cai wrote: > > On Oct 8, 2019, at 7:02 AM, Walter Wu wrote: > > I don't know very well in UBSAN, but I try to build ubsan kernel and > > test a negative number in memset and kmalloc_memmove_invalid_size(), it > > look like no check. > > It sounds like more important to figure out why the UBSAN is not working in this case rather than duplicating functionality elsewhere. Detecting out-of-bounds accesses is the direct KASAN responsibility. Even more direct than for KUBSAN. We are not even adding functionality, it's just a plain bug in KASAN code, it tricks itself into thinking that access size is 0. Maybe it's already detected by KUBSAN too? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel