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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5F2DC4332F for ; Thu, 20 Oct 2022 18:15:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F2918E0003; Thu, 20 Oct 2022 14:15:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A22C8E0001; Thu, 20 Oct 2022 14:15:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 592178E0003; Thu, 20 Oct 2022 14:15:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4A8A08E0001 for ; Thu, 20 Oct 2022 14:15:04 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 25BF240C17 for ; Thu, 20 Oct 2022 18:15:04 +0000 (UTC) X-FDA: 80042129328.28.47B214B Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by imf27.hostedemail.com (Postfix) with ESMTP id B079540007 for ; Thu, 20 Oct 2022 18:15:03 +0000 (UTC) Received: by mail-yb1-f179.google.com with SMTP id j7so536605ybb.8 for ; Thu, 20 Oct 2022 11:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DeaJx4U9U/HouZlNtQYOnX4gYJD8uJB8N7NUzo4qBYg=; b=a2MCT5vlybmeC4qOrKq1mQv6iHp2CSUKpl8bclK+jJ3F95+t8l7RITqq4FKR7V7D5d RTQyPOazIU1w+260r0OHUbAoyBfvaIW2Uz1heZei5l0aMW49e9q4siKxmHc9yJf+xESi jbZK1V8p0rLnevTG3vkpP7c+xwkyrOCLyzIPd+MCK4fLRLlblVJuh97LqYPdVNTGe1LJ AJPyNnEkMkFGUg+dprjg+WhcZlbO4BDska0bgnNqJ4zGarOHz+D/9DYBdDWay/+B/Auf Xn7Ro+CrCfnw/jJBAFT0YPgvvbbRQNFWJthG3yMcfxvjLEXWrA59eOL+BRsYuWlJu+Kb xD+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DeaJx4U9U/HouZlNtQYOnX4gYJD8uJB8N7NUzo4qBYg=; b=uNtywO4ecwBji9K1+SeWaPFwJVl3yHgw3xFeNS+00Zw6MHmiGRqF3PPjSkOcEPpmTI /0Bvryh1Cwppx9QB4q+3GdiAYE0hgL5Lv1cT1foZY12XTvuuHFrcv9s3Gmzjzqg4soJl H9nTP17cTeACJ4cw1u/acdE1IcS1vNeUEzkrFbNbRw4+HIeYJy7A6N24I0t1fH9Jecea XSOD0dvNwhmShYs4/RGy8nS+SdGaEoXanwCSXnoCNMfGEsPoBU9LxjySrvmg1TVKAPEI oWgEHoxsdUQzSdIZxug6izP87CdWpnOr7HIuoMK8vpjpgoS6y2jgXCUHErDw5rwT58zi zirA== X-Gm-Message-State: ACrzQf1H8BZzRdq1iROOURGfmt7O0WmlESYKdv1J+6Sj/h3aX6NFllDl Wr0nk6JYyR1yzCNkDJGW+aCBtAxJoq9sPzlLGNTREg== X-Google-Smtp-Source: AMsMyM5wteEY4XoOZoELG1KxfdM+2BAwAcyoIHJRRBncPIq8wjuU5xUzLJuw8RN3OmCTArCGHNcqbhKWKe4HMuRHtD8= X-Received: by 2002:a05:6902:102b:b0:6bf:f3c2:dc4c with SMTP id x11-20020a056902102b00b006bff3c2dc4cmr13097919ybt.376.1666289702621; Thu, 20 Oct 2022 11:15:02 -0700 (PDT) MIME-Version: 1.0 References: <20220915150417.722975-19-glider@google.com> <20221019173620.10167-1-youling257@gmail.com> In-Reply-To: From: Alexander Potapenko Date: Thu, 20 Oct 2022 11:14:26 -0700 Message-ID: Subject: Re: [PATCH v7 18/43] instrumented.h: add KMSAN support To: Marco Elver Cc: youling 257 , Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Biggers , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Stephen Rothwell , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: multipart/alternative; boundary="000000000000d1ca6505eb7b4d0d" ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=a2MCT5vl; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of glider@google.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=glider@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666289703; a=rsa-sha256; cv=none; b=g6osnpIm636rJyaSrB6esVJBPNiTBCgN8a2Qp+qP8l6YJYdvAZkFRXOpQVUDftMgSRxpWI Cz6fIVEb974ak8bkJjsyme/4Ta1xOD+qXr8AMW1q9FO3sV2hBCXxYkdlrWlXY5syWVCsYh ciJVmZHYQZT4IaIaVUCZuUvPEtSNn9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666289703; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DeaJx4U9U/HouZlNtQYOnX4gYJD8uJB8N7NUzo4qBYg=; b=H6CNKV/NN8FyiyDyHdBAAaUNFh9WqGwoi2xYRytZyvSOJjcQflrChIaVvoZ2Zvce34wNU6 PaGKYtfEArKb97UU6xJEEDsSlHYPmYrMpRvMlqtJEpZiwCtMXJqF1pwTqmnwXzp8xzSl75 sR9IAW+/S4QlIxFAbRHXcInaYqxAOpo= Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=a2MCT5vl; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of glider@google.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=glider@google.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: xhjxod4n6nd5xfcn1x38dn6mg3ena131 X-Rspamd-Queue-Id: B079540007 X-HE-Tag: 1666289703-611965 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --000000000000d1ca6505eb7b4d0d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Oct 19, 2022 at 2:37 PM 'Marco Elver' via kasan-dev < kasan-dev@googlegroups.com> wrote: > On Thu, Oct 20, 2022 at 04:07AM +0800, youling 257 wrote: > > That is i did,i already test, remove "u64 __tmp=E2=80=A6kmsan_unpoison_= memory", > no help. > > i only remove kmsan_copy_to_user, fix my issue. > > Ok - does only the below work (without the reverts)? > > diff --git a/include/linux/kmsan-checks.h b/include/linux/kmsan-checks.h > index c4cae333deec..eb05caa8f523 100644 > --- a/include/linux/kmsan-checks.h > +++ b/include/linux/kmsan-checks.h > @@ -73,8 +73,8 @@ static inline void kmsan_unpoison_memory(const void > *address, size_t size) > static inline void kmsan_check_memory(const void *address, size_t size) > { > } > -static inline void kmsan_copy_to_user(void __user *to, const void *from, > - size_t to_copy, size_t left) > +static __always_inline void kmsan_copy_to_user(void __user *to, const > void *from, > + size_t to_copy, size_t lef= t) > { > } > > > ... because when you say only removing kmsan_copy_to_user() (from > instrument_put_user()) works, it really doesn't make any sense. The only > explanation would be if the compiler inlining is broken. > > If what Marco suggests does not help, could you post the output of `nm -S vmlinux` with and without your revert so that we can see which functions were affected by the change? Unfortunately the top results are of no help, do you have the `perf` tool available in your system? > -- > You received this message because you are subscribed to the Google Groups > "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/kasan-dev/Y1Bt%2BIa93mVV/lT3%40elver.go= ogle.com > . > --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Liana Sebastian Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg --000000000000d1ca6505eb7b4d0d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Oct 19, 2022 at 2:37 PM '= Marco Elver' via kasan-dev <kasan-dev@googlegroups.com> wrote:
On Thu, Oct 20, 2022 at 04:07AM +0800, you= ling 257 wrote:
> That is i did,i already test, remove "u64 __tmp=E2=80=A6kmsan_unp= oison_memory", no help.
> i only remove kmsan_copy_to_user, fix my issue.

