Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1621287ybv; Fri, 21 Feb 2020 00:26:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzygNB7yG40pKmJLSaNsm1Am0fhposhJxZ3VRQMYOqENVzeQQ9PqAJshf5eT1umT/puj3Ct X-Received: by 2002:aca:f0b:: with SMTP id 11mr1080836oip.34.1582273618990; Fri, 21 Feb 2020 00:26:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273618; cv=none; d=google.com; s=arc-20160816; b=GiL4+Nx4bFsUmeu1rP99e4lYBMFaYaxWJua68QKL8wpmnx6BRDSQrEIXCbaRx8MZz0 smnYSC/I4yjxeSUvqaTBGU7Yiqx4uVKAFTqF867QgqQN3vKvnoaBsRQAhbPZceKghnpj EqFdWXDH1oPY7tBCjM6h2nJl7KjgYUCSCaXNs6jq8NfIrsxfGDXvupYI+BAd8E2oGNsC jqk4R90f3q8u4o6d/oZGvqXpHEGLHkSLWrASdGR6jL0t8S6g3GuUxyQN2s/QGOv34N/w t821tIaH0AgZHMRnBfDsmaYWW0i591cPme8OVKMF5XLCXag00ZRLB6alVbGUiGHaGoEH G96Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yf4kD9iimdRnnqokAUZpAZBLt5U3p/7udRKSyvM8P7E=; b=YKqAmdFlm59fkLylqfbIcCzv3+KuvEeoEPVTGr5ZMWG09MnCgTFp+xkPii1IkCOVOX AQfiv4yD5e6XoNQAxXsxC/Fjl4rlsqsJehNIZf4YJw+aPnIogxErGwPztZ5SFv3EwPZU T3LTfIOb7ewx2LeRDgx5FJ4efeatU5NHSznmx12ekxVGE8hzIGqNRe7GWoQq0XCizZIB 6zsUrQbKaX0obNXBIpL3vbi2xG6ZR+843wgqF9wRdXlzBRdKNSURRB++gAfnLG64OS7X QN8DgFxtnX373vp1AE0zeCEHNvh5b5V4tqNSQXgikEZDixNKV4Ih2eAjOKg2AqCDM16U dO+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1tSOerqo; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si1037528oth.15.2020.02.21.00.26.47; Fri, 21 Feb 2020 00:26:58 -0800 (PST) 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=@kernel.org header.s=default header.b=1tSOerqo; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731273AbgBUIYS (ORCPT + 99 others); Fri, 21 Feb 2020 03:24:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:36644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388619AbgBUIYQ (ORCPT ); Fri, 21 Feb 2020 03:24:16 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 206CE24697; Fri, 21 Feb 2020 08:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273455; bh=LbvWt1qaaoHgw126FlvXqbzf1tcad1g/Bm2OGES6oUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1tSOerqogqXtbQADK3FPGOMrPnhHLcZkmvNZrmfz1tztX1TcuhcFiU44777cKekrz 2EcUvqU6zHRpWpYBCoVJZnejYTkkAXAlP3We8RI+W8dlyYINtAPJtZVtT0GkstXgg3 rEQnn6+G97MjenflpgXMeWyEhkRF2GuFvpnfxiIs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunfeng Ye , zhengbin , Hu Shiyuan , Feilong Lin , Jan Kara , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 178/191] reiserfs: prevent NULL pointer dereference in reiserfs_insert_item() Date: Fri, 21 Feb 2020 08:42:31 +0100 Message-Id: <20200221072312.206296832@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunfeng Ye [ Upstream commit aacee5446a2a1aa35d0a49dab289552578657fb4 ] The variable inode may be NULL in reiserfs_insert_item(), but there is no check before accessing the member of inode. Fix this by adding NULL pointer check before calling reiserfs_debug(). Link: http://lkml.kernel.org/r/79c5135d-ff25-1cc9-4e99-9f572b88cc00@huawei.com Signed-off-by: Yunfeng Ye Cc: zhengbin Cc: Hu Shiyuan Cc: Feilong Lin Cc: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/reiserfs/stree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 0037aea97d39a..2946713cb00d6 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -2250,7 +2250,8 @@ error_out: /* also releases the path */ unfix_nodes(&s_ins_balance); #ifdef REISERQUOTA_DEBUG - reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE, + if (inode) + reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE, "reiserquota insert_item(): freeing %u id=%u type=%c", quota_bytes, inode->i_uid, head2type(ih)); #endif -- 2.20.1