From: Greg KH <greg@kroah.com>
To: Ingo Rohloff <ingo.rohloff@lauterbach.com>
Cc: linux-usb@vger.kernel.org, linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] usb: usbfs: Suppress problematic bind and unbind uevents.
Date: Fri, 11 Oct 2019 04:41:32 +0000 [thread overview]
Message-ID: <20191011044132.GA946248@kroah.com> (raw)
In-Reply-To: <20191010164800.2444-1-ingo.rohloff@lauterbach.com>
On Thu, Oct 10, 2019 at 06:48:00PM +0200, Ingo Rohloff wrote:
> commit 1455cf8dbfd0 ("driver core: emit uevents when device is bound
> to a driver") added bind and unbind uevents when a driver is bound or
> unbound to a physical device.
>
> For USB devices which are handled via the generic usbfs layer (via
> libusb for example), this is problematic:
> Each time a user space program calls
> ioctl(usb_fd, USBDEVFS_CLAIMINTERFACE, &usb_intf_nr);
> and then later
> ioctl(usb_fd, USBDEVFS_RELEASEINTERFACE, &usb_intf_nr);
> The kernel will now produce a bind or unbind event, which does not
> really contain any useful information.
>
> This allows a user space program to run a DoS attack against programs
> which listen to uevents (in particular systemd/eudev/upowerd):
> A malicious user space program just has to call in a tight loop
>
> ioctl(usb_fd, USBDEVFS_CLAIMINTERFACE, &usb_intf_nr);
> ioctl(usb_fd, USBDEVFS_RELEASEINTERFACE, &usb_intf_nr);
>
> With this loop the malicious user space program floods the kernel and
> all programs listening to uevents with tons of bind and unbind
> events.
>
> This patch suppresses uevents for ioctls USBDEVFS_CLAIMINTERFACE and
> USBDEVFS_RELEASEINTERFACE.
>
> Signed-off-by: Ingo Rohloff <ingo.rohloff@lauterbach.com>
> ---
> drivers/usb/core/devio.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
I am guessing this is a new version of a previously-submitted patch? If
so, you need to include a "version" number on it, and put what you
changed below the --- line. The kernel documentation should explain how
to do this, if not, please let us know.
Please fix this up and resend.
thanks,
greg k-h
prev parent reply other threads:[~2019-10-11 4:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 16:48 [PATCH] usb: usbfs: Suppress problematic bind and unbind uevents Ingo Rohloff
2019-10-11 4:41 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191011044132.GA946248@kroah.com \
--to=greg@kroah.com \
--cc=ingo.rohloff@lauterbach.com \
--cc=linux-hotplug@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).