Ok - does only the below work (without the reverts)?

diff --git a/include/linux/kmsan-checks.h b/include/linux/kmsan-checks.h index c4cae333deec..eb05caa8f523 100644
--- a/include/linux/kmsan-checks.h
+++ b/include/linux/kmsan-checks.h
@@ -73,8 +73,8 @@ static inline void kmsan_unpoison_memory(const void *addr= ess, size_t size)
=C2=A0static inline void kmsan_check_memory(const void *address, size_t siz= e)
=C2=A0{
=C2=A0}
-static inline void kmsan_copy_to_user(void __user *to, const void *from, -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0size_t to_copy, = size_t left)
+static __always_inline void kmsan_copy_to_user(void __user *to, const void= *from,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 size_t to_copy, size_t left)
=C2=A0{
=C2=A0}


... because when you say only removing kmsan_copy_to_user() (from
instrument_put_user()) works, it really doesn't make any sense. The onl= y
explanation would be if the compiler inlining is broken.


If what Marco suggests does not help, = could you post the output of `nm -S vmlinux` with and without your revert s= o that we can see which functions were affected by the change?
Unfortunately the top results are of no help, do you have the = `perf` tool available in your system?=C2=A0
=C2=A0
--
You received this message because you are subscribed to the Google Groups &= quot;kasan-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to kasan-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/Y1Bt%2BIa= 93mVV/lT3%40elver.google.com.


--
Alexander Potapenko
Software= Engineer

Google Germany GmbH
Erika-Mann-Stra=C3=9Fe, 33
80636= M=C3=BCnchen

Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Liana Sebasti= an
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellsch= aft: Hamburg
--000000000000d1ca6505eb7b4d0d--