Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1089859ybt; Wed, 1 Jul 2020 18:39:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHiD5oM4bGOGBDmg2Qyep3deUOSOcNaQfjzTjnRFdA+D9j5uH6pPTTNV1VhXjfHFN7oAyO X-Received: by 2002:a17:906:5909:: with SMTP id h9mr22571337ejq.501.1593653941737; Wed, 01 Jul 2020 18:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593653941; cv=none; d=google.com; s=arc-20160816; b=YV5J8KxcctuCNTDCdjoW+xSYLQZFdyocaFcdS4UMSGt1DKJHXQXU2MdODtSWJBahI1 OInnOfUJpZ3VY/0Q2B8CHW79YlFOyPEpXIPGMn0RzvgCqFytGej2SWMvLeIwGt921hyU P/SNEeqfPo7To7mGvLGIIBaiPm2cVxc/KNNwHZ9vQuvGXOqWyJfDrZtDdJZ2+HMu9nKc HwQMANI68UFYwS4g3WmPdLHtOFBIQ1mhUKIKxHlKIHcesW5hZ0ZC2ZAz5GlxqysFQofJ nFnbLEvVN36yVREMHUuxljX4SclhUdcOWfPfjPCK1eZcTrqotbIHTIKHE62L0VrshDaO hVdQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tGFkXIIO+mB7bDwUkkgKmSYZItZskSKBzxSHPT3FEp4=; b=nC1ezWVq5f5bYrLnjpS/a1zHSETs2yWoVCsc8fE9NZ4FHe2+xPJqpLfCYCwEZYA/dB K8VSKhHuV0UjuekQoeaMTR7P4uSXfb2ZJ8Oc2+TKSXcYiihfszijUv7KbmmC/dGJgdMt 7gqJ2eC+RyQOgmAFK95Y/R/GCq6TxEr/btsby3PobssyujkgsWwaeMprX5FG1+ezVeBL ydGv+iAQb2zi+/o8do8q0AwD97/9KLOZ0ezBOyWJS6WZZRxlFKSKwMFo/0+OrHsaLFx/ ZMUNPk5H+LA/ndfz82rgDMy/Wkqp2k7p8MdsqPSCoCAqip2T5GoF5pS+DNORP8+tM1tW LoLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LpZu+6IT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi11si5315654edb.544.2020.07.01.18.38.39; Wed, 01 Jul 2020 18:39:01 -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=pass header.i=@kernel.org header.s=default header.b=LpZu+6IT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729192AbgGBBgk (ORCPT + 99 others); Wed, 1 Jul 2020 21:36:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:53494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728214AbgGBBXI (ORCPT ); Wed, 1 Jul 2020 21:23:08 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D555D2083E; Thu, 2 Jul 2020 01:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593652988; bh=q5PPXSNYwYNETXLnW13CPZbxXCtQGH4Z5Ed2lgifHKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LpZu+6ITCM7D6W613S3GngtsubwK2JuZojxXDueLpyIwOAJFNsfsjBPTP5Iem9PkD TGRYMOU2rn6/HILD81dJlDiZJrG5ZDWuPbA+CytnBDYVuEy9qmj9LBzEi2det92pDC uCDFSLJfwR6728jqDcbmMuQRu25vqmI1FcW6X00k= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Waiman Long , David Sterba , Sasha Levin , linux-btrfs@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 11/53] btrfs: use kfree() in btrfs_ioctl_get_subvol_info() Date: Wed, 1 Jul 2020 21:21:20 -0400 Message-Id: <20200702012202.2700645-11-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200702012202.2700645-1-sashal@kernel.org> References: <20200702012202.2700645-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Waiman Long [ Upstream commit b091f7fede97cc64f7aaad3eeb37965aebee3082 ] In btrfs_ioctl_get_subvol_info(), there is a classic case where kzalloc() was incorrectly paired with kzfree(). According to David Sterba, there isn't any sensitive information in the subvol_info that needs to be cleared before freeing. So kzfree() isn't really needed, use kfree() instead. Signed-off-by: Waiman Long Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 40b729dce91cd..5070bd2436b76 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2691,7 +2691,7 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp) btrfs_put_root(root); out_free: btrfs_free_path(path); - kzfree(subvol_info); + kfree(subvol_info); return ret; } -- 2.25.1