All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Luis Henriques <luis.henriques@canonical.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Oliver Neukum <oneukum@suse.com>
Subject: Re: [PATCH 3.14 30/59] xhci: refuse loading if nousb is used
Date: Sun, 31 Jan 2016 11:10:14 -0800	[thread overview]
Message-ID: <20160131191014.GA23698@kroah.com> (raw)
In-Reply-To: <20160128175735.GB30680@charon.olymp>

On Thu, Jan 28, 2016 at 05:57:35PM +0000, Luis Henriques wrote:
> On Wed, Jan 27, 2016 at 10:15:18AM -0800, Greg Kroah-Hartman wrote:
> > 3.14-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Oliver Neukum <oneukum@suse.com>
> > 
> > commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
> > 
> > The module should fail to load.
> > 
> > Signed-off-by: Oliver Neukum <oneukum@suse.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > ---
> >  drivers/usb/host/xhci.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> > @@ -4893,6 +4893,10 @@ static int __init xhci_hcd_init(void)
> >  	BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8);
> >  	/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
> >  	BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
> > +
> > +	if (usb_disabled())
> > +		return -ENODEV;
> > +
> 
> I believe the error path should actually call xhci_unregister_pci().
> Something like the patch below.  The same is applies to the 3.10
> kernel.
> 
> Cheers,
> --
> Luís
> 
> >  	return 0;
> >  unreg_pci:
> >  	xhci_unregister_pci();
> > 
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe stable" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> >From 870b9e9479b67df493e2ca3c763102b10d4dd9da Mon Sep 17 00:00:00 2001
> From: Oliver Neukum <oneukum@suse.com>
> Date: Thu, 3 Dec 2015 15:03:34 +0100
> Subject: xhci: refuse loading if nousb is used
> 
> commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
> 
> The module should fail to load.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [ luis: need to call xhci_unregister_pci() in the error path ]
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  drivers/usb/host/xhci.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 20209e870a99..4c78dc564b3a 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -4955,6 +4955,12 @@ static int __init xhci_hcd_init(void)
>  	BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8);
>  	/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
>  	BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
> +
> +	if (usb_disabled()) {
> +		retval = -ENODEV;
> +		goto unreg_pci;
> +	}

No, we should move the check much higher up to the top of the function,
which makes it simpler.  I'll go do that instead, thanks.

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Luis Henriques <luis.henriques@canonical.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Oliver Neukum <oneukum@suse.com>
Subject: Re: [PATCH 3.14 30/59] xhci: refuse loading if nousb is used
Date: Sun, 31 Jan 2016 11:10:14 -0800	[thread overview]
Message-ID: <20160131191014.GA23698@kroah.com> (raw)
In-Reply-To: <20160128175735.GB30680@charon.olymp>

On Thu, Jan 28, 2016 at 05:57:35PM +0000, Luis Henriques wrote:
> On Wed, Jan 27, 2016 at 10:15:18AM -0800, Greg Kroah-Hartman wrote:
> > 3.14-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Oliver Neukum <oneukum@suse.com>
> > 
> > commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
> > 
> > The module should fail to load.
> > 
> > Signed-off-by: Oliver Neukum <oneukum@suse.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > ---
> >  drivers/usb/host/xhci.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> > @@ -4893,6 +4893,10 @@ static int __init xhci_hcd_init(void)
> >  	BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8);
> >  	/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
> >  	BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
> > +
> > +	if (usb_disabled())
> > +		return -ENODEV;
> > +
> 
> I believe the error path should actually call xhci_unregister_pci().
> Something like the patch below.  The same is applies to the 3.10
> kernel.
> 
> Cheers,
> --
> Lu�s
> 
> >  	return 0;
> >  unreg_pci:
> >  	xhci_unregister_pci();
> > 
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe stable" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> >From 870b9e9479b67df493e2ca3c763102b10d4dd9da Mon Sep 17 00:00:00 2001
> From: Oliver Neukum <oneukum@suse.com>
> Date: Thu, 3 Dec 2015 15:03:34 +0100
> Subject: xhci: refuse loading if nousb is used
> 
> commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
> 
> The module should fail to load.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [ luis: need to call xhci_unregister_pci() in the error path ]
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  drivers/usb/host/xhci.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 20209e870a99..4c78dc564b3a 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -4955,6 +4955,12 @@ static int __init xhci_hcd_init(void)
>  	BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8);
>  	/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
>  	BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
> +
> +	if (usb_disabled()) {
> +		retval = -ENODEV;
> +		goto unreg_pci;
> +	}

No, we should move the check much higher up to the top of the function,
which makes it simpler.  I'll go do that instead, thanks.

