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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 38141C5DF62 for ; Wed, 6 Nov 2019 09:04:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F12402178F for ; Wed, 6 Nov 2019 09:04:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F12402178F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8B57E6B0003; Wed, 6 Nov 2019 04:04:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 867906B0006; Wed, 6 Nov 2019 04:04:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 77C936B0007; Wed, 6 Nov 2019 04:04:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0213.hostedemail.com [216.40.44.213]) by kanga.kvack.org (Postfix) with ESMTP id 64FC06B0003 for ; Wed, 6 Nov 2019 04:04:20 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 10857180AD802 for ; Wed, 6 Nov 2019 09:04:20 +0000 (UTC) X-FDA: 76125266280.19.lip07_8a96b287c81d X-HE-Tag: lip07_8a96b287c81d X-Filterd-Recvd-Size: 3792 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Wed, 6 Nov 2019 09:04:19 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E3B4BAC81; Wed, 6 Nov 2019 09:04:15 +0000 (UTC) Date: Wed, 6 Nov 2019 10:04:09 +0100 From: Petr Mladek To: Alexander Potapenko Cc: Sergey Senozhatsky , 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 Subject: Re: [PATCH RFC v2 18/25] kmsan: call KMSAN hooks where needed Message-ID: <20191106090409.7mhmi3tecg42bcxm@pathway.suse.cz> References:<20191030142237.249532-1-glider@google.com> <20191030142237.249532-19-glider@google.com> <20191031114916.ikz3phubs4jqdmnf@pathway.suse.cz> <20191101082639.GA19790@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170912 (1.9.0) 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 Tue 2019-11-05 15:12:31, Alexander Potapenko wrote: > 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 uninitialized. > > > > + * Initialize |text_len| to prevent the errors from spreading further. > > > > + */ > > > > + text_len = KMSAN_INIT_VALUE(vscnprintf(text, sizeof(textbuf), fmt, > > > > + args)); > > > > Or maybe this can be > > > > text_len = 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 = KMSAN_INIT_VALUE(text_len); > instead? I like this. It nicely separates the KMSAN specific things. Also the comment might be separate. Best Regards, Petr