Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp666132pxk; Wed, 2 Sep 2020 11:30:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5jBjJNozgWZ34u9KRrYHmT78Fvifz5zWQmejkNHepnbegxBqYdgKjFjTBXMsJ8/EJaaJu X-Received: by 2002:a17:906:4dc7:: with SMTP id f7mr1338557ejw.261.1599071445809; Wed, 02 Sep 2020 11:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599071445; cv=none; d=google.com; s=arc-20160816; b=kJAx+GIU/N7kJ4frYabz/nmAQPa5J/XhqMco95Uy0nBQGrYy/i4wB0pqmUpOhKuLDM 7/0cpBSJdnTQdF38FT0P+xcRqaf+bE20A73EjXPzyEitfv0SwYFv0+rLx0whUWlVab5v e/OYOCSuavptXCWpObFvRI8bx6z11JCPuna0k/aoMK/9+m2U0We6UgRR4sdj2z4C2CGP TuBPwQvMFXI38LgpNYflAc6vgScQ7K+SPhnWkmIsra0hPuSqv5JraYYwNZPWvHUQlsnj JCIFITLSsSUx8ffB6EtGLjVhA1uTE5ZQdkd2C3AM5HzbNfvik5ky5jtdDrsQkUC423Vp yWmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Z6I0gofzLwArpC9CQ8lKOD/LoW6ktlk0OSBFVSWMzlc=; b=UcMGNvOeV9Leur3B/gj9oLnrSNpwg+0ToR7HISafEHjtUZqonSZUsyVEKY93ODBYO4 Edzn/o+RZMGbkMYZW9w/i2xL02Udq+vX1NubvFOqHLdSkscoqYBsU86oJdNRcdyCax2W HcFKt1g3DQHGH05ZF38u8nqpyV99/di0qWbUI3uAJDl+pB5vCcUtDFD/ROOlsROKIBEZ 7YfYKgoirp2m6HU9XVvNFimSejgZLWoKz8/d2cfPuGpGKjd8Soj/JZU5Y9vlxT+C2ufd rY/iIMp11eGVzQD8Rsa3ZLXM19/MbfCag9Ejq5bG/SWivVoYDN7sGZCS4rXm0Vq/yb4B JNSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=b9rO7lav; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz7si198409ejb.441.2020.09.02.11.30.20; Wed, 02 Sep 2020 11:30:45 -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=@linux-foundation.org header.s=google header.b=b9rO7lav; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727919AbgIBS1f (ORCPT + 99 others); Wed, 2 Sep 2020 14:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbgIBS1e (ORCPT ); Wed, 2 Sep 2020 14:27:34 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6640C061244 for ; Wed, 2 Sep 2020 11:27:33 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id a15so355159ljk.2 for ; Wed, 02 Sep 2020 11:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z6I0gofzLwArpC9CQ8lKOD/LoW6ktlk0OSBFVSWMzlc=; b=b9rO7lav1hRdO25h2/k4WJpIcdR3s9JWnsi6rlPcBqQmfi+M/FzSgBmM4WmT600bsX Aml+MhPOC+qa86ChFvFjU2nPWdJjTZB/wuEmwXaqFLDuuCabexXfXjqvQoQhYZkjrp4s TmVObtmfAsUs3TvRokytqepl/DdT2H54lzc0A= 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=Z6I0gofzLwArpC9CQ8lKOD/LoW6ktlk0OSBFVSWMzlc=; b=fXv/NTD76VUOoJDfhaHvEqZchY2QelLyXXKxCyI+b4pmPOqus+VeXG4vGU36f7t2BG WfMPrdTNk8Agr8cH9zvPDTjE5haW3NMN67sQie8edgp1RejfIa5ZQIwGFAsdvLPOUh3t ybCAB7udhZC5372j4T+VJJzraYa6BgRo3RF90uAdjdxzl9fBXHEcPip/m3yjaUJR+8xA KDZPRE8Ur80Kq//D3xCG+XRQRYtWBNNrDXjLBzx9f0Y2qzT6Pgh75K80GsrNIv51jfzB GmUT1FO01fWhdw8ODIMAZ2A14AUyMVOdPu9Cg8e9gfHUBf3jnr5OW+OYYMI0lqxBsd6o T+kg== X-Gm-Message-State: AOAM533jbOF4bFyemvTBOH6Fs8FnD4Qt+fBNkS73qUDJ5IifCUxq3sMz hNxiow1eo8oL13nzAzJt2jn8s8buCUJTuA== X-Received: by 2002:a05:651c:124e:: with SMTP id h14mr3725396ljh.384.1599071251526; Wed, 02 Sep 2020 11:27:31 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id w26sm87003ljm.30.2020.09.02.11.27.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Sep 2020 11:27:30 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id k25so292693ljg.9 for ; Wed, 02 Sep 2020 11:27:30 -0700 (PDT) X-Received: by 2002:a05:651c:104c:: with SMTP id x12mr184552ljm.285.1599071250062; Wed, 02 Sep 2020 11:27:30 -0700 (PDT) MIME-Version: 1.0 References: <20200902085513.748149-1-leon@kernel.org> <20200902085513.748149-2-leon@kernel.org> <20200902174600.GK59010@unreal> In-Reply-To: <20200902174600.GK59010@unreal> From: Linus Torvalds Date: Wed, 2 Sep 2020 11:27:14 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH rdma-next 1/4] gcov: Open-code kmemdup() to work correctly with kernel and user space pointers To: Leon Romanovsky Cc: Peter Oberparleiter , Linux Kernel Mailing List , Colin Ian King , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 2, 2020 at 10:46 AM Leon Romanovsky wrote: > > Definitely my explanation is wrong, but it was my interpretation of > "BUG: KASAN: global-out-of-bounds in kmemdup+0x43/0x70" line. I saw > that the failure was in memcpy() inside of kmemdup(), so I changed > from memcpy to be copy_from_user() and it solved the KASAN warning. But the actual patch attached to that explanation *doesn't* use copy_from_user(). So your "changed from memcpy to be copy_from_user() solved the KASAN warning" explanation makes even less sense. Because that's not at all what the patch does. Linus