Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp280783pxx; Wed, 28 Oct 2020 04:55:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGvSEWo3MiZ6MHKXL/3jPdSKwg8cLCsOz1A6bfgqMx0JfIDyMB/KgiEZucrv55wBmX4pFs X-Received: by 2002:a17:906:3397:: with SMTP id v23mr7077203eja.212.1603886142145; Wed, 28 Oct 2020 04:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603886142; cv=none; d=google.com; s=arc-20160816; b=tH7BIIOEffqqqnB9I+9yQlr4so/mHu9C6DjWwBylRfbnoybEqeY6Yry6cNfZVsuH38 ZmjrcQfMzF0mFRJrLzODStM8hVPhFOzMFTkfA/JwftDVJhyaApFPbwY1mO9b93F/8tGo NUz9tUuPeaoE4ueyVMO/ch2dxVDzT0Zlbvz4sqLNfbcJRU/4j6rTsLCNvua5GqQkVz6o nZnuTeqGoBZ+78rK4nsKSfwVq0sqW6kUwbClIlpov4uzOSiHdYkHNcF4RpCEQQrT32bm o+YHZXr0flkU01Qgz3zjQmrZasyV8OzQJVoDBRcilQdlCmcg1FTROAJ5ZfQgvQnbHm+P hxaA== 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=DcCVX6Vg5bV3TaK2ZnnZfKai54gmkp7WLLc749EZuZ4=; b=pAC9JL2sxy9raHKkaOPPsTWdeLR2PHsC2siYU32oZxyMyziId/1bafXeMRa9JPpOhv XWOHhPavOZRWf5av9NHYjmVYOQ2QOyqNcZQ25GVkdeFqS98GwLSlDRbgkmdCrclkI5S2 1whkznvRMGHqGYJiMcZExZuFR9/3uY/I4S0HAq2m2tl9YZinqrip0X0uCLKA6mrLsp+H TOndHIhs6QL81AByl3GvEyGu/jMGXrDPLY9fNWnD63uogOUjWFZMMKWI4fDiez441V8e iyDKtER99umpPljXQz1if3ANYpkwwIbeMCTqK/aTxNr43IURnf630xrWnGmT+KrEClhy Azgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N2XF2JRq; 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 q18si2524555edb.466.2020.10.28.04.55.20; Wed, 28 Oct 2020 04:55:42 -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=N2XF2JRq; 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 S1794821AbgJ0PNs (ORCPT + 99 others); Tue, 27 Oct 2020 11:13:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:40978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1790932AbgJ0PGp (ORCPT ); Tue, 27 Oct 2020 11:06:45 -0400 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 D41F122284; Tue, 27 Oct 2020 15:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811202; bh=NSVsy1EO6niZi1vmCGr1HIWgFPlrK2jIIgNuW2XxwCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N2XF2JRqPgkEqXToRtAGPaFSNNlEqcY7zuNMVrnH801kjFquvZd4+DcIIc+m61IQs JQXtyaYd5k0oF6grbyBNJni7yp1lcoigygrHvkN3XZdxChdTJuw6Czio6CJfawmFrH neYl6gT+yeZUfyrg2fhCdGVeMYLxfRfJC1X4BlWY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tiezhu Yang , Anton Ivanov , Richard Weinberger , Sasha Levin Subject: [PATCH 5.8 408/633] um: vector: Use GFP_ATOMIC under spin lock Date: Tue, 27 Oct 2020 14:52:31 +0100 Message-Id: <20201027135541.863484713@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Tiezhu Yang [ Upstream commit e4e721fe4ccb504a29d1e8d4047667557281d932 ] Use GFP_ATOMIC instead of GFP_KERNEL under spin lock to fix possible sleep-in-atomic-context bugs. Fixes: 9807019a62dc ("um: Loadable BPF "Firmware" for vector drivers") Signed-off-by: Tiezhu Yang Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/um/drivers/vector_kern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 8735c468230a5..555203e3e7b45 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -1403,7 +1403,7 @@ static int vector_net_load_bpf_flash(struct net_device *dev, kfree(vp->bpf->filter); vp->bpf->filter = NULL; } else { - vp->bpf = kmalloc(sizeof(struct sock_fprog), GFP_KERNEL); + vp->bpf = kmalloc(sizeof(struct sock_fprog), GFP_ATOMIC); if (vp->bpf == NULL) { netdev_err(dev, "failed to allocate memory for firmware\n"); goto flash_fail; @@ -1415,7 +1415,7 @@ static int vector_net_load_bpf_flash(struct net_device *dev, if (request_firmware(&fw, efl->data, &vdevice->pdev.dev)) goto flash_fail; - vp->bpf->filter = kmemdup(fw->data, fw->size, GFP_KERNEL); + vp->bpf->filter = kmemdup(fw->data, fw->size, GFP_ATOMIC); if (!vp->bpf->filter) goto free_buffer; -- 2.25.1