From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 634F1C2D0A8 for ; Wed, 23 Sep 2020 11:16:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2562C2145D for ; Wed, 23 Sep 2020 11:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600859761; bh=k7bvObGv/5TMUQnd/QMtlPwJ9EvOtkdaXtTIH9eGxkg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=sNzjH4YybBzaP5FzyTBZ91ymV+RFs5jfXPiSr6zJu8+vLEjydeCTHIQvlD/7fi5mL tBeQE/IcZbA7btEPePRJAZ2lX2d3HrmM9NotJU5lO1pN9sbRnSCMXqvqrc3X2m/O8t cRL1llV78AnQe3LwMmWMeFP23YNTFq4EgxGzfZ/A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbgIWLQA (ORCPT ); Wed, 23 Sep 2020 07:16:00 -0400 Received: from wforward2-smtp.messagingengine.com ([64.147.123.31]:38749 "EHLO wforward2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgIWLQA (ORCPT ); Wed, 23 Sep 2020 07:16:00 -0400 X-Greylist: delayed 533 seconds by postgrey-1.27 at vger.kernel.org; Wed, 23 Sep 2020 07:16:00 EDT Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id 9C4ED79A; Wed, 23 Sep 2020 07:07:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 23 Sep 2020 07:07:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=QJ4ejx JDqTxfbZVhW/Ptcn86q4+/VCpzl8dvQmkfoPA=; b=UluWS7fR1nsZFnhj8ZknxE H6rDZGUM2C9dznipmxyfBNRysg6dLM1UdB2S/PwNU3SKIfbmHLBYcw86j8DBSGg4 4KHT3CPUS8cyoALIMj6MW60k4IUpSHzytnOrxEJDZFY8p2IVIOt89A2IHpsJ0OhT btz8wJ4DXA5o+KIy6MgbXdk1y29QhRhivrb6kpUXpGeEFqKdLEfVv2To/LFE0Xg1 t2rjr49VFs2LqFc79GHbOiBCmCu8qQ92JcprdCwYVZ0CRlSf4EmofrfJkspfYGjF X5W4yamvJZkLk/Xz+fc59DqExYTeJeil/4MnAElXUsY14hHZYntMeaD48HTzv32Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeigdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghgucfm jfcuoehgrhgvghfmjfeslhhinhhugihfohhunhgurghtihhonhdrohhrgheqnecuggftrf grthhtvghrnheptedvleegfffguddtledvvddtteffjeetgfevveeugefgleelhfevveef udeuuddvnecukfhppeekfedrkeeirdejgedrieegnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id 9A83B328005D; Wed, 23 Sep 2020 07:07:05 -0400 (EDT) Date: Wed, 23 Sep 2020 13:07:24 +0200 From: Greg KH To: Oliver Neukum Cc: Himadri Pandya , Alan Stern , linux-usb@vger.kernel.org Subject: Re: usb_control_msg_send() and usb_control_msg_recv() are highly problematic Message-ID: <20200923110724.GA3692555@kroah.com> References: <1600858740.26851.16.camel@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1600858740.26851.16.camel@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Wed, Sep 23, 2020 at 12:59:00PM +0200, Oliver Neukum wrote: > Hi, > > you probably do not want to hear this. I was out of comission > for the last week weeks and I should have looked at this more closely. > > You may notice that usb_control_msg() for times immemorial has been > using GFP_NOIO internally. This is because control messages are needed > in a lot of contexts such as SCSI error handling and runtime PM > that require GFP_NOIO. IIRC at that time we found ourselves unable to > go through all those call chains, so we pulled the nuclear option > and slapped a blanket GFP_NOIO on the function. > > Today I got a patch that outright deleted a memory allocation with > GFP_NOIO, so I looked into this. We are making the same mistake > we couldn't fix in the past. > I am afraid the API has to be changed to include memory flags. > And we should do this now while the damage is still within limits. > I am preparing patches. How about we always use GPF_NOIO for the calls? That should be fine and make it easier, right? thanks, greg k-h