greg k-h

  reply	other threads:[~2016-01-31 19:10 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 18:14 [PATCH 3.14 00/59] 3.14.60-stable review Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 01/59] x86/signal: Fix restart_syscall number for x32 tasks Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 02/59] xen/gntdev: Grant maps should not be subject to NUMA balancing Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 03/59] x86/xen: dont reset vcpu_info on a cancelled suspend Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 04/59] KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 05/59] x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[] Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 06/59] x86/boot: Double BOOT_HEAP_SIZE to 64KB Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 07/59] ipmi: move timer init to before irq is setup Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 08/59] ALSA: hda - Add Intel Lewisburg device IDs Audio Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 09/59] ALSA: hda - Apply pin fixup for HP ProBook 6550b Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 10/59] ALSA: rme96: Fix unexpected volume reset after rate changes Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 11/59] ALSA: hda - Add inverted dmic for Packard Bell DOTS Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 12/59] ALSA: hda - Set SKL+ hda controller power at freeze() and thaw() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 13/59] ALSA: hda/realtek - Fix silent headphone output on MacPro 4,1 (v2) Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 14/59] ALSA: seq: Fix missing NULL check at remove_events ioctl Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 15/59] ALSA: seq: Fix race at timer setup and close Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 16/59] ALSA: timer: Harden slave timer list handling Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 17/59] ALSA: timer: Fix race among timer ioctls Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 18/59] ALSA: timer: Fix double unlink of active_list Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 19/59] ALSA: seq: Fix snd_seq_call_port_info_ioctl in compat mode Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 20/59] ALSA: pcm: Fix snd_pcm_hw_params struct copy " Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 21/59] ALSA: hrtimer: Fix stall by hrtimer_cancel() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 22/59] ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0 Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 23/59] ASoC: wm8962: correct addresses for HPF_C_0/1 Greg Kroah-Hartman
2016-01-27 18:15   ` Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 24/59] ASoC: wm8974: set cache type for regmap Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 25/59] ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 26/59] ASoC: compress: Fix compress device direction check Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 27/59] usb: xhci: fix config fail of FS hub behind a HS hub with MTT Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 28/59] USB: ipaq.c: fix a timeout loop Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 29/59] USB: cp210x: add ID for ELV Marble Sound Board 1 Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 30/59] xhci: refuse loading if nousb is used Greg Kroah-Hartman
2016-01-28 17:57   ` Luis Henriques
2016-01-28 17:57     ` Luis Henriques
2016-01-31 19:10     ` Greg Kroah-Hartman [this message]
2016-01-31 19:10       ` Greg Kroah-Hartman
2016-02-02 17:34       ` Luis Henriques
2016-02-02 17:34         ` Luis Henriques
2016-01-27 18:15 ` [PATCH 3.14 32/59] ipv6/addrlabel: fix ip6addrlbl_get() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 33/59] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 34/59] connector: bump skb->users before callback invocation Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 35/59] unix: properly account for FDs passed over unix sockets Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 36/59] bridge: Only call /sbin/bridge-stp for the initial network namespace Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 37/59] net: possible use after free in dst_release Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 38/59] net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 39/59] tcp_yeah: dont set ssthresh below 2 Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 40/59] bonding: Prevent IPv6 link local address on enslaved devices Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 41/59] phonet: properly unshare skbs in phonet_rcv() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 42/59] ipv6: update skb->csum when CE mark is propagated Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 43/59] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 45/59] team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 46/59] powerpc/tm: Block signal return setting invalid MSR state Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 47/59] powerpc/tm: Check for already reclaimed tasks Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 48/59] powerpc: Make value-returning atomics fully ordered Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 49/59] powerpc: Make {cmp}xchg* and their atomic_ versions " Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 50/59] scripts/recordmcount.pl: support data in text section on powerpc Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 51/59] arm64: KVM: Fix AArch32 to AArch64 register mapping Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 52/59] arm64: fix building without CONFIG_UID16 Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 53/59] arm64: Clear out any singlestep state on a ptrace detach operation Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 54/59] arm64: mm: ensure that the zero page is visible to the page table walker Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 55/59] parisc iommu: fix panic due to trying to allocate too large region Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 56/59] HID: core: Avoid uninitialized buffer access Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 57/59] openrisc: fix CONFIG_UID16 setting Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 58/59] mn10300: Select CONFIG_HAVE_UID16 to fix build failure Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 59/59] arm64: restore bogomips information in /proc/cpuinfo Greg Kroah-Hartman
2016-01-27 23:29 ` [PATCH 3.14 00/59] 3.14.60-stable review Shuah Khan
2016-01-28  2:01 ` Guenter Roeck

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=20160131191014.GA23698@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luis.henriques@canonical.com \
    --cc=oneukum@suse.com \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.