Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332050 > unrolled thread

[PATCH 3.12 20/64] xhci: refuse loading if nousb is used

Started byJiri Slaby <jslaby@suse.cz>
First post2016-02-11 15:30 +0100
Last post2016-02-16 09:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.12 20/64] xhci: refuse loading if nousb is used Jiri Slaby <jslaby@suse.cz> - 2016-02-11 15:30 +0100
    Re: [PATCH 3.12 20/64] xhci: refuse loading if nousb is used Ben Hutchings <ben@decadent.org.uk> - 2016-02-16 04:10 +0100
      Re: [PATCH 3.12 20/64] xhci: refuse loading if nousb is used Jiri Slaby <jslaby@suse.cz> - 2016-02-16 09:50 +0100

#1332050 — [PATCH 3.12 20/64] xhci: refuse loading if nousb is used

FromJiri Slaby <jslaby@suse.cz>
Date2016-02-11 15:30 +0100
Subject[PATCH 3.12 20/64] xhci: refuse loading if nousb is used
Message-ID<r10pR-1zg-37@gated-at.bofh.it>
From: Oliver Neukum <oneukum@suse.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.

The module should fail to load.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/xhci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 47b25542a99c..6888e9a956d4 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4891,6 +4891,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;
+
 	return 0;
 unreg_pci:
 	xhci_unregister_pci();
-- 
2.7.1

[toc] | [next] | [standalone]


#1334976

FromBen Hutchings <ben@decadent.org.uk>
Date2016-02-16 04:10 +0100
Message-ID<r2Ebv-1RL-9@gated-at.bofh.it>
In reply to#1332050

[Multipart message — attachments visible in raw view] — view raw

On Thu, 2016-02-11 at 14:58 +0100, Jiri Slaby wrote:
> From: Oliver Neukum <oneukum@suse.com>
> 
> 3.12-stable review patch.  If anyone has any objections, please let me know.
> 
> ===============
> 
> commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
> 
> The module should fail to load.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
>  drivers/usb/host/xhci.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 47b25542a99c..6888e9a956d4 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -4891,6 +4891,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;
> +
>  	return 0;
>  unreg_pci:
>  	xhci_unregister_pci();

This check needs to go at the top of the function, before the call to
xhci_register_pci().

Ben.

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon

[toc] | [prev] | [next] | [standalone]


#1335161

FromJiri Slaby <jslaby@suse.cz>
Date2016-02-16 09:50 +0100
Message-ID<r2Juy-5sH-27@gated-at.bofh.it>
In reply to#1334976
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 02/16/2016, 04:06 AM, Ben Hutchings wrote:
> On Thu, 2016-02-11 at 14:58 +0100, Jiri Slaby wrote:
>> From: Oliver Neukum <oneukum@suse.com>
>> 
>> 3.12-stable review patch.  If anyone has any objections, please
>> let me know.
>> 
>> ===============
>> 
>> commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
>> 
>> The module should fail to load.
>> 
>> Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by:
>> Jiri Slaby <jslaby@suse.cz> --- drivers/usb/host/xhci.c | 4 ++++ 
>> 1 file changed, 4 insertions(+)
>> 
>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c 
>> index 47b25542a99c..6888e9a956d4 100644 ---
>> a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@
>> -4891,6 +4891,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; + return 0; unreg_pci: 
>> xhci_unregister_pci();
> 
> This check needs to go at the top of the function, before the call
> to xhci_register_pci().

Oh yes, this is done later in 3.12.54 in:

commit b48d054283a2c2d60a100bf7772bf308042c57ac
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Sun Jan 31 11:11:58 2016 -0800

    xhci: fix placement of call to usb_disabled()

thanks,
- -- 
js
suse labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWwuKNAAoJEL0lsQQGtHBJijIP/iZ6yp7A99iQi2ZqPvsHe+xC
Cqip1AXpPaA727acGmlhC+B55jFzWQyEGFYOq7/Q3pZ8uxp9iVDfa6RsyfPqCbrF
ItadjVKhjTc4RW005sjqUJCh/7fg776tr7mcf+2vgrF/TexSi/OrOOOcgsBVp3vj
iZFnr2mKPC4nLhDx6iOIqYCSEGUASgdwQW3NuhnfOaVRM7lRBLl6Isbg24CN+Kra
V9/x1xxNl00eBpMEU6G9bav847KWdOLik6qW0emuy3Bjzc34bVRH74m20ZVcJSEI
5bG9BFGNbikQdasRoWr/H8OSnh1YwZ38daazPsIdDqyut4VKkQ5wfvxP+/c/KUsG
rYvfVTVaJWXb9gdODDleVIWRaZ1Va/0q5uzDrQi4KGV62dw9Pb0JJnDcuvWKmtx/
N0Fjjl7L1RoqNGklGPtqrYA2B8h/dqPlU0nOxwMBaafjeds+KK1k5ZWLlJUH3K4a
CAFeabEjVCaysrHZ768OXGAH/BGreAUTsYL4l5VapQZwy/EggV5oeFlJjkIRZDJG
kGQpGe63Bl/8+fFtx8UtW4d0LbtvgfSCIOZBCmyd/HIODODv53Exehm7vU409Dyd
9XsVJUhO/ANCHu/NSc+c9bL4f3u5Exd2uLoq2jeMricOZzat3ysVHFrTXqB1tO0f
D14IaCz004DOckjJzJQa
=Wtvm
-----END PGP SIGNATURE-----

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web