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 DA0C4C4332F for ; Wed, 19 Oct 2022 21:45:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 315936B0072; Wed, 19 Oct 2022 17:45:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C4576B0073; Wed, 19 Oct 2022 17:45:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B3EC6B0074; Wed, 19 Oct 2022 17:45:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 081C06B0072 for ; Wed, 19 Oct 2022 17:45:08 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C02A080D33 for ; Wed, 19 Oct 2022 21:45:07 +0000 (UTC) X-FDA: 80039029854.21.1B5677B Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by imf27.hostedemail.com (Postfix) with ESMTP id 64DB440027 for ; Wed, 19 Oct 2022 21:45:07 +0000 (UTC) Received: by mail-yb1-f173.google.com with SMTP id j7so22440525ybb.8 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=PCkKGABgCspql59DEK9uqHf6fC8RBNNmn5Kzdw8OZnGokYZeOpQoBxKnrIUT7AZ2B4 Wex630gpAjgawbTWIDYjAajFN+pxzXYChlwAxkaEHVDDXC443wCB6nBzNlA2x07emJqY 7QpAt6at33Ao/svaL+Jx8LOwEtuhMx2SgJULVjP8OA+LHvBZJt/qFWG9YJG4tuK+rDR3 0MMxKgsyIB2f/JEgMgzTUv0/fVvScfdWk043u+3vSE3Mp2dabuLZhnVuKJRwfA27nNnW r9RfPeoMwUsyohL8fJkDBsObAvRmJ39HlB1kMIsxs73at+vuNms9VeWYuDvdhELyZqqj gIrw== X-Gm-Message-State: ACrzQf08cOMn4hXW9jH88oyhvCS7wM1kVhLsyUjDN3rgAzKMvcvgF92z fQilSwXvCQwGOZaBZdaUGaNPcEVEe1d/Qw/BECVlAQ== X-Google-Smtp-Source: AMsMyM5JbXSwUg/uvL89WwlxwF0CJMWmPiwanb96onTIl9HJDW5/mJv4AJRmoOLhbb0bZ3Mqt+lNh4peUtXJOcqCSdc= 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666215907; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7ghDToPdvK1mpXEhLmg0q2dWGU3wc/xDHdpsX0rO9Q0=; b=jw7WG37Hj/lj0xkZHfyyxEKKACZo0baQnCUPXyw8gQ3Ff+U6BehGUg+cE/Au4xvxbtyZwA iq22fst6YHkQ/GxNB4WzF1A/SCGm8o4yj0ArsKzeh3u9b7mgg2ImN3/BtbmnjyrnyS2j09 JUPsfeXDzwUxfoVPRejKrf0QT7rAa9Y= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=liH6o19V; spf=pass (imf27.hostedemail.com: domain of glider@google.com designates 209.85.219.173 as permitted sender) smtp.mailfrom=glider@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666215907; a=rsa-sha256; cv=none; b=HtQF7VGaAhv/qZZhha/cN1BAm4Kf/Mpig6SRLkqFWxOVmtjfjMELgUqv6dk8PtwnuaYNJ4 1La04SqiJPQ/s18NCGqpYsrBPy9PwY+u1dm5VPaBSYCF4PSR9E0sqr4LzhVhFKOmuQEjce e9IlrON9d9vdjyhKSjvQdT2dkegRQf0= Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=liH6o19V; spf=pass (imf27.hostedemail.com: domain of glider@google.com designates 209.85.219.173 as permitted sender) smtp.mailfrom=glider@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 64DB440027 X-Stat-Signature: 1mhyicmdspob4ai8kdf7gcgppjq35x45 X-Rspam-User: X-HE-Tag: 1666215907-37244 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: 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