Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1251565imw; Tue, 5 Jul 2022 06:27:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uFP9MlQvcmIWiPp77Z+Ra39skvPDVUe2KXi2NxJleE+qQq1r/Vp6WWXH+rhhWVcxnxpTKm X-Received: by 2002:a65:6a50:0:b0:3f6:4566:581d with SMTP id o16-20020a656a50000000b003f64566581dmr29002118pgu.122.1657027644505; Tue, 05 Jul 2022 06:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027644; cv=none; d=google.com; s=arc-20160816; b=UHzp5BTXf5gVY9oOw0QaZVXee03+q9pmNvGg76pf6i+DsWPXhNTMj0BaPVLjys1WHf Tf5istqWJUB8oIEXhdzB09n4TwRWQcNz0mWDu2cCZ7eCL4rzhZjmW9q+eBoHNfED3YSZ Hf4P85Qd4PbXfTKx+oM8EWgvwMjfycx6X/xF2fbLjtRgXUAmZ2zuHrnUOCbDLIZkF+T0 wjt3pnzYezTEyU5fLmAVY1lV9h8lg2upnRC2qPL4mC96FY4wT0XcRGR4uz56hmy0Fddn YncikFC4qKIHCQ9o6XM6utEg92+k/5U9HCsPBzYjJinOQEEMWTw81Zc+A6kYzTHo8B3p tahQ== 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=45wb6bq/fcB8beth/EJklEvc1uYbvPrqm3QpJKJwUvM=; b=u74MjEeKcwl2y9Oiou8r0QM9Lnqb+tBITfGazvb8ZSYXGdxI17iN1y8AAoaCA6ClgQ kvQAAKnO+o4YVczhxZqLpAKRJsga1XzrPKOa3DK8U2nfXyc21reuA7QmP6LHjn8dxFNl vH481h7jwJrnaiTXDUhdDHtpdLYxXIpSMs/ffYt+H9wJHGcagdh6FqI4l6dpCVJU1hOM 7WjkZItuVhKZiBsyV0E/c8KwDCpnUVapaqfV3gYpDd63Knz65vQt92tEH45f+Oq0BUT6 vQTRnMODukg8BbTEFz6BHeFlYHXsuliv5TtlF8oiNY/1fZlbLBHhGDlzDehtViiC4ion hEHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZyElU3SL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g187-20020a636bc4000000b0040dfaf77438si24634139pgc.559.2022.07.05.06.27.12; Tue, 05 Jul 2022 06:27:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZyElU3SL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236363AbiGEMVx (ORCPT + 99 others); Tue, 5 Jul 2022 08:21:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235587AbiGEMOH (ORCPT ); Tue, 5 Jul 2022 08:14:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 715B31AF0E; Tue, 5 Jul 2022 05:11:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0E22C619B0; Tue, 5 Jul 2022 12:11:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 157FEC341C7; Tue, 5 Jul 2022 12:11:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657023086; bh=vL0arXI7ti0jT6m6fv3+MgrGNiDpDyse8ySN/98+12c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZyElU3SLNVhFXhMm0SoGRvYtEvG1uEM1ltZRS7I+2oL50M6nTy8eWBQ+6/d6eRpKb yiIeuOlNDaOpDT8+ug2Ai5D52+JdEls9XxGnM26+ANwtGux4Em3R/JxxzJws1e7EZb vDFxK+RrVNEVh4Knicf1J+MvdUccbmgVN7QAnsAM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , Jakub Kicinski Subject: [PATCH 5.15 31/98] usbnet: fix memory allocation in helpers Date: Tue, 5 Jul 2022 13:57:49 +0200 Message-Id: <20220705115618.476059786@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115617.568350164@linuxfoundation.org> References: <20220705115617.568350164@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Neukum commit e65af5403e462ccd7dff6a045a886c64da598c2e upstream. usbnet provides some helper functions that are also used in the context of reset() operations. During a reset the other drivers on a device are unable to operate. As that can be block drivers, a driver for another interface cannot use paging in its memory allocations without risking a deadlock. Use GFP_NOIO in the helpers. Fixes: 877bd862f32b8 ("usbnet: introduce usbnet 3 command helpers") Signed-off-by: Oliver Neukum Link: https://lore.kernel.org/r/20220628093517.7469-1-oneukum@suse.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/usbnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -2002,7 +2002,7 @@ static int __usbnet_read_cmd(struct usbn cmd, reqtype, value, index, size); if (size) { - buf = kmalloc(size, GFP_KERNEL); + buf = kmalloc(size, GFP_NOIO); if (!buf) goto out; } @@ -2034,7 +2034,7 @@ static int __usbnet_write_cmd(struct usb cmd, reqtype, value, index, size); if (data) { - buf = kmemdup(data, size, GFP_KERNEL); + buf = kmemdup(data, size, GFP_NOIO); if (!buf) goto out; } else {