Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2610182ybt; Tue, 16 Jun 2020 10:14:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL3r24fCQaHbuO6JUC0ntm6NSKAoC7JmiZmVE2BYTJ7vS/lmRXVhkadZWTJIu26yngwLnI X-Received: by 2002:aa7:c6c4:: with SMTP id b4mr3652171eds.210.1592327658760; Tue, 16 Jun 2020 10:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592327658; cv=none; d=google.com; s=arc-20160816; b=Y+Dy6f1rdQ/5tniC7dJ3jLb/+FfZssvOe+NZ2qEUEnyfIQFn00wHhBX3G4xqUq6IiW GfzdXN1T5IEhZu94cRlX3NT6peHtzCm8aPJQAwyjPuWTKc8t/ZXimSo8vuBoSJqo28Cj xX0/grPs2fF3e36M6jyXSGRvSfa6woXeE5QtIzfYvtA+QSreRmrrkExBK50ikLEV8jqJ wwdqoe7A7l2THW6qD4WAWHwIPhySwbWh0MoJsomv/JrQqYaaN6tvWYlKOwq+GTMBCCwl m+l6YARW2JMmNQNpAzN5V8AzXbIXE3/4R+uHqWKD+rEERtDGHPgQhwNuMMREA0Rxly1A 167g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=2sRnQKUEN0hJ0lDFJGLKTUGA7DRv9KTbBBMlUaUuGCI=; b=akkw+1eiHf4u1HhfFoacSXTNbnJ2k2sDTpvAcrUPKtRdttkmsir/n9mOzuApLKpgPQ pAFYEIPFI+ntu/T1nKs4vWrdx7mSNBvGxJbbXnDc1c8JdTiUJikX8Sxbri0cGLKn5MW9 h3s8mFDQ2PqpKwC3NZDWG1qVQkmf0m5bUqdDIL0DtAt7ewpYFlzGStw6wS//VVpWYaZ4 TFo/t8ZrMXngxAdSQRJz0uEyJ3vjmdjJcmolerKb2VQmNteqJNqsxZiFGgLjVLvBtbyK kgFTDX0uRaNOVLAPlpHm7fcjLJj9+Y4NPVlvYA+Wyo2bdxmQZwO/3DwgR+pcgD5OPcIc pcBg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 89si10581204edo.459.2020.06.16.10.13.55; Tue, 16 Jun 2020 10:14:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730333AbgFPRMC (ORCPT + 99 others); Tue, 16 Jun 2020 13:12:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:45654 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729897AbgFPRMB (ORCPT ); Tue, 16 Jun 2020 13:12:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 30A03B117; Tue, 16 Jun 2020 17:12:04 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 18928DA7C3; Tue, 16 Jun 2020 19:11:51 +0200 (CEST) Date: Tue, 16 Jun 2020 19:11:50 +0200 From: David Sterba To: Waiman Long Cc: Chris Mason , Josef Bacik , David Sterba , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH] btrfs: Use kfree() in btrfs_ioctl_get_subvol_info() Message-ID: <20200616171150.GH27795@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Waiman Long , Chris Mason , Josef Bacik , David Sterba , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org References: <20200616153159.10691-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616153159.10691-1-longman@redhat.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 16, 2020 at 11:31:59AM -0400, Waiman Long wrote: > 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. > > Reported-by: David Sterba > Signed-off-by: Waiman Long Added to the devel patch queue, thanks.