Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp823813pxb; Tue, 3 Nov 2020 13:34:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+HbWKnyCc5TdG/yrnpI3j4cyXl0q6cRLKOkPpskxf4/Nx4SO7FFJsS4yk5rQ+75wfza8b X-Received: by 2002:a50:cc48:: with SMTP id n8mr24434515edi.137.1604439271015; Tue, 03 Nov 2020 13:34:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439271; cv=none; d=google.com; s=arc-20160816; b=jtcEucPpdRCdhwV/BdxImZazfvcSqQldH8RAq6hFhhMgbyMUqDsRr05rvmqEgIFXjo UOx7XMqgTkBFWae+Mv9SDm3MiyBVbRHq2siV7RF1/Tb9Ip7fOL76tnhtnEDspuodEQQ5 Hsg1ETOdCBYv4yyYmbX8HWgQs1sBoep6px2R/0jBp21FyitzxdpgqM7L/sIN3hGHzbhX 2LFDCFA6zIVa0AqDeXLdRMfmru1T1DcXJlKdDVbB6CpQRD1roEhQtpg9t0a1OVngSrZk SBHGV1FU4zTuciwOKeb4BNTArL6avmUNdWp7wj0c1FcvfaUXLBCmQnvDLkVw+A4QeZ8h UAqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0DfPARqKW1BGixyibYvmXWc0n0ntm2uW2+nf1ht4x+0=; b=EppQA4gf+DiXZRu/AH1Wq/syW0ZYYXej0e1biozSCeKFUvRpi2REMQPAfpDqauhdpU XSnXL9XTuL+XAsNwqaFe6zyHdvin4hjozL4n8cqrKOf0ukg3Yxp6vLiNY7haygA8VJyl wfFleqghTW8+yVyxqWkeNS7J1oE7XwgW0OvKRX1BgqyUe6M2Do/KAG9dvneHw1DHo3bN lPuxc3aXQtpJfZ9jeIKVceBHJO/8JZth9PH7LyvlmU4W7DUxXS+1M2uYF5BTsXp/VGWJ o49bSFWgXVXCIXoaRfNqYdHg11vt/GAIResBFOd6dpBxklGqHuUzR+eHj5PLum8TSqhw ESYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fNLEbHFx; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x7si6723983edr.509.2020.11.03.13.34.08; Tue, 03 Nov 2020 13:34:31 -0800 (PST) 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=fNLEbHFx; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732857AbgKCVbh (ORCPT + 99 others); Tue, 3 Nov 2020 16:31:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:59936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732199AbgKCU5d (ORCPT ); Tue, 3 Nov 2020 15:57:33 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 8F72622226; Tue, 3 Nov 2020 20:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437053; bh=9O20DVc0UHbK1oHKt/YQzuoc4csYrWp9r51e3kXk2mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fNLEbHFxpVdHYcBzPWL2FeuH7/RNoOM52blHK/FzpgmeEYBXtUeEgJVRd4e86iHoB cSeZmSSFBoRK0dKKxDY0uKLw//Y1Mm9crPBqHN6WLLg26UBYPcdBTATuY3sLjaZoM3 OlJNLf0SgODVnG/hdtuHo0yHgDa/kjFKCW2OodM0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Denis Efremov , David Sterba Subject: [PATCH 5.4 127/214] btrfs: use kvzalloc() to allocate clone_roots in btrfs_ioctl_send() Date: Tue, 3 Nov 2020 21:36:15 +0100 Message-Id: <20201103203302.744225893@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Denis Efremov commit 8eb2fd00153a3a96a19c62ac9c6d48c2efebe5e8 upstream. btrfs_ioctl_send() used open-coded kvzalloc implementation earlier. The code was accidentally replaced with kzalloc() call [1]. Restore the original code by using kvzalloc() to allocate sctx->clone_roots. [1] https://patchwork.kernel.org/patch/9757891/#20529627 Fixes: 818e010bf9d0 ("btrfs: replace opencoded kvzalloc with the helper") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Denis Efremov Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -7352,7 +7352,7 @@ long btrfs_ioctl_send(struct file *mnt_f alloc_size = sizeof(struct clone_root) * (arg->clone_sources_count + 1); - sctx->clone_roots = kzalloc(alloc_size, GFP_KERNEL); + sctx->clone_roots = kvzalloc(alloc_size, GFP_KERNEL); if (!sctx->clone_roots) { ret = -ENOMEM; goto out;