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 X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3D01C1747C for ; Tue, 5 Nov 2019 14:12:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 952B221D7C for ; Tue, 5 Nov 2019 14:12:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pI0I0py/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 952B221D7C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6120C6B0003; Tue, 5 Nov 2019 09:12:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 574606B0006; Tue, 5 Nov 2019 09:12:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 463AB6B0007; Tue, 5 Nov 2019 09:12:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id 31AC06B0003 for ; Tue, 5 Nov 2019 09:12:45 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id F11EB4821 for ; Tue, 5 Nov 2019 14:12:44 +0000 (UTC) X-FDA: 76122414648.14.bell41_17edba416bf48 X-HE-Tag: bell41_17edba416bf48 X-Filterd-Recvd-Size: 5458 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Nov 2019 14:12:44 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id i10so851539wrs.7 for ; Tue, 05 Nov 2019 06:12:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=afylrLa4Olzu72O2JtEooam33D4gdDHlOjME+tnoB+U=; b=pI0I0py//DXoonPCwNgRXlM0q94rfGYr8pgCwcTcy6MWwmSTS9W0vwEoyb6/gaAAP5 nhC+TLqd5JLoSya0PBA1HAr6/htmg3Frg3pDVhprdyR8Dgh6+05GDYmRo2qDj1aV9bxF S/iqf4nXzA7q2sCnQtGuIKyCee/3SXepgQx/2SrmoL+u1n0ig0OENnkOwqeF+h0jFFl4 PocOdoTDpiQdpUr3D3P+/r4xVeaPmqIE2exwPZHqbKoYvE1BXSOGHPzqipVfSwTR5DAf 3FMSNaTgBQlSugw5uRt3+cNCKNYNWK/xoLRRsztpF/ZtgPCjAsBX1a21BtnJPW3r98yQ q7Qg== 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:content-transfer-encoding; bh=afylrLa4Olzu72O2JtEooam33D4gdDHlOjME+tnoB+U=; b=T+eTq7+KJN9UYSMz5pFDCnILbC9D5xOLyFFStYUSNqBIeKGmTMCsJ3rQoNa5V4OTTf iKtO41FtlUF5sTRGo6y0ZhMpDU2CFxi8LZRBG5Dd9YjMk2WtgkB0ZfsHjqk0e472XU4+ vDZrIrajkUBewSsXHB2dGyq8CVc4o8CtTShyMqWuqwsgg8tmsQX7KPpnnhWl+t0HhK8Y iv7XJ7F2uvNno7XlQZk9H6CfIoaQN+gCSGllnzInggV/7YGZ3TiXx3lxx3YK86X8vnvr 9605F2jQViNyr7mUDM0HuqFLxx6R7nZluEqxFYyxIYKaRsIbgBOD88ZQMwnjTkTTHQod J/tQ== X-Gm-Message-State: APjAAAVWrtcVgQOy1mTw92DKqx5Nv1sMuwdW6A9qPD1zmjp+pW6EwKYa PyZp482dShCaJg3yj1zg2wE2A67Xajpx1eMAU4ICtw== X-Google-Smtp-Source: APXvYqzc3jd+wUJKFh2TruEFh3gn97yHfa4Ucld/FyCBwXdd6pV/Rku8Fen/arC04En75LrfgDC9v+iLoSv6X7TbUHg= X-Received: by 2002:a5d:4ecd:: with SMTP id s13mr29648272wrv.216.1572963162662; Tue, 05 Nov 2019 06:12:42 -0800 (PST) MIME-Version: 1.0 References: <20191030142237.249532-1-glider@google.com> <20191030142237.249532-19-glider@google.com> <20191031114916.ikz3phubs4jqdmnf@pathway.suse.cz> <20191101082639.GA19790@google.com> In-Reply-To: <20191101082639.GA19790@google.com> From: Alexander Potapenko Date: Tue, 5 Nov 2019 15:12:31 +0100 Message-ID: Subject: Re: [PATCH RFC v2 18/25] kmsan: call KMSAN hooks where needed To: Sergey Senozhatsky Cc: Petr Mladek , Andrew Morton , Greg Kroah-Hartman , Eric Dumazet , Wolfram Sang , Vegard Nossum , Dmitry Vyukov , Linux Memory Management List , Al Viro , Andrey Ryabinin , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Christoph Hellwig , Dmitry Torokhov , Eric Van Hensbergen , Harry Wentland , Herbert Xu , Ingo Molnar , Jens Axboe , "Martin K . Petersen" , Martin Schwidefsky , "Michael S. Tsirkin" , Michal Simek , Sergey Senozhatsky , Steven Rostedt , Takashi Iwai , "Theodore Ts'o" , Thomas Gleixner , Vasily Gorbik , Ilya Leoshkevich , Mark Rutland , Matthew Wilcox , Randy Dunlap , Andrey Konovalov , Marco Elver Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Fri, Nov 1, 2019 at 9:26 AM Sergey Senozhatsky wrote: > > On (19/10/31 12:49), Petr Mladek wrote: > > > > Please, separate the two comments with an empty line instead of using > > */ and /*. > > > > > + * If any of vscnprintf() arguments is uninitialized, KMSAN will = report > > > + * one or more errors and also probably mark text_len as uninitia= lized. > > > + * Initialize |text_len| to prevent the errors from spreading fur= ther. > > > + */ > > > + text_len =3D KMSAN_INIT_VALUE(vscnprintf(text, sizeof(textbuf), f= mt, > > > + args)); > > Or maybe this can be > > text_len =3D vscnprintf(text, sizeof(textbuf), fmt, args); > + KMSAN_INIT_VALUE(text_len); This isn't how KMSAN_INIT_VALUE works. It takes a value that may be uninitialized and returns the same value marked as initialized. Shall I do: text_len =3D KMSAN_INIT_VALUE(text_len); instead? > > -ss --=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, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg