Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5434805ybp; Tue, 8 Oct 2019 02:50:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwg33H8kpgZCnse+CaqIS3b7a6nUkgq5qssVvoVYFp/6oRz7ChqUnaJa58PtisQgug9cjDD X-Received: by 2002:a17:906:3e96:: with SMTP id a22mr28173121ejj.268.1570528202368; Tue, 08 Oct 2019 02:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570528202; cv=none; d=google.com; s=arc-20160816; b=haT7njSJZv1DokmicGdzI0lgwlzQZIsDY2Te3edyf/LZU742cbxsrIV7/R/9cHxWde ZE59cRvtYcQyrdDYPOuvPM+12oyVOb0FZzfA0MiP4dhXo+cQDQk1lMlcgEyRnhi05LUi zdWhILwVsmjb3S+Jbwmwx47OrAuuAzCAbO+1MnyzoLkR9uVCEQfuxl3tKyadXJKMbZ3f rGxUQC4//e719e2qEoxTdMPl8yLRwV3z8uJwgBmHZGyvpMqMIB4vTPXTQ1/1TAIEXLc8 w26ZLldPsd6+FPGL/OussuVP2wX4HDdLA7WB4E/raybwKPpWCQ9wNoSBAzSwpV+jrQOu XKCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=qLgfnJa8TF+fqJn6Csm2aNbaRpOd4zDzxzOPf12HbGU=; b=xfsxvPHf5mLB7Haz+BRPHqPImTxawgKDvIspmcwJGmuY2ZM4War4EQgB78jBl1kR6M p7M+r4wLxmBuF6TB2SQfPN2R458HotQ3ICO0U6/bziAFVyxOE7HnBv0r0soOVmOyS4CK S9Pkrg/PXDHaXsUqmJxaQ/dLV7362NppUJJtiYPDaJV3e/7wBNo9Khe9BVqGbZ/FaaZR OdENWeavAvzQSfLgyl/rpRBe42Ja/cn3Lt7CPAYjKMgGzTZuGckd9aq4AL6epO9vZdth WPc8xXVd5fvkZy6ck0mr3woViSZfPuAOc36JNVGntfQBJSkvUn1YS0veWROBsB+2iHZO fIiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b="cXYZ/yJK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21si8488388ejq.343.2019.10.08.02.49.39; Tue, 08 Oct 2019 02:50:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b="cXYZ/yJK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730128AbfJHJrc (ORCPT + 99 others); Tue, 8 Oct 2019 05:47:32 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:38023 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728866AbfJHJrc (ORCPT ); Tue, 8 Oct 2019 05:47:32 -0400 Received: by mail-qk1-f196.google.com with SMTP id u186so16047505qkc.5 for ; Tue, 08 Oct 2019 02:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=qLgfnJa8TF+fqJn6Csm2aNbaRpOd4zDzxzOPf12HbGU=; b=cXYZ/yJKZHxhLdFc+J/7aqzW3aWMwrEzbFfkVK6b2STx6QHscvIWH7imnBEe4+5hu8 /u0EZHWjyQPT1nvtbEF/Q0Kg9i/YqCDMse7zLQQlF9qvnZzDAYO5lv25xZR6t9BXHcuq ah+dWBDMRgaikW+rvVfyvyISzE+jZZi8EytVeEJcb33yP6AZXWRPX4ij4dNNh6n//HA4 ZeX5K7IRgHSrqr/EWrbf7Id2OL3sA+Y9zt+wp0c875bq5Eka/sHOIgqCnKbwSuEhZiRH Ywn2sJjbAl32mBITdW2nABbm8slhsaxFggyDU0O6KlXeMgbBlIYIBTgAtq0NFFUY9INh Kx7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=qLgfnJa8TF+fqJn6Csm2aNbaRpOd4zDzxzOPf12HbGU=; b=tQSz0dNOI5q/EczKBJDk0T5Yzrg7UGYKZI0v9lkAjuAY6qTAZQZLmrYD7ThSEK07bY 2ADQfFRVa/Xkt6ZrYbOIGE5fSU5vIEH0kakxgP2Q3yd+coI8YSt8pE4BRDh5W9lTpRfh tPXWY/lyPYoiH9G3Bx79G0cVtaQ0YBkAyIZS+IAtGNzhkVGY8rBCSKVvp75ZW4KNhtPJ ngnMmoYbwiOC55FZg9dxTrn+K9Zo7aZtfTZKFU/9TjVPMi9NNXkudiEYKlM/40djUodC Y5xXJgPppXeCgm0UHjypPBzqlL3aDs4gKxl3m2pCLmbJk7e4c3WLDAskywAHDnjLvKik N4Cg== X-Gm-Message-State: APjAAAXglB3c09VIEQLN8lr41/+nDc/OVZX21eRLxtF4jwZQuJBMgUv4 AM2dQ/P3zG4UyCfk7cyKgyymGQ== X-Received: by 2002:a37:4d4a:: with SMTP id a71mr28591867qkb.327.1570528051524; Tue, 08 Oct 2019 02:47:31 -0700 (PDT) Received: from [192.168.1.183] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id h68sm8988573qkd.35.2019.10.08.02.47.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Oct 2019 02:47:30 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] kasan: fix the missing underflow in memmove and memcpy with CONFIG_KASAN_GENERIC=y Date: Tue, 8 Oct 2019 05:47:30 -0400 Message-Id: References: <1570515358.4686.97.camel@mtksdccf07> Cc: Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Matthias Brugger , LKML , kasan-dev , Linux-MM , Linux ARM , linux-mediatek@lists.infradead.org, wsd_upstream In-Reply-To: <1570515358.4686.97.camel@mtksdccf07> To: Walter Wu X-Mailer: iPhone Mail (17A860) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Oct 8, 2019, at 2:16 AM, Walter Wu wrote: >=20 > It is an undefined behavior to pass a negative numbers to > memset()/memcpy()/memmove(), so need to be detected by KASAN. Why can=E2=80=99t this be detected by UBSAN?=