All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Johan Hovold <jhovold@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [ 54/69] USB: option: fix port-data abuse
Date: Sun, 17 Jun 2012 19:00:35 +0100	[thread overview]
Message-ID: <20120617175949.130460490@decadent.org.uk> (raw)
In-Reply-To: <20120617175941.281333656@decadent.org.uk>

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

------------------

From: Johan Hovold <jhovold@gmail.com>

commit 4273f9878b0a8271df055e3c8f2e7f08c6a4a2f4 upstream.

Commit 8b4c6a3ab596961b78465 ("USB: option: Use generic USB wwan code")
moved option port-data allocation to usb_wwan_startup but still cast the
port data to the old struct...

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/serial/option.c |   34 +++-------------------------------
 1 file changed, 3 insertions(+), 31 deletions(-)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1273,35 +1273,6 @@
 
 static int debug;
 
-/* per port private data */
-
-#define N_IN_URB 4
-#define N_OUT_URB 4
-#define IN_BUFLEN 4096
-#define OUT_BUFLEN 4096
-
-struct option_port_private {
-	/* Input endpoints and buffer for this port */
-	struct urb *in_urbs[N_IN_URB];
-	u8 *in_buffer[N_IN_URB];
-	/* Output endpoints and buffer for this port */
-	struct urb *out_urbs[N_OUT_URB];
-	u8 *out_buffer[N_OUT_URB];
-	unsigned long out_busy;		/* Bit vector of URBs in use */
-	int opened;
-	struct usb_anchor delayed;
-
-	/* Settings for the port */
-	int rts_state;	/* Handshaking pins (outputs) */
-	int dtr_state;
-	int cts_state;	/* Handshaking pins (inputs) */
-	int dsr_state;
-	int dcd_state;
-	int ri_state;
-
-	unsigned long tx_start_time[N_OUT_URB];
-};
-
 /* Functions used by new usb-serial code. */
 static int __init option_init(void)
 {
@@ -1404,7 +1375,8 @@
 	int err;
 	int status = urb->status;
 	struct usb_serial_port *port =  urb->context;
-	struct option_port_private *portdata = usb_get_serial_port_data(port);
+	struct usb_wwan_port_private *portdata =
+					usb_get_serial_port_data(port);
 
 	dbg("%s", __func__);
 	dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata);
@@ -1465,7 +1437,7 @@
 	struct usb_serial *serial = port->serial;
 	struct usb_wwan_intf_private *intfdata =
 		(struct usb_wwan_intf_private *) serial->private;
