Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1785591rwi; Wed, 19 Oct 2022 15:35:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6HiPHvEGkIdI8ClUdbNwtWPh4BQ128v3EiZtO4P6nah5XaqEEslpcBFXMVRODX0vte2Sv6 X-Received: by 2002:a17:90a:4607:b0:202:e22d:489c with SMTP id w7-20020a17090a460700b00202e22d489cmr48770198pjg.80.1666218947708; Wed, 19 Oct 2022 15:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666218947; cv=none; d=google.com; s=arc-20160816; b=GdYajHG73XB1gRAWq+RjDFlnodNXV/OY7f/31qNCOV02/8YUlRPan3aAsQeedwpcsu fh6EAf9zZJRWBCb6AtevJDLZ7cOztgQwX4IadShJR/uWGHNb7H6TvMflVRVaiGNYKMzD YZYTQ+tvk5W7afiCornAuq/wVeISe0Z7YHCv8oVQQ5v09+5hf1zVrhyW/efJbD+8bn6N STe9t1uZeHYc82PX1QmMJJqWMmmJarAvRhOfppqE9x+QpbKQ7NEpeR4rqtx1BgKw/4pe UBi5jwgLldVsV6r1ybKHXsWHiOFR2NuLrrtfbrk9iAcq0jrcqkGZWCId+713lxOZkp1l 1rIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7ghDToPdvK1mpXEhLmg0q2dWGU3wc/xDHdpsX0rO9Q0=; b=ghD+XEphpVinivgSIDePI+3d95BnrJtPCbAcV7E9Bz5fxAH/DgZxLIwHSZo3eS3Dde wQR0ktSij3ZZ1vY1Atc1Jw6ONc4QV+Gac01I0jLAyNepY16XqoCdtQOyLiR1tR+26vNi BdXBYfBNvhHSfahRLp865/R1sJekUPYCuqdC8Ow4LBA61t+TeO4QLWUnEQgXl1wd7k7Y yP/61kYVuUd1H/xJnHRigImQMOZ/dYtsUBTq9Zq7kzBWTcqTCbFHAs7YfccV5SIZ2pTq 9u++hmdy5M1Tk4fZrv1xJGrn8H1rUZQJG8Jv0NbRPQQyFRzD//t0xWkZwj2s72nCJo7i tM1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=liH6o19V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 2-20020a630d42000000b0045a8a6b75fesi19274188pgn.499.2022.10.19.15.35.22; Wed, 19 Oct 2022 15:35:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=liH6o19V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229795AbiJSVpM (ORCPT + 99 others); Wed, 19 Oct 2022 17:45:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbiJSVpJ (ORCPT ); Wed, 19 Oct 2022 17:45:09 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 752228BB8B for ; Wed, 19 Oct 2022 14:45:07 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id i127so11693958ybc.11 for ; Wed, 19 Oct 2022 14:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7ghDToPdvK1mpXEhLmg0q2dWGU3wc/xDHdpsX0rO9Q0=; b=liH6o19VQfWD4VzG180UgTjOTNjj3pN+Q69t9YU2F4a0B6Ovi2tSdXbkE4icogNBhx IGRxnqVwcfKeYpCKMW3ewQyejWlo3qILdFroj3k1PU9bZo4QidKPe2p1njsPDwzPQF+M 6HloV4kS1HXPLKqyaFpJwhpHQyoxdmj/XS7h6KsxCfKu+Ez6bWF1dNEhhWkcrphy0TpU +JQ1xvbKLnLoDP+1g6Dp43xT7qgEf3P1hPkYU0B8lAus8SZZXmbNNXxn2XacIDzJSkiI 11bRHozSI3pxA9asADO1vRs9sAKiBozx6QYOi4Xxf/HRMv4bW1O+3J4W3QokbxisBroB zspA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=7ghDToPdvK1mpXEhLmg0q2dWGU3wc/xDHdpsX0rO9Q0=; b=XGtkHMUD7CmGl0znQ8DgIKp3Ru4X/7dZROjxooc5gKMAL9spHYIcEkPv5dXvqOsWpL a4Gn4mR/Y/q8/g4RhDmHtEKJE42zf3AWspnS7/vte4Qz1x/HUwjlEdlnozSfjj0ITaKi cJxHRwLxRHF94nFftZkEHl1Ly1R6L5KgSwxwKoTAQGJN/mjEX+AgkZjFU+GpZjC2i2o5 +Sm27SPY4DCQsOwryzJlnQnvBHyP5RXosB6IkA9G9uSUk8z07gi3E5OXE2osWKWoCF83 dgyv92lVGW4PtDH3m7T5UffxFDLFjAD+4v0wgVIg0Q3hp7MZ8fDfn1kQwoF+16tIdytU Sadg== X-Gm-Message-State: ACrzQf3CsLkA97q7SRS7NpqJ72aYeZdBrZLvImELelPofactre1YBUES hu6dCztidHRhYYEctfIwi4/uZdn+M286LHtqs4E79A== X-Received: by 2002:a05:6902:1369:b0:6c4:8ae:7b14 with SMTP id bt9-20020a056902136900b006c408ae7b14mr8299284ybb.549.1666215906319; Wed, 19 Oct 2022 14:45:06 -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: Wed, 19 Oct 2022 14:44:28 -0700 Message-ID: Subject: Re: [PATCH v7 18/43] instrumented.h: add KMSAN support To: youling 257 Cc: Marco Elver , 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: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 19, 2022 at 1:07 PM youling 257 wrote: > > That is i did,i already test, remove "u64 __tmp=E2=80=A6kmsan_unpoison_me= mory", no help. > i only remove kmsan_copy_to_user, fix my issue. Do you have any profiling results that can help pinpoint functions that are affected by this change? Also, am I getting it right you are building x86 Android? > 2022-10-20 4:00 GMT+08:00, Marco Elver : > > On Thu, Oct 20, 2022 at 03:29AM +0800, youling 257 wrote: > > [...] > >> > What arch? > >> > If x86, can you try to revert only the change to > >> > instrument_get_user()? (I wonder if the u64 conversion is causing > >> > issues.) > >> > > >> arch x86, this's my revert, > >> https://github.com/youling257/android-mainline/commit/401cbfa61cbfc20c= 87a5be8e2dda68ac5702389f > >> i tried different revert, have to remove kmsan_copy_to_user. > > > > There you reverted only instrument_put_user() - does it fix the issue? > > > > If not, can you try only something like this (only revert > > instrument_get_user()): > > > > diff --git a/include/linux/instrumented.h b/include/linux/instrumented.= h > > index 501fa8486749..dbe3ec38d0e6 100644 > > --- a/include/linux/instrumented.h > > +++ b/include/linux/instrumented.h > > @@ -167,9 +167,6 @@ instrument_copy_from_user_after(const void *to, con= st > > void __user *from, > > */ > > #define instrument_get_user(to) \ > > ({ \ > > - u64 __tmp =3D (u64)(to); \ > > - kmsan_unpoison_memory(&__tmp, sizeof(__tmp)); \ > > - to =3D __tmp; \ > > }) > > > > > > Once we know which one of these is the issue, we can figure out a prope= r > > fix. > > > > Thanks, > > > > -- Marco > > > > -- > 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/msgi= d/kasan-dev/CAOzgRdY6KSxDMRJ%2Bq2BWHs4hRQc5y-PZ2NYG%2B%2B-AMcUrO8YOgA%40mai= l.gmail.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 Sebastian Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg