Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp106483pxk; Tue, 15 Sep 2020 22:28:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUPPAbVXoqWMS5qYXTYL8VYYSupx7xax3+pqvpNvWz88nIYzloeVSG2+NGOnda4jZDr1K1 X-Received: by 2002:aa7:cb92:: with SMTP id r18mr25938991edt.158.1600234106411; Tue, 15 Sep 2020 22:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600234106; cv=none; d=google.com; s=arc-20160816; b=aB3rvOsgwGHXm6WDy4pwNWKo2Lo3D6S3NKREkjbM2kgpBEqUu8aIUgAIwPlcett0SY jBcnxv/ByF0NZ1ErT2k6W/Ktc+VNrJXLsAW1JvTQB/f2kWa6u+ijbS2bNaFRrDKIBWK0 gEzWq9sC2VtU7w1e9RSR26aFaERHjDdLIJ1pkfwcMUwiBcu+7DeY3N1futPDsJejUUgB 4mN6IPlWXoLapEWhzS0CDrDvHH9fTS+BBV/tsnlwvq1C7Zbsu/19NQ6T+UqDdyfCd6Wt zw009U9Ps9wugnylZ/c0pWRkr72w9KWGJ7NRe+qeyeQXhOmM7CyDTK+4qDsDC0+d5M4o Qz/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=VJVDbbAlJ3EVegFgwxB/3/h59utgDfMyQ6scbBMOYNk=; b=Vrhw+yq4ZoZbY0/3aKyAJqVrgXyqNSUYw76d4RIiJpjh1FdTigSldkOaFP3yqazuqW ot+gK3kOXpwQN+JiF2xU6tF6H2y7LIoeUcFyI45Zh/wXdS0mjpsx1b2Ji0Xfl9pQVELt HedKkW0t3Y+D9h1MNzUqKTYlnMOJsdl+dyxFL1aC8Dg94wLG9ctHOcbPT2Eb5qXExd6v /gZNPor/aw81Lq8kIvEkZ6HaZYhR4C9fMtxReLdevYNlMjOo8KgnAe4vU+tLsArh97B3 vJPD/bozMSr8frZhS+oQ72Cp1CIK7MuXfZnkTpp5V0jO9f0AxOyhjIyvRjMQHpUi/igo ntUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=A0ZiSvqZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw15si11096512edb.299.2020.09.15.22.28.02; Tue, 15 Sep 2020 22:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=A0ZiSvqZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726149AbgIPF1S (ORCPT + 99 others); Wed, 16 Sep 2020 01:27:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbgIPF1Q (ORCPT ); Wed, 16 Sep 2020 01:27:16 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51273C06174A; Tue, 15 Sep 2020 22:27:16 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id u9so2561238plk.4; Tue, 15 Sep 2020 22:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VJVDbbAlJ3EVegFgwxB/3/h59utgDfMyQ6scbBMOYNk=; b=A0ZiSvqZool5kn3WbGpLkkhh1vZthuLxPC3zqqCNTVibSFcUjMOQ+IUGBS76hngwPv HkhVhMiEAN1f4INTdiJhlJVzg883lrpc+AIXKZNa+mFvXd5zEosYgM+SJqH9NRkHVBlk ArrNt4lfQtr894OODK5r+0MnLMvB0bYcbUnzaQhmpwjc2fXXu4C8mCZ191kIWCQJ4t6F kDYQSIRirP6Tp8CkHTRvLB7vW4upDxNNvNPDLLocCqdRtZ9cyNjvo7LNjeZhyedD/+s3 kkNAmVK5nV4Maqc26fX6hZ7qhAp7NuT6skNoWfE78Ptl2PspbfuAjO2gTZ9DhKuyyVZq zspw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VJVDbbAlJ3EVegFgwxB/3/h59utgDfMyQ6scbBMOYNk=; b=AwNEnmAd/z/zqNtlhhxJAy1bpRF4XUlPT7HVW0KhM569C8frHeVJQ0lBFuJvD1P89S HcAOM9JMb2uH/3qnvW3ExHF/bc3PKDpHC1YzuPZnWA1YBnOtd7su4a2EceXlhUkZngCe eFlQYr/yJYR+sR2Gk4jlR/iTml1rnNfMgDY61BxP0wfrLLvWBEeZVLIBmph24j8VO+Re hY01I9ySrudcb9TMf+oTQ9pStOob5FSwjnfm97uSyaAFyOJMv0O+jA3dbtp+yALUi+zE 4K1ekqvuXSRoFbA4bjx4ErTWCqsrfYA2FTTIpArQrWorP/+qNMW0e5uA/vHfui5YFnJD am0g== X-Gm-Message-State: AOAM5309CnvYGAA3AtRUFGmYTkBPkRHNbTzxhVBidmMBB7wwdYi5nsp4 NcnT2V4QYaVZ0W+b5sHB3BU= X-Received: by 2002:a17:902:b086:b029:d1:e5e7:bddb with SMTP id p6-20020a170902b086b02900d1e5e7bddbmr4635762plr.59.1600234035653; Tue, 15 Sep 2020 22:27:15 -0700 (PDT) Received: from localhost.localdomain ([49.207.198.18]) by smtp.gmail.com with ESMTPSA id md10sm1172565pjb.45.2020.09.15.22.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 22:27:14 -0700 (PDT) From: Anant Thazhemadam Cc: linux-kernel-mentees@lists.linuxfoundation.org, Anant Thazhemadam , syzbot+4191a44ad556eacc1a7a@syzkaller.appspotmail.com, Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs: fix KMSAN uninit-value bug by initializing nd in do_file_open_root Date: Wed, 16 Sep 2020 10:56:56 +0530 Message-Id: <20200916052657.18683-1-anant.thazhemadam@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The KMSAN bug report for the bug indicates that there exists; Local variable ----nd@do_file_open_root created at: do_file_open_root+0xa4/0xb40 fs/namei.c:3385 do_file_open_root+0xa4/0xb40 fs/namei.c:3385 Initializing nd fixes this issue, and doesn't break anything else either Fixes: https://syzkaller.appspot.com/bug?extid=4191a44ad556eacc1a7a Reported-by: syzbot+4191a44ad556eacc1a7a@syzkaller.appspotmail.com Tested-by: syzbot+4191a44ad556eacc1a7a@syzkaller.appspotmail.com Signed-off-by: Anant Thazhemadam --- fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index e99e2a9da0f7..b27382586209 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3404,7 +3404,7 @@ struct file *do_filp_open(int dfd, struct filename *pathname, struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt, const char *name, const struct open_flags *op) { - struct nameidata nd; + struct nameidata nd = {}; struct file *file; struct filename *filename; int flags = op->lookup_flags | LOOKUP_ROOT; -- 2.25.1