-	struct option_port_private *portdata;
+	struct usb_wwan_port_private *portdata;
 	int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
 	int val = 0;
 	dbg("%s", __func__);



  parent reply	other threads:[~2012-06-17 18:36 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-17 17:59 [ 00/69] 3.2.21-stable review Ben Hutchings
2012-06-17 17:59 ` [ 01/69] drm/i915: Mark the ringbuffers as being in the GTT domain Ben Hutchings
2012-06-17 17:59 ` [ 02/69] drm/i915: hold forcewake around ring hw init Ben Hutchings
2012-06-17 17:59 ` [ 03/69] drm/i915: Unpin the flip target if we fail to queue the flip Ben Hutchings
2012-06-17 17:59 ` [ 04/69] drm/i915: fix up ivb plane 3 pageflips Ben Hutchings
2012-06-18 21:55   ` Herton Ronaldo Krzesinski
2012-06-18 22:10     ` Eugeni Dodonov
2012-06-19  3:59       ` Ben Hutchings
2012-06-19  8:23         ` Daniel Vetter
2012-06-19 11:59           ` Ben Hutchings
2012-06-19 11:45         ` Eugeni Dodonov
2012-06-17 17:59 ` [ 05/69] char/agp: add another Ironlake host bridge Ben Hutchings
2012-06-17 17:59 ` [ 06/69] x86/uv: Fix UV2 BAU legacy mode Ben Hutchings
2012-06-17 17:59 ` [ 07/69] powerpc: Fix kernel panic during kernel module load Ben Hutchings
2012-06-17 17:59 ` [ 08/69] drm/nouveau: determine a value for display_info.bpc if edid doesnt Ben Hutchings
2012-06-17 17:59 ` [ 09/69] drm/nouveau: default to 8bpc for non-LVDS panels if EDID isnt useful Ben Hutchings
2012-06-17 17:59 ` [ 10/69] drm/nouveau/disp: fix dithering not being enabled on some eDP macbooks Ben Hutchings
2012-06-17 17:59 ` [ 11/69] fuse: fix stat call on 32 bit platforms Ben Hutchings
2012-06-17 17:59 ` [ 12/69] x86, MCE, AMD: Make APIC LVT thresholding interrupt optional Ben Hutchings
2012-06-17 17:59 ` [ 13/69] x86/amd: Re-enable CPU topology extensions in case BIOS has disabled it Ben Hutchings
2012-06-17 17:59 ` [ 14/69] hwmon: (fam15h_power) Increase output resolution Ben Hutchings
2012-06-17 17:59 ` [ 15/69] sched: Fix the relax_domain_level boot parameter Ben Hutchings
2012-06-17 17:59 ` [ 16/69] iwlwifi: dont mess up the SCD when removing a key Ben Hutchings
2012-06-17 17:59 ` [ 17/69] hwrng: atmel-rng - fix race condition leading to repeated bits Ben Hutchings
2012-06-17 17:59   ` Ben Hutchings
2012-06-17 17:59 ` [ 18/69] crypto: aesni-intel - fix unaligned cbc decrypt for x86-32 Ben Hutchings
2012-06-17 17:59   ` Ben Hutchings
2012-06-17 18:00 ` [ 19/69] xen/setup: filter APERFMPERF cpuid feature out Ben Hutchings
2012-06-17 18:00 ` [ 20/69] NFSv4.1: Fix a request leak on the back channel Ben Hutchings
2012-06-17 18:00 ` [ 21/69] can: c_can: fix "BUG! echo_skb is occupied!" during transmit Ben Hutchings
2012-06-17 18:00 ` [ 22/69] can: c_can: fix an interrupt thrash issue with c_can driver Ben Hutchings
2012-06-17 18:00 ` [ 23/69] can: c_can: fix race condition in c_can_open() Ben Hutchings
2012-06-17 18:00 ` [ 24/69] ARM i.MX53: Fix PLL4 base address Ben Hutchings
2012-06-17 18:00 ` [ 25/69] usb: musb_gadget: fix crash caused by dangling pointer Ben Hutchings
2012-06-17 18:00 ` [ 26/69] mac80211: clean up remain-on-channel on interface stop Ben Hutchings
2012-06-17 18:00 ` [ 27/69] rt2x00: use atomic variable for seqno Ben Hutchings
2012-06-17 18:00 ` [ 28/69] iwlwifi: disable WoWLAN if !CONFIG_PM_SLEEP Ben Hutchings
2012-06-17 18:00 ` [ 29/69] ASoC: wm8994: Ensure all AIFnCLK events are run from the _late variants Ben Hutchings
2012-06-17 18:00 ` [ 30/69] ASoC: wm8994: Apply volume updates with clocks enabled Ben Hutchings
2012-06-17 18:00 ` [ 31/69] iwlwifi: unregister LEDs if mac80211 registration fails Ben Hutchings
2012-06-17 18:00 ` [ 32/69] cfg80211: fix interface combinations check Ben Hutchings
2012-06-17 18:00 ` [ 33/69] [SCSI] mpt2sas: Fix unsafe using smp_processor_id() in preemptible Ben Hutchings
2012-06-17 18:00 ` [ 34/69] net: sierra_net: device IDs for Aircard 320U++ Ben Hutchings
2012-06-17 18:00 ` [ 35/69] ARM: imx6: exit coherency when shutting down a cpu Ben Hutchings
2012-06-17 18:00 ` [ 36/69] ARM i.MX imx21ads: Fix overlapping static i/o mappings Ben Hutchings
2012-06-17 18:00 ` [ 37/69] NFSv4: Fix unnecessary delegation returns in nfs4_do_open Ben Hutchings
2012-06-17 18:00 ` [ 38/69] iwlwifi: use correct supported firmware for 6035 and 6000g2 Ben Hutchings
2012-06-17 18:00 ` [ 39/69] iwlwifi: disable the buggy chain extension feature in HW Ben Hutchings
2012-06-18 19:18   ` Herton Ronaldo Krzesinski
2012-06-18 19:23     ` Grumbach, Emmanuel
2012-06-19  3:57       ` Ben Hutchings
2012-06-17 18:00 ` [ 40/69] ALSA: hda - Add codec->no_jack_detect flag Ben Hutchings
2012-06-17 18:00 ` [ 41/69] ALSA: hda - add support for Uniwill ECS M31EI notebook Ben Hutchings
2012-06-17 18:00 ` [ 42/69] ALSA: hda - Suppress auto-mute feature on some machines with ALC861 Ben Hutchings
2012-06-17 18:00 ` [ 43/69] ALSA: hda - Add another jack-detection suppression for ASUS ALC892 Ben Hutchings
2012-06-17 18:00 ` [ 44/69] ALSA: HDA: Pin fixup for Zotac Z68 motherboard Ben Hutchings
2012-06-17 18:00 ` [ 45/69] usb: cdc-wdm: Add device-id for Huawei 3G/LTE modems Ben Hutchings
2012-06-17 20:51   ` Bjørn Mork
2012-06-17 22:51     ` Ben Hutchings
2012-06-17 18:00 ` [ 46/69] USB: cdc-wdm: Add Vodafone/Huawei K5005 support Ben Hutchings
2012-06-17 20:50   ` Bjørn Mork
2012-06-17 18:00 ` [ 47/69] USB: option: " Ben Hutchings
2012-06-17 18:00 ` [ 48/69] USB: qcserial: Add Sierra Wireless device IDs Ben Hutchings
2012-06-17 18:00 ` [ 49/69] USB: ftdi-sio: Add support for RT Systems USB-RTS01 serial adapter Ben Hutchings
2012-06-17 18:00 ` [ 50/69] USB: serial: cp210x: add Optris MS Pro usb id Ben Hutchings
2012-06-17 18:00 ` [ 51/69] USB: serial: sierra: Add support for Sierra Wireless AirCard 320U modem Ben Hutchings
2012-06-17 18:00 ` [ 52/69] USB: option: Updated Huawei K4605 has better id Ben Hutchings
2012-06-17 18:00 ` [ 53/69] USB: mct_u232: Fix incorrect TIOCMSET return Ben Hutchings
2012-06-17 18:00 ` Ben Hutchings [this message]
2012-06-17 18:00 ` [ 55/69] USB: option: fix memory leak Ben Hutchings
2012-06-17 18:00 ` [ 56/69] USB: option: add more YUGA device ids Ben Hutchings
2012-06-17 18:00 ` [ 57/69] target: Return error to initiator if SET TARGET PORT GROUPS emulation fails Ben Hutchings
2012-06-17 18:00 ` [ 58/69] USB: add NO_D3_DURING_SLEEP flag and revert 151b61284776be2 Ben Hutchings
2012-06-17 18:00 ` [ 59/69] USB: serial: Enforce USB driver and USB serial driver match Ben Hutchings
2012-06-17 18:00 ` [ 60/69] usb-storage: Add 090c:1000 to unusal-devs Ben Hutchings
2012-06-18  8:39   ` Hans de Goede
2012-06-18  9:14     ` Simon Raffeiner
2012-06-18 13:38       ` Ben Hutchings
2012-06-17 18:00 ` [ 61/69] xhci: Fix invalid loop check in xhci_free_tt_info() Ben Hutchings
2012-06-17 18:00 ` [ 62/69] xhci: Dont free endpoints in xhci_mem_cleanup() Ben Hutchings
2012-06-17 18:00 ` [ 63/69] xHCI: Increase the timeout for controller save/restore state operation Ben Hutchings
2012-06-17 18:00 ` [ 64/69] usb: PS3 EHCI QH read work-around Ben Hutchings
2012-06-17 18:00 ` [ 65/69] USB: fix PS3 EHCI systems Ben Hutchings
2012-06-17 18:00 ` [ 66/69] usb: cdc-acm: fix devices not unthrottled on open Ben Hutchings
2012-06-17 18:00 ` [ 67/69] USB: fix gathering of interface associations Ben Hutchings
2012-06-17 18:00 ` [ 68/69] swap: fix shmem swapping when more than 8 areas Ben Hutchings
2012-06-17 18:00 ` [ 69/69] drm/radeon: add some additional 6xx/7xx/EG register init Ben Hutchings
2012-06-17 18:48 ` [ 00/69] 3.2.21-stable review Ben Hutchings

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=20120617175949.130460490@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhovold@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.