Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4480913ivc; Tue, 3 Nov 2020 13:09:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWBqxw2cHI/jKjAo0CaIgzAOVfyUE06r4mINVovNsyTGEbvn31lW8pQn0pJ3JfmkQEGoA0 X-Received: by 2002:a17:906:14d1:: with SMTP id y17mr22515831ejc.15.1604437767831; Tue, 03 Nov 2020 13:09:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437767; cv=none; d=google.com; s=arc-20160816; b=sbZ4w4lOm8v+osQhc/U/E3J3g6WTGKjZZp3nTd43TTQQFzX5LNZE6H/z2PG05JGJns Q5LvkgbqGHRU4S+poiyuZvJQ9dPCLIFaB97i6MxS6xHajfb8UqMh9NuKBKYjK5KO04f2 6/9Q8ZcZasvZ2vjU1PTj2np+LhxVzsZqEsNHQqCR2aFfSsJEe5zElF0916yd5jJzyVXe f/mtq5Cr9pKZbN2lLoMHZi8YneiMmfZb2iWKCK24ux9M+glikijU7kCedSNy7H91D8if MC16+dh9rfDuccnsNCZsWLVJIEjK0h2kaMsB7SBepi9YhqhUsT2J/qQGBiJmLQ8v0JZK FKsg== 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=WM+2B6OVwSDFb034WTuUYUvhMDRGaHIVzjUi1JEKYBo=; b=SI/9nE4HlWJbmCSs/ZvJ90Mr81tTYyBKZRbRFGdQp0leHYab52aalxR6a1EHT/tyNP ABVAWk0JiPgrEYZ1u91jXroWAPdcJGidKTPJA/esANQ2yEljhhvR5zlW5MkNoGF3Govn T3zknQCplO92AWBUJqRA18O2pwPixq8TSvLBmlq4LOb03Gv8xKFnCa1obtUwATwPS0Ij Sd+n//LeUV7QO94Jsi3o13lQyp6iaWQsbmM3bc1OVwWpa9t6RiRWXEcONtD/z0t+imKy OFXcu+8urGKjauM6/A4+h8X9SYZu+DFfX2PmWxxzZOewVelKlHaEmmLk4jQ3bCJ/oNOD w29Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NiIUaNqw; 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 r19si3655779edb.489.2020.11.03.13.09.05; Tue, 03 Nov 2020 13:09:27 -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=NiIUaNqw; 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 S2388030AbgKCVHq (ORCPT + 99 others); Tue, 3 Nov 2020 16:07:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:46906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388311AbgKCVHi (ORCPT ); Tue, 3 Nov 2020 16:07:38 -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 8F382205ED; Tue, 3 Nov 2020 21:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437658; bh=DkaiWdgXdPpmYkXen4EmdiCbkbN3LFjCEHg6J12kaFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NiIUaNqwQINs2PaBh/w8/IkWBKGyP/3PeSgfhUvsxW0pdXtxmwh16Dzc3+8qxO8J1 tLIBcF/Nts4CON3l8ZNoho9OvCCxEQTGt4AJaT7NY6EeuiswlN5rdoXmXw7YaWWz/1 T4bWzq1aUO9zkhVfmE3pd3I/NRVMo5d4wobjmSWQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Denis Efremov , David Sterba Subject: [PATCH 4.19 132/191] btrfs: use kvzalloc() to allocate clone_roots in btrfs_ioctl_send() Date: Tue, 3 Nov 2020 21:37:04 +0100 Message-Id: <20201103203245.418735460@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@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 @@ -6859,7 +6859,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;