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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AED2C00140 for ; Mon, 8 Aug 2022 16:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244068AbiHHQir (ORCPT ); Mon, 8 Aug 2022 12:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244079AbiHHQie (ORCPT ); Mon, 8 Aug 2022 12:38:34 -0400 Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D217E167C3 for ; Mon, 8 Aug 2022 09:38:30 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-324293f1414so87450257b3.0 for ; Mon, 08 Aug 2022 09:38:30 -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; bh=XquYmP+vX0zNQXcxrD0gfmPbv/22szoR0PAdjI6c6FQ=; b=RBd6EjHhe971WD13rB9QwkHAT4JUbLr8pEwdWhmPMPYpucCEhUe0Fdxu7UVnbr9qpP hZWuzatpB+IqP6uU510l0sQTdjybSMTSw0lHTUAtbi7VRxP2+VL05RnJSC9tm4F4F9bv 03IZzjd3BMx5tcDns/TvMijdidvLv9/X2frigVbrc5lBTVZIT8xVWMui/Av+CCl2HQ+g QeAwQ4P2RQXrRRxSJ9VYRfWwU8zBUJvN0TSOG9Egg5vBxghw1SEtI2yzQD4i2Egfj5MJ HUwil0l04LL4/UtY+kLAu1nwLKCUhG43pHEAAs+sHgqewUIscMdcTdTZ4xxjKOjwkI6L 2CXQ== 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; bh=XquYmP+vX0zNQXcxrD0gfmPbv/22szoR0PAdjI6c6FQ=; b=7OE/dIpkRwUjdeLvJtOihyTAlKY8uh7Zu5cuNcswpZ9fZ1Oamrnz4poX1DbotAb1oc Dmb6XRxz6JFe/suvgHHcaLn2xgaiVXXms2se1aXRmV2ZSZ6klKVHIjSAQWq0OV9RljeM Pbbi9+NFCiWZ1bIa3IO5zajZ1BdrGzqbOhs64BBqK9SBrmFhgdzgDYJ67gzD6Lqm/2Xa q7Bn4b3MN+pjHyqRQSTbiS1Vr3OiFo+DUyHm++Wit7l58Lw+7eBV+hfm9wM0j/NjYb+z n+4PCqgAN5n98btZMrPeZyVeLyzj8ShCwhrFSx0/whzt5WSgS5O6UY9MvCuDOKjE0Ndq KS5w== X-Gm-Message-State: ACgBeo3Sd5aNPEsQ4VQHn9C+JtPQbqvGWbYPyqaWxSz0utCpaS8ldcwB KAz3W0ffBex7gsoFRIXWTc75PpaiUbENKlih0fhoMg== X-Google-Smtp-Source: AA6agR7qwVhhNLdxkz/r+4OMSs/UhsdFghsuBlEsQGkMrD95nZ9mCd4coeYCE332Xk5fz/fL87h9vbS2cVX9CTEt9Jg= X-Received: by 2002:a81:7586:0:b0:31f:658e:1ac7 with SMTP id q128-20020a817586000000b0031f658e1ac7mr19730600ywc.295.1659976709754; Mon, 08 Aug 2022 09:38:29 -0700 (PDT) MIME-Version: 1.0 References: <20220701142310.2188015-1-glider@google.com> <20220701142310.2188015-44-glider@google.com> In-Reply-To: <20220701142310.2188015-44-glider@google.com> From: Alexander Potapenko Date: Mon, 8 Aug 2022 18:37:52 +0200 Message-ID: Subject: Re: [PATCH v4 43/45] namei: initialize parameters passed to step_into() To: Alexander Potapenko Cc: Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev , Linux Memory Management List , Linux-Arch , LKML , Evgenii Stepanov , Linus Torvalds , Nathan Chancellor , Nick Desaulniers , Segher Boessenkool , Vitaly Buka , linux-toolchains Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 1, 2022 at 4:25 PM Alexander Potapenko wrote: > > Under certain circumstances initialization of `unsigned seq` and > `struct inode *inode` passed into step_into() may be skipped. > In particular, if the call to lookup_fast() in walk_component() > returns NULL, and lookup_slow() returns a valid dentry, then the > `seq` and `inode` will remain uninitialized until the call to > step_into() (see [1] for more info). > > Right now step_into() does not use these uninitialized values, > yet passing uninitialized values to functions is considered undefined > behavior (see [2]). To fix that, we initialize `seq` and `inode` at > definition. Given that Al Viro has a patch series in flight to address the problem, I am going to drop this patch from KMSAN v5 series.