Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2279946yba; Mon, 15 Apr 2019 08:29:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNw0dqM2Y/l+z2nttKysc0R40+kcmCaPe2K9p3Iy5wE8z6enjAvh/iDE2S+YC3K9OpoDCB X-Received: by 2002:a17:902:e393:: with SMTP id ch19mr73123502plb.117.1555342148139; Mon, 15 Apr 2019 08:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555342148; cv=none; d=google.com; s=arc-20160816; b=b2s7GsFAqFa24ijevBFvE4hro9HyOC6mz7Uzxy4DMPpNSfDaHrRoDLClzdYGm4Bdxb meKoNklUwmxiOB38QSs+xNz2/k7IujKwmDbNXPdSfQzg+BnvVQsaPNKnQkJoAQPC1bA6 C8gGYgDvLWcJ4Rr/G5EaRcLfKqk5uRV0gr04S6cypqmaxm6/g5sLK7XIldXWNxn6lGe9 t97VEl1ROIQhoZ/3k/XbzlDgUynkh2qQGPGd9QFyQxt4mqjGxWc7y/gvb2Dx5sIufG8H 1rLUZLJsV1r7n5BuL6fw1Fz8QNRIlgEj81HkXO+ji/f/lX5d7wuYoc6PLIX7DGgxd+vB MnTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=tSEywpfoCNlKFuZJuncBrF/Mbt6JnPGeLrWlA2hBd+E=; b=Tqte6LKfrlAAoTqrusYUe342TSuXzdvgUr1RCmRkdtmOM3HmkTC+N8zA2aticHW5Zh dBpBqhOsSq29Yplz83LckjA9tnQDLgdqFa0GMzup7hpMsMHFZGFcZ4bqCFXFfc5PMqtD pRSMknlPMgNEluD4q7IHKMvgTnL46jSndHXGKAFGfAdXG9r3w7qFz2XkjguE11S27jJ/ t0cY71ezzFtlK7VYelVw0EAgozOUG0p5QwHVKmE/qGigi+NSakmNOqcFqcccq94Kinnb DLvUKdcG3/bwSSBAw6N4JOu6o0LMgXApKO8d8rlDibgJhBNMbRWzU0pTfrcm3hiXaSHW FSdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b=ij1yIntI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si45492435pff.206.2019.04.15.08.28.51; Mon, 15 Apr 2019 08:29:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b=ij1yIntI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727613AbfDOP0m (ORCPT + 99 others); Mon, 15 Apr 2019 11:26:42 -0400 Received: from mta-p5.oit.umn.edu ([134.84.196.205]:42394 "EHLO mta-p5.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727372AbfDOP0l (ORCPT ); Mon, 15 Apr 2019 11:26:41 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-p5.oit.umn.edu (Postfix) with ESMTP id E4B61973 for ; Mon, 15 Apr 2019 15:26:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p5.oit.umn.edu ([127.0.0.1]) by localhost (mta-p5.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A_iXBKS-RKsJ for ; Mon, 15 Apr 2019 10:26:39 -0500 (CDT) Received: from mail-it1-f199.google.com (mail-it1-f199.google.com [209.85.166.199]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p5.oit.umn.edu (Postfix) with ESMTPS id AA3DDC64 for ; Mon, 15 Apr 2019 10:26:39 -0500 (CDT) Received: by mail-it1-f199.google.com with SMTP id t13so156094itk.0 for ; Mon, 15 Apr 2019 08:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id; bh=tSEywpfoCNlKFuZJuncBrF/Mbt6JnPGeLrWlA2hBd+E=; b=ij1yIntIVCSkDPqxekDCGgBoMJ+DLMF6R7KMyqpjZ75RHJoEfGwINHllNWoJFyzR4T +EG/a7mH1aAjk21pNVGM6t+d3LVm6PZWgFMQg/FxZpqNVU+H4pnT7aAf8VdDHrgg/h3G ki0lcqaqTy388HecyIQMPYAEEMKm9xoHwRYTCGimYW3kF0QIDvjCSUrYUOHZ4v6kIwf8 HBe9y5Kar/YnPxU1fNO++RDlaQB3K90NpqLyND9j5bqcq6ekrQKVLgEAtpYtEwncEk1p cU//cy0o/hs2MILGToOiVi2KC7ioe6fRhvH4rdB6SipU9PT+fBfL0TtNkQj8O8oYU5tQ yn0w== 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; bh=tSEywpfoCNlKFuZJuncBrF/Mbt6JnPGeLrWlA2hBd+E=; b=G7kvCBxTLkp2ShRjO/uSGAw0EG9tm6DgnixlPvwIvgLw/zdy5AJ/XVCjfT6VRjoEVp nTC2BwQHCLOi85ERUeGTpPfP/ylRDysE2TWFaPHKwCvxtcaVpbn4UKff0jeO4DpbZX5Y bt9pzDFWITjDbbqPxYeynLJhyPwz727903E2oHFvB2YCsPKPs4KWjypwYScL99WolCIh DRKE7+NJ4s0Pv6eS+cgJb9BISzBFPiYy8I7ctNxvren8vG8b4SnJkBRb82fmb8W+CFmG uGf5MYxhOay14Kerurm9omx/jF9jlfTZadLRe1Uz+cMAkDI0mFHfw9juZoDmZA3H8Fvw vwoA== X-Gm-Message-State: APjAAAVQMpwbYETQHCoEFE4my1qKZIAvSuyezbuR2HkeRE4lkxcbWcDP yYrC9etEXmPWxugTCoO1QKH5J2jRy95vbY7P8vJeRArDB0kgX/AC1aoNWjg9rDdKa9ZB/JuIfic l7fapzZvXffO3FAwhpn6lzQx4cb3F X-Received: by 2002:a24:4210:: with SMTP id i16mr26180795itb.37.1555341999405; Mon, 15 Apr 2019 08:26:39 -0700 (PDT) X-Received: by 2002:a24:4210:: with SMTP id i16mr26180778itb.37.1555341999241; Mon, 15 Apr 2019 08:26:39 -0700 (PDT) Received: from cs-u-cslp16.dtc.umn.edu (cs-u-cslp16.cs.umn.edu. [128.101.106.40]) by smtp.gmail.com with ESMTPSA id m137sm8234209itb.27.2019.04.15.08.26.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Apr 2019 08:26:38 -0700 (PDT) From: Wenwen Wang To: Wenwen Wang Cc: Jan Kara , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] udf: fix an uninitialized read bug Date: Mon, 15 Apr 2019 10:26:24 -0500 Message-Id: <1555341984-3282-1-git-send-email-wang6495@umn.edu> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In udf_lookup(), the pointer 'fi' is a local variable initialized by the return value of the function call udf_find_entry(). However, if the macro 'UDF_RECOVERY' is defined, this variable will become uninitialized if the else branch is not taken, which can potentially cause incorrect results in the following execution. This patch simply initializes this local pointer to NULL. Signed-off-by: Wenwen Wang --- fs/udf/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 58cc241..9d499e1 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -299,7 +299,7 @@ static struct dentry *udf_lookup(struct inode *dir, struct dentry *dentry, struct inode *inode = NULL; struct fileIdentDesc cfi; struct udf_fileident_bh fibh; - struct fileIdentDesc *fi; + struct fileIdentDesc *fi = NULL; if (dentry->d_name.len > UDF_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); -- 2.7.4