3.0.70-stable review
Subsystems (32)
Greg Kroah-Hartman
maintainercover 3.0.70-stable review
This is the start of the stable review cycle for the 3.0.70 release. There are 40 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Mar 20 21:10:06 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.70-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.0.70-rc1
Mathias Krause <[email protected]>
dcbnl: fix various netlink info leaks
Mathias Krause <[email protected]>
rtnl: fix info leak on RTM_GETLINK request for VF devices
Hannes Frederic Sowa <[email protected]>
ipv6: stop multicast forwarding to process interface scoped addresses
Cristian Bercaru <[email protected]>
bridging: fix rx_handlers return code
Paul Moore <[email protected]>
netlabel: correctly list all the static label mappings
Eric Dumazet <[email protected]>
tun: add a missing nf_reset() in tun_net_xmit()
Neal Cardwell <[email protected]>
tcp: fix double-counted receiver RTT when leaving receiver fast path
Lorenzo Colitti <[email protected]>
net: ipv6: Don't purge default router if accept_ra=2
Cong Wang <[email protected]>
rds: limit the size allocated by rds_message_alloc()
Guillaume Nault <[email protected]>
l2tp: Restore socket refcount when sendmsg succeeds
Guo Chao <[email protected]>
loopdev: fix a deadlock
Guo Chao <[email protected]>
block: use i_size_write() in bd_set_size()
Ben Hutchings <[email protected]>
hwmon: (sht15) Fix memory leak if regulator_enable() fails
Dmitry Rogozhkin <[email protected]>
drm/i915: EBUSY status handling added to i915_gem_fault().
Eric Sandeen <[email protected]>
btrfs: use rcu_barrier() to wait for bdev puts at unmount
Heiko Carstens <[email protected]>
s390/mm: fix flush_tlb_kernel_range()
David Rientjes <[email protected]>
perf,x86: fix link failure for non-Intel configs
Linus Torvalds <[email protected]>
perf,x86: fix wrmsr_on_cpu() warning on suspend/resume
Stephane Eranian <[email protected]>
perf,x86: fix kernel crash with PEBS/BTS after suspend/resume
Dan Carpenter <[email protected]>
selinux: use GFP_ATOMIC under spin_lock
Benjamin Herrenschmidt <[email protected]>
powerpc: Fix cputable entry for 970MP rev 1.0
Marcin Jurkowski <[email protected]>
w1: fix oops when w1_search is called from netlink connector
Axel Lin <[email protected]>
hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes
Takashi Iwai <[email protected]>
ALSA: seq: Fix missing error handling in snd_seq_timer_open()
Greg Kroah-Hartman <[email protected]>
Revert duplicated perf commit.
Sebastian Riemer <[email protected]>
md: protect against crash upon fsync on ro array
Jiri Slaby <[email protected]>
TTY: do not reset master's packet mode
Paul Bolle <[email protected]>
tty: serial: fix typo "ARCH_S5P6450"
Lars-Peter Clausen <[email protected]>
ext3: Fix format string issues
Kees Cook <[email protected]>
signal: always clear sa_restorer on execve
Malcolm Priestley <[email protected]>
staging: vt6656: Fix oops on resume from suspend.
Alan Stern <[email protected]>
USB: EHCI: don't check DMA values in QH overlays
Bjørn Mork <[email protected]>
USB: storage: fix Huawei mode switching regression
Steve Conklin <[email protected]>
usb: serial: Add Rigblaster Advantage to device table
Christian Schmiedl <[email protected]>
USB: added support for Cinterion's products AH6 and PLS8
Matwey V. Kornilov <[email protected]>
usb: cp210x new Vendor/Device IDs
Oliver Neukum <[email protected]>
USB: cdc-wdm: fix buffer overflow
Bjørn Mork <[email protected]>
USB: option: add Huawei E5331
Amit Shah <[email protected]>
virtio: rng: disallow multiple device registrations, fixes crashes
Dan Williams <[email protected]>
qcaux: add Franklin U600
-------------
Diffstat:
Makefile | 4 +- arch/powerpc/kernel/cputable.c | 2 +- arch/s390/include/asm/tlbflush.h | 2 - arch/x86/kernel/cpu/perf_event_intel_ds.c | 10 + arch/x86/power/cpu.c | 2 + drivers/block/loop.c | 2 - drivers/char/hw_random/virtio-rng.c | 13 +- drivers/gpu/drm/i915/i915_gem.c | 5 + drivers/hwmon/lineage-pem.c | 2 + drivers/hwmon/sht15.c | 2 +- drivers/md/md.c | 4 + drivers/net/tun.c | 2 + drivers/staging/vt6656/main_usb.c | 4 - drivers/tty/pty.c | 1 - drivers/tty/serial/Kconfig | 2 +- drivers/usb/class/cdc-wdm.c | 23 ++- drivers/usb/host/ehci-q.c | 18 +- drivers/usb/serial/cp210x.c | 20 ++ drivers/usb/serial/option.c | 5 + drivers/usb/serial/qcaux.c | 1 + drivers/usb/storage/initializers.c | 76 +------ drivers/usb/storage/initializers.h | 4 +- drivers/usb/storage/unusual_devs.h | 329 +++++++++++++++++++++++++++++- drivers/w1/w1.c | 3 +- fs/block_dev.c | 4 +- fs/btrfs/volumes.c | 6 + fs/ext3/super.c | 4 +- include/linux/perf_event.h | 6 + kernel/signal.c | 3 + net/core/dev.c | 1 + net/core/rtnetlink.c | 1 + net/dcb/dcbnl.c | 7 + net/ipv4/tcp_input.c | 6 +- net/ipv6/ip6_input.c | 3 +- net/ipv6/route.c | 3 +- net/l2tp/l2tp_ppp.c | 1 + net/netlabel/netlabel_unlabeled.c | 27 +-- net/rds/message.c | 3 + security/selinux/xfrm.c | 2 +- sound/core/seq/seq_timer.c | 8 +- tools/perf/util/trace-event-parse.c | 2 - 41 files changed, 489 insertions(+), 134 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/40 qcaux: add Franklin U600
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit 2d90e63603ac235aecd7d20e234616e0682c8b1f upstream.
4 ports; AT/PPP is standard CDC-ACM. The other three (added by this patch) are QCDM/DIAG, possibly GPS, and unknown.
--- drivers/usb/serial/qcaux.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/qcaux.c +1 -0
@@ -69,6 +69,7 @@ static struct usb_device_id id_table[] = { USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xfd, 0xff) }, /* NMEA */ { USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xfe, 0xff) }, /* WMC */ { USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xff, 0xff) }, /* DIAG */ + { USB_DEVICE_AND_INTERFACE_INFO(0x1fac, 0x0151, 0xff, 0xff, 0xff) }, { }, };MODULE_DEVICE_TABLE (usb, id_table);
Greg Kroah-Hartman
maintainerPATCH 2/40 virtio: rng: disallow multiple device registrations, fixes crashes
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Shah <[email protected]>
commit e84e7a56a3aa2963db506299e29a5f3f09377f9b upstream.
The code currently only supports one virtio-rng device at a time. Invoking guests with multiple devices causes the guest to blow up.
Check if we've already registered and initialised the driver. Also cleanup in case of registration errors or hot-unplug so that a new device can be used.
--- drivers/char/hw_random/virtio-rng.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/char/hw_random/virtio-rng.c +11 -2
@@ -88,14 +88,22 @@ static int virtrng_probe(struct virtio_d {int err; +if (vq) { +/* We only support one device for now */ +return -EBUSY ; + }/* We expect a single virtqueue. */ vq =virtio_find_single_vq (vdev, random_recv_done,"input" ); -if (IS_ERR (vq)) -return PTR_ERR (vq); +if (IS_ERR (vq)) { + err =PTR_ERR (vq); + vq =NULL ; +return err; + } err =hwrng_register (&virtio_hwrng);if (err) { vdev->config->del_vqs (vdev); + vq =NULL ;return err; }
@@ -107,6 +115,7 @@ static void __devexit virtrng_remove(str vdev->config->reset (vdev);hwrng_unregister (&virtio_hwrng); vdev->config->del_vqs (vdev); + vq =NULL ; }static struct virtio_device_id id_table[] = {
Greg Kroah-Hartman
maintainerPATCH 3/40 USB: option: add Huawei E5331
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit daec90e7382cbd0e73eb6861109b3da91e5ab1f3 upstream.
Another device using CDC ACM with vendor specific protocol to mark serial functions.
--- drivers/usb/serial/option.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/option.c +1 -0
@@ -579,6 +579,7 @@ static const struct usb_device_id option { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c05, USB_CLASS_COMM, 0x02, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c1f, USB_CLASS_COMM, 0x02, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
Greg Kroah-Hartman
maintainerPATCH 4/40 USB: cdc-wdm: fix buffer overflow
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit c0f5ecee4e741667b2493c742b60b6218d40b3aa upstream.
The buffer for responses must not overflow.
If this would happen, set a flag, drop the data and return an error after user space has read all remaining data.
--- drivers/usb/class/cdc-wdm.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
drivers/usb/class/cdc-wdm.c +20 -3
@@ -54,6 +54,7 @@ MODULE_DEVICE_TABLE (usb, wdm_ids);#define WDM_POLL_RUNNING 6#define WDM_RESPONDING 7#define WDM_SUSPENDING 8 +#define WDM_OVERFLOW 10#define WDM_MAX 16
@@ -118,6 +119,7 @@ static void wdm_in_callback(struct urb * {struct wdm_device *desc = urb->context;int status = urb->status; +int length = urb->actual_length;spin_lock (&desc->iuspin);clear_bit (WDM_RESPONDING , &desc->flags);
@@ -148,9 +150,17 @@ static void wdm_in_callback(struct urb * } desc->rerr = status; - desc->reslength = urb->actual_length; -memmove (desc->ubuf + desc->length, desc->inbuf, desc->reslength); - desc->length += desc->reslength; +if (length + desc->length > desc->wMaxCommand) { +/* The buffer would overflow */ +set_bit (WDM_OVERFLOW , &desc->flags); + }else { +/* we may already be in overflow */ +if (!test_bit (WDM_OVERFLOW , &desc->flags)) { +memmove (desc->ubuf + desc->length, desc->inbuf, length); + desc->length += length; + desc->reslength = length; + } + } skip_error:wake_up (&desc->wait);
@@ -417,6 +427,11 @@ retry: rv = -ENODEV ; goto err; } +if (test_bit (WDM_OVERFLOW , &desc->flags)) { +clear_bit (WDM_OVERFLOW , &desc->flags); + rv = -ENOBUFS ; + goto err; + } i++;if (file->f_flags &O_NONBLOCK ) {if (!test_bit (WDM_READ , &desc->flags)) {
@@ -456,6 +471,7 @@ retry:spin_unlock_irq (&desc->iuspin); goto retry; } +if (!desc->reslength) {/* zero length read */ dev_dbg (&desc->intf->dev,"%s: zero length - clearing WDM_READ\n" , __func__);clear_bit (WDM_READ , &desc->flags);
@@ -901,6 +917,7 @@ static int wdm_post_reset(struct usb_intstruct wdm_device *desc =usb_get_intfdata (intf);int rv; +clear_bit (WDM_OVERFLOW , &desc->flags); rv =recover_from_urb_loss (desc);mutex_unlock (&desc->wlock);mutex_unlock (&desc->rlock);
Greg Kroah-Hartman
maintainerPATCH 5/40 usb: cp210x new Vendor/Device IDs
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Matwey V. Kornilov" <[email protected]>
commit be3101c23394af59694c8a2aae6d07f5da62fea5 upstream.
This patch adds support for the Lake Shore Cryotronics devices to the CP210x driver.
These lines are ported from cp210x driver distributed by Lake Shore web site:
http://www.lakeshore.com/Documents/Lake%20Shore%20cp210x-3.0.0.tar.gz
and licensed under the terms of GPLv2.
Moreover, I've tested this changes with Lake Shore 335 in my labs.
--- drivers/usb/serial/cp210x.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/usb/serial/cp210x.c +19 -0
@@ -156,6 +156,25 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */ + { USB_DEVICE(0x1FB9, 0x0100) }, /* Lake Shore Model 121 Current Source */ + { USB_DEVICE(0x1FB9, 0x0200) }, /* Lake Shore Model 218A Temperature Monitor */ + { USB_DEVICE(0x1FB9, 0x0201) }, /* Lake Shore Model 219 Temperature Monitor */ + { USB_DEVICE(0x1FB9, 0x0202) }, /* Lake Shore Model 233 Temperature Transmitter */ + { USB_DEVICE(0x1FB9, 0x0203) }, /* Lake Shore Model 235 Temperature Transmitter */ + { USB_DEVICE(0x1FB9, 0x0300) }, /* Lake Shore Model 335 Temperature Controller */ + { USB_DEVICE(0x1FB9, 0x0301) }, /* Lake Shore Model 336 Temperature Controller */ + { USB_DEVICE(0x1FB9, 0x0302) }, /* Lake Shore Model 350 Temperature Controller */ + { USB_DEVICE(0x1FB9, 0x0303) }, /* Lake Shore Model 371 AC Bridge */ + { USB_DEVICE(0x1FB9, 0x0400) }, /* Lake Shore Model 411 Handheld Gaussmeter */ + { USB_DEVICE(0x1FB9, 0x0401) }, /* Lake Shore Model 425 Gaussmeter */ + { USB_DEVICE(0x1FB9, 0x0402) }, /* Lake Shore Model 455A Gaussmeter */ + { USB_DEVICE(0x1FB9, 0x0403) }, /* Lake Shore Model 475A Gaussmeter */ + { USB_DEVICE(0x1FB9, 0x0404) }, /* Lake Shore Model 465 Three Axis Gaussmeter */ + { USB_DEVICE(0x1FB9, 0x0600) }, /* Lake Shore Model 625A Superconducting MPS */ + { USB_DEVICE(0x1FB9, 0x0601) }, /* Lake Shore Model 642A Magnet Power Supply */ + { USB_DEVICE(0x1FB9, 0x0602) }, /* Lake Shore Model 648 Magnet Power Supply */ + { USB_DEVICE(0x1FB9, 0x0700) }, /* Lake Shore Model 737 VSM Controller */ + { USB_DEVICE(0x1FB9, 0x0701) }, /* Lake Shore Model 776 Hall Matrix */ { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */ { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */
Greg Kroah-Hartman
maintainerPATCH 6/40 USB: added support for Cinterions products AH6 and PLS8
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Schmiedl <[email protected]>
commit 1941138e1c024ecb5bd797d414928d3eb94d8662 upstream.
add support for Cinterion's products AH6 and PLS8 by adding Product IDs and USB_DEVICE tuples.
--- drivers/usb/serial/option.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/serial/option.c +4 -0
@@ -341,6 +341,8 @@ static void option_instat_callback(struc#define CINTERION_PRODUCT_EU3_E 0x0051#define CINTERION_PRODUCT_EU3_P 0x0052#define CINTERION_PRODUCT_PH8 0x0053 +#define CINTERION_PRODUCT_AH6 0x0055 +#define CINTERION_PRODUCT_PLS8 0x0060/* Olivetti products */ #define OLIVETTI_VENDOR_ID 0x0b3c
@@ -1261,6 +1263,8 @@ static const struct usb_device_id option { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AH6) }, + { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLS8) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) },
Greg Kroah-Hartman
maintainerPATCH 7/40 usb: serial: Add Rigblaster Advantage to device table
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steve Conklin <[email protected]>
commit a57e82a18779ab8a5e5a1f5841cef937cf578913 upstream.
The Rigblaster Advantage is an amateur radio interface sold by West Mountain Radio. It contains a cp210x serial interface but the device ID is not in the driver.
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -91,6 +91,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */ { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ + { USB_DEVICE(0x2405, 0x0003) }, /* West Mountain Radio RIGblaster Advantage */ { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */
Greg Kroah-Hartman
maintainerPATCH 8/40 USB: storage: fix Huawei mode switching regression
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit ab4b71644a26d1ab92b987b2fd30e17c25e89f85 upstream.
This reverts commit 200e0d99 ("USB: storage: optimize to match the Huawei USB storage devices and support new switch command" and the followup bugfix commit cd060956 ("USB: storage: properly handle the endian issues of idProduct").
The commit effectively added a large number of Huawei devices to the deprecated usb-storage mode switching logic. Many of these devices have been in use and supported by the userspace usb_modeswitch utility for years. Forcing the switching inside the kernel causes a number of regressions as a result of ignoring existing onfigurations, and also completely takes away the ability to configure mode switching per device/system/user.
Known regressions caused by this:
- Some of the devices support multiple modes, using different switching commands. There are existing configurations taking advantage of this.
- There is a real use case for disabling mode switching and instead mounting the exposed storage device. This becomes impossible with switching logic inside the usb-storage driver.
- At least on device fail as a result of the usb-storage switching command, becoming completely unswitchable. This is possibly a firmware bug, but still a regression because the device work as expected using usb_modeswitch defaults.
In-kernel mode switching was deprecated years ago with the development of the more user friendly userspace alternatives. The existing list of devices in usb-storage was only kept to prevent breaking already working systems. The long term plan is to remove the list, not to add to it. Ref:
http://permalink.gmane.org/gmane.linux.usb.general/28543
--- drivers/usb/storage/initializers.c | 76 -------- drivers/usb/storage/initializers.h | 4 drivers/usb/storage/unusual_devs.h | 329 ++++++++++++++++++++++++++++++++++++- 3 files changed, 331 insertions(+), 78 deletions(-)
drivers/usb/storage/initializers.c +2 -74
@@ -92,8 +92,8 @@ int usb_stor_ucr61s2b_init(struct us_datreturn 0 ; } -/* This places the HUAWEI usb dongles in multi-port mode */ -static int usb_stor_huawei_feature_init (struct us_data *us) +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_huawei_e220_init (struct us_data *us) {int result;
@@ -104,75 +104,3 @@ static int usb_stor_huawei_feature_init(US_DEBUGP ("Huawei mode set result is %d\n" , result);return 0 ; } - -/* -* It will send a scsi switch command called rewind' to huawei dongle. -* When the dongle receives this command at the first time, -* it will reboot immediately. After rebooted, it will ignore this command. -* So it is unnecessary to read its response. -*/ -static int usb_stor_huawei_scsi_init (struct us_data *us) -{ -int result =0 ; -int act_len =0 ; -struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf; -char rewind_cmd[] = {0x11 ,0x06 ,0x20 ,0x00 ,0x00 ,0x01 ,0x01 ,0x00 , -0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 }; - - bcbw->Signature =cpu_to_le32 (US_BULK_CB_SIGN ); - bcbw->Tag =0 ; - bcbw->DataTransferLength =0 ; - bcbw->Flags = bcbw->Lun =0 ; - bcbw->Length =sizeof (rewind_cmd); -memset (bcbw->CDB,0 ,sizeof (bcbw->CDB)); -memcpy (bcbw->CDB, rewind_cmd,sizeof (rewind_cmd)); - - result =usb_stor_bulk_transfer_buf (us, us->send_bulk_pipe, bcbw, -US_BULK_CB_WRAP_LEN , &act_len); -US_DEBUGP ("transfer actual length=%d, result=%d\n" , act_len, result); -return result; -} - -/* -* It tries to find the supported Huawei USB dongles. -* In Huawei, they assign the following product IDs -* for all of their mobile broadband dongles, -* including the new dongles in the future. -* So if the product ID is not included in this list, -* it means it is not Huawei's mobile broadband dongles. -*/ -static int usb_stor_huawei_dongles_pid (struct us_data *us) -{ -struct usb_interface_descriptor *idesc; -int idProduct; - - idesc = &us->pusb_intf->cur_altsetting->desc; - idProduct =le16_to_cpu (us->pusb_dev->descriptor.idProduct); -/* The first port is CDROM, -* means the dongle in the single port mode, -* and a switch command is required to be sent. */ -if (idesc && idesc->bInterfaceNumber ==0 ) { -if ((idProduct ==0x1001 ) - || (idProduct ==0x1003 ) - || (idProduct ==0x1004 ) - || (idProduct >=0x1401 && idProduct <=0x1500 ) - || (idProduct >=0x1505 && idProduct <=0x1600 ) - || (idProduct >=0x1c02 && idProduct <=0x2202 )) { -return 1 ; - } - } -return 0 ; -} - -int usb_stor_huawei_init (struct us_data *us) -{ -int result =0 ; - -if (usb_stor_huawei_dongles_pid (us)) { -if (le16_to_cpu (us->pusb_dev->descriptor.idProduct) >=0x1446 ) - result =usb_stor_huawei_scsi_init (us); -else - result =usb_stor_huawei_feature_init (us); - } -return result; -}
drivers/usb/storage/initializers.h +2 -2
@@ -46,5 +46,5 @@ int usb_stor_euscsi_init(struct us_data* flash reader */ int usb_stor_ucr61s2b_init (struct us_data *us); -/* This places the HUAWEI usb dongles in multi-port mode */ -int usb_stor_huawei_init (struct us_data *us); +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_huawei_e220_init (struct us_data *us);
drivers/usb/storage/unusual_devs.h +327 -2
337 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 9/40 USB: EHCI: dont check DMA values in QH overlays
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit feca7746d5d9e84b105a613b7f3b6ad00d327372 upstream.
This patch (as1661) fixes a rather obscure bug in ehci-hcd. In a couple of places, the driver compares the DMA address stored in a QH's overlay region with the address of a particular qTD, in order to see whether that qTD is the one currently being processed by the hardware. (If it is then the status in the QH's overlay region is more up-to-date than the status in the qTD, and if it isn't then the overlay's value needs to be adjusted when the QH is added back to the active schedule.)
However, DMA address in the overlay region isn't always valid. It sometimes will contain a stale value, which may happen by coincidence to be equal to a qTD's DMA address. Instead of checking the DMA address, we should check whether the overlay region is active and valid. The patch tests the ACTIVE bit in the overlay, and clears this bit when the overlay becomes invalid (which happens when the currently-executing URB is unlinked).
This is the second part of a fix for the regression reported at:
https://bugs.launchpad.net/bugs/1088733
--- drivers/usb/host/ehci-q.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/usb/host/ehci-q.c +13 -5
@@ -137,7 +137,7 @@ qh_refresh (struct ehci_hcd *ehci, struc* qtd is updated in qh_completions(). Update the QH * overlay here. */ -if (cpu_to_hc32 (ehci, qtd->qtd_dma) == qh->hw->hw_current) { +if (qh->hw->hw_token &ACTIVE_BIT (ehci)) { qh->hw->hw_qtd_next = qtd->hw_next; qtd =NULL ; }
@@ -450,11 +450,19 @@ qh_completions (struct ehci_hcd *ehci, selse if (last_status == -EINPROGRESS && !urb->unlinked)continue ; -/* qh unlinked; token in overlay may be most current */ -if (state ==QH_STATE_IDLE - &&cpu_to_hc32 (ehci, qtd->qtd_dma) - == hw->hw_current) { +/* +* If this was the active qtd when the qh was unlinked +* and the overlay's token is active, then the overlay +* hasn't been written back to the qtd yet so use its +* token instead of the qtd's. After the qtd is +* processed and removed, the overlay won't be valid +* any more. +*/ +if (state ==QH_STATE_IDLE && + qh->qtd_list.next == &qtd->qtd_list && + (hw->hw_token &ACTIVE_BIT (ehci))) { token =hc32_to_cpu (ehci, hw->hw_token); + hw->hw_token &= ~ACTIVE_BIT (ehci);/* An unlink may leave an incomplete * async transaction in the TT buffer.
Greg Kroah-Hartman
maintainerPATCH 10/40 staging: vt6656: Fix oops on resume from suspend.
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Malcolm Priestley <[email protected]>
commit 6987a6dabfc40222ef767f67b57212fe3a0225fb upstream.
Remove usb_put_dev from vt6656_suspend and usb_get_dev from vt6566_resume.
These are not normally in suspend/resume functions.
--- drivers/staging/vt6656/main_usb.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/staging/vt6656/main_usb.c +0 -4
@@ -725,8 +725,6 @@ static int vt6656_suspend(struct usb_intif (device->flags &DEVICE_FLAGS_OPENED )device_close (device->dev); -usb_put_dev (interface_to_usbdev (intf)); -return 0 ; }
@@ -737,8 +735,6 @@ static int vt6656_resume(struct usb_inteif (!device || !device->dev)return -ENODEV ; -usb_get_dev (interface_to_usbdev (intf)); -if (!(device->flags &DEVICE_FLAGS_OPENED ))device_open (device->dev);
Greg Kroah-Hartman
maintainerPATCH 11/40 signal: always clear sa_restorer on execve
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit 2ca39528c01a933f6689cd6505ce65bd6d68a530 upstream.
When the new signal handlers are set up, the location of sa_restorer is not cleared, leaking a parent process's address space location to children. This allows for a potential bypass of the parent's ASLR by examining the sa_restorer value returned when calling sigaction().
Based on what should be considered "secret" about addresses, it only matters across the exec not the fork (since the VMAs haven't changed until the exec). But since exec sets SIG_DFL and keeps sa_restorer, this is where it should be fixed.
Given the few uses of sa_restorer, a "set" function was not written since this would be the only use. Instead, we use __ARCH_HAS_SA_RESTORER, as already done in other places.
Example of the leak before applying this patch:
$ cat /proc/$$/maps ... 7fb9f3083000-7fb9f3238000 r-xp 00000000 fd:01 404469 .../libc-2.15.so ... $ ./leak ... 7f278bc74000-7f278be29000 r-xp 00000000 fd:01 404469 .../libc-2.15.so ... 1 0 (nil) 0x7fb9f30b94a0 2 4000000 (nil) 0x7f278bcaa4a0 3 4000000 (nil) 0x7f278bcaa4a0 4 0 (nil) 0x7fb9f30b94a0 ...
--- kernel/signal.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/signal.c +3 -0
@@ -437,6 +437,9 @@ flush_signal_handlers(struct task_structif (force_default || ka->sa.sa_handler !=SIG_IGN ) ka->sa.sa_handler =SIG_DFL ; ka->sa.sa_flags =0 ; +#ifdef SA_RESTORER + ka->sa.sa_restorer =NULL ; +#endif sigemptyset (&ka->sa.sa_mask); ka++; }
Greg Kroah-Hartman
maintainerPATCH 12/40 ext3: Fix format string issues
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
commit 8d0c2d10dd72c5292eda7a06231056a4c972e4cc upstream.
ext3_msg() takes the printk prefix as the second parameter and the format string as the third parameter. Two callers of ext3_msg omit the prefix and pass the format string as the second parameter and the first parameter to the format string as the third parameter. In both cases this string comes from an arbitrary source. Which means the string may contain format string characters, which will
lead to undefined and potentially harmful behavior.
The issue was introduced in commit 4cf46b67eb("ext3: Unify log messages in ext3") and is fixed by this patch.
--- fs/ext3/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext3/super.c +2 -2
@@ -371,7 +371,7 @@ static struct block_device *ext3_blkdev_return bdev; fail: -ext3_msg (sb,"error: failed to open journal device %s: %ld" , +ext3_msg (sb,KERN_ERR ,"error: failed to open journal device %s: %ld" ,__bdevname (dev, b),PTR_ERR (bdev));return NULL ;
@@ -892,7 +892,7 @@ static ext3_fsblk_t get_sb_block(void **/*todo: use simple_strtoll with >32bit ext3 */ sb_block =simple_strtoul (options, &options,0 );if (*options && *options !=',' ) { -ext3_msg (sb,"error: invalid sb specification: %s" , +ext3_msg (sb,KERN_ERR ,"error: invalid sb specification: %s" , (char *) *data);return 1 ; }
Greg Kroah-Hartman
maintainerPATCH 13/40 tty: serial: fix typo "ARCH_S5P6450"
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Bolle <[email protected]>
commit 827aa0d36d486f359808c8fb931cf7a71011a09d upstream.
This could have been either ARCH_S5P64X0 or CPU_S5P6450. Looking at commit 2555e663b367b8d555e76023f4de3f6338c28d6c ("ARM: S5P64X0: Add UART serial support for S5P6450") - which added this typo - makes clear this should be CPU_S5P6450.
--- drivers/tty/serial/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/Kconfig +1 -1
@@ -458,7 +458,7 @@ config SERIAL_SAMSUNG_UARTS int depends on ARM && PLAT_SAMSUNG default 2 if ARCH_S3C2400 - default 6 if ARCH_S5P6450 + default 6 if CPU_S5P6450 default 4 if SERIAL_SAMSUNG_UARTS_4 default 3 help
Greg Kroah-Hartman
maintainerPATCH 14/40 TTY: do not reset masters packet mode
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Slaby <[email protected]>
commit b81273a132177edd806476b953f6afeb17b786d5 upstream.
Now that login from util-linux is forced to drop all references to a TTY which it wants to hangup (to reach reference count 1) we are seeing issues with telnet. When login closes its last reference to the slave PTY, it also resets packet mode on the *master* side. And we have a race here.
What telnet does is fork+exec of `login'. Then there are two scenarios:
* `login' closes the slave TTY and resets thus master's packet mode, but even now telnet properly sets the mode, or
* telnetd' sets packet mode on the master, login' closes the slave TTY and resets master's packet mode.
The former case is OK. However the latter happens in much more cases, by the order of magnitude to be precise. So when one tries to login to such a messed telnet setup, they see the following:
inux login:
ogin incorrect
Note the missing first letters -- telnet thinks it is still in the packet mode, so when it receives "linux login" from `login', it considers "l" as the type of the packet and strips it.
SuS does not mention how the implementation should behave. Both BSDs I checked (Free and Net) do not reset the flag upon the last close.
By this I am resurrecting an old bug, see References. We are hitting it regularly now, i.e. with updated util-linux, ergo login.
Here, I am changing a behavior introduced back in 2.1 times. It would better have a long time testing before goes upstream.
References: https://lkml.org/lkml/2009/11/11/223
References: https://bugzilla.redhat.com/show_bug.cgi?id=504703
References: https://bugzilla.novell.com/show_bug.cgi?id=797042
--- drivers/tty/pty.c | 1 - 1 file changed, 1 deletion(-)
drivers/tty/pty.c +0 -1
@@ -49,7 +49,6 @@ static void pty_close(struct tty_struct tty->packet =0 ;if (!tty->link)return ; - tty->link->packet =0 ;set_bit (TTY_OTHER_CLOSED , &tty->link->flags);wake_up_interruptible (&tty->link->read_wait);wake_up_interruptible (&tty->link->write_wait);
Greg Kroah-Hartman
maintainerPATCH 15/40 md: protect against crash upon fsync on ro array
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Riemer <[email protected]>
commit bbfa57c0f2243a7c31fd248d22e9861a2802cad5 upstream.
If an fsync occurs on a read-only array, we need to send a completion for the IO and may not increment the active IO count. Otherwise, we hit a bug trace and can't stop the MD array anymore.
By advice of Christoph Hellwig we return success upon a flush request but we return -EROFS for other writes.
We detect flush requests by checking if the bio has zero sectors.
--- drivers/md/md.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/md/md.c +4 -0
@@ -299,6 +299,10 @@ static int md_make_request(struct requesbio_io_error (bio);return 0 ; } +if (mddev->ro ==1 &&unlikely (rw ==WRITE )) { +bio_endio (bio,bio_sectors (bio) ==0 ?0 : -EROFS ); +return 0 ; + }smp_rmb ();/* Ensure implications of 'active' are visible */ rcu_read_lock ();if (mddev->suspended) {
Greg Kroah-Hartman
maintainerPATCH 16/40 Revert duplicated perf commit.
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 2431496fbdd142ccc83138d94f3f510a36ce9270 as it was applied incorrectly twice.
Thanks to Jiri for pointing this out.
--- tools/perf/util/trace-event-parse.c | 2 -- 1 file changed, 2 deletions(-)
tools/perf/util/trace-event-parse.c +0 -2
@@ -1582,8 +1582,6 @@ process_symbols(struct event *event, str field =malloc_or_die (sizeof (*field)); type =process_arg (event, field, &token); -while (type ==EVENT_OP ) - type =process_op (event, field, &token);if (test_type_token (type, token,EVENT_DELIM ,"," )) goto out_free;
Re: [ 16/40] Revert duplicated perf commit.
Quoted 7 lines · Greg Kroah-Hartman
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit
2431496fbdd142ccc83138d94f3f510a36ce9270as it was applied incorrectly twice.
Quoted 6 lines
Thanks to Jiri for pointing this out.
Signed-off-by Greg Kroah-Hartman <[email protected]>Cc Jiri Slaby <[email protected]>Cc Andrew Vagin <[email protected]>Cc Steven Rostedt <[email protected]>
3.2.y had the same problem, so I'm making a similar revert there.
Ben.
Quoted 22 lines
--- tools/perf/util/trace-event-parse.c | 2 -- 1 file changed, 2 deletions(-)tools/perf/util/trace-event-parse.c +0
-3@@ -1582,8 +1582,6 @@ process_symbols(struct event *event, str field =malloc_or_die (sizeof (*field)); type =process_arg (event, field, &token); -while (type ==EVENT_OP ) - type =process_op (event, field, &token);if (test_type_token (type, token,EVENT_DELIM ,"," )) goto out_free; --To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Ben Hutchings It is easier to write an incorrect program than to understand a correct one.
Greg Kroah-Hartman
maintainerPATCH 17/40 ALSA: seq: Fix missing error handling in snd_seq_timer_open()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 66efdc71d95887b652a742a5dae51fa834d71465 upstream.
snd_seq_timer_open() didn't catch the whole error path but let through if the timer id is a slave. This may lead to Oops by accessing the uninitialized pointer.
BUG: unable to handle kernel NULL pointer dereference at 00000000000002ae IP: [<ffffffff819b3477>] snd_seq_timer_open+0xe7/0x130 PGD 785cd067 PUD 76964067 PMD 0 Oops: 0002 [#4] SMP CPU 0 Pid: 4288, comm: trinity-child7 Tainted: G D W 3.9.0-rc1+ #100 Bochs Bochs RIP: 0010:[<ffffffff819b3477>] [<ffffffff819b3477>] snd_seq_timer_open+0xe7/0x130 RSP: 0018:ffff88006ece7d38 EFLAGS: 00010246 RAX: 0000000000000286 RBX: ffff88007851b400 RCX: 0000000000000000 RDX: 000000000000ffff RSI: ffff88006ece7d58 RDI: ffff88006ece7d38 RBP: ffff88006ece7d98 R08: 000000000000000a R09: 000000000000fffe R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: ffff8800792c5400 R14: 0000000000e8f000 R15: 0000000000000007 FS: 00007f7aaa650700(0000) GS:ffff88007f800000(0000) GS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000002ae CR3: 000000006efec000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process trinity-child7 (pid: 4288, threadinfo ffff88006ece6000, task ffff880076a8a290) Stack: 0000000000000286 ffffffff828f2be0 ffff88006ece7d58 ffffffff810f354d 65636e6575716573 2065756575712072 ffff8800792c0030 0000000000000000 ffff88006ece7d98 ffff8800792c5400 ffff88007851b400 ffff8800792c5520 Call Trace: [<ffffffff810f354d>] ? trace_hardirqs_on+0xd/0x10 [<ffffffff819b17e9>] snd_seq_queue_timer_open+0x29/0x70 [<ffffffff819ae01a>] snd_seq_ioctl_set_queue_timer+0xda/0x120 [<ffffffff819acb9b>] snd_seq_do_ioctl+0x9b/0xd0 [<ffffffff819acbe0>] snd_seq_ioctl+0x10/0x20 [<ffffffff811b9542>] do_vfs_ioctl+0x522/0x570 [<ffffffff8130a4b3>] ? file_has_perm+0x83/0xa0 [<ffffffff810f354d>] ? trace_hardirqs_on+0xd/0x10 [<ffffffff811b95ed>] sys_ioctl+0x5d/0xa0 [<ffffffff813663fe>] ? trace_hardirqs_on_thunk+0x3a/0x3f [<ffffffff81faed69>] system_call_fastpath+0x16/0x1b
--- sound/core/seq/seq_timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/core/seq/seq_timer.c +4 -4
@@ -290,10 +290,10 @@ int snd_seq_timer_open(struct snd_seq_qu tid.device =SNDRV_TIMER_GLOBAL_SYSTEM ; err =snd_timer_open (&t, str, &tid, q->queue); } -if (err <0 ) { -snd_printk (KERN_ERR "seq fatal error: cannot create timer (%i)\n" , err); -return err; - } + } +if (err <0 ) { +snd_printk (KERN_ERR "seq fatal error: cannot create timer (%i)\n" , err); +return err; } t->callback = snd_seq_timer_interrupt; t->callback_data = q;
Greg Kroah-Hartman
maintainerPATCH 18/40 hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Axel Lin <[email protected]>
commit df069079c153d22adf6c28dcc0b1cf62bba75167 upstream.
--- drivers/hwmon/lineage-pem.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hwmon/lineage-pem.c +2 -0
@@ -421,6 +421,7 @@ static struct attribute *pem_input_attri &sensor_dev_attr_in2_input.dev_attr.attr, &sensor_dev_attr_curr1_input.dev_attr.attr, &sensor_dev_attr_power1_input.dev_attr.attr, +NULL }; static const struct attribute_group pem_input_group = {
@@ -431,6 +432,7 @@ static struct attribute *pem_fan_attribu &sensor_dev_attr_fan1_input.dev_attr.attr, &sensor_dev_attr_fan2_input.dev_attr.attr, &sensor_dev_attr_fan3_input.dev_attr.attr, +NULL }; static const struct attribute_group pem_fan_group = {
Greg Kroah-Hartman
maintainerPATCH 19/40 w1: fix oops when w1_search is called from netlink connector
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Jurkowski <[email protected]>
commit 9d1817cab2f030f6af360e961cc69bb1da8ad765 upstream.
Quoted 5 lines · Sven Geggus
This is the bad commit I found doing git bisect:
04f482faf50535229a5a5c8d629cf963899f857cis the first bad commit commit04f482faf50535229a5a5c8d629cf963899f857cAuthor: Patrick McHardy <[email protected]> Date: Mon Mar 28 08:39:36 2011 +0000
Good job. I was too lazy to bisect for bad commit;)
Reading the code I found problematic kthread_should_stop call from netlink connector which causes the oops. After applying a patch, I've been testing owfs+w1 setup for nearly two days and it seems to work very reliable (no hangs, no memleaks etc).
More detailed description and possible fix is given below:
Function w1_search can be called from either kthread or netlink callback. While the former works fine, the latter causes oops due to kthread_should_stop invocation.
This patch adds a check if w1_search is serving netlink command, skipping kthread_should_stop invocation if so.
--- drivers/w1/w1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/w1/w1.c +2 -1
@@ -918,7 +918,8 @@ void w1_search(struct w1_master *dev, u8 tmp64 = (triplet_ret >>2 ); rn |= (tmp64 << i); -if (kthread_should_stop ()) { +/* ensure we're called from kthread and not by netlink callback */ +if (!dev->priv &&kthread_should_stop ()) {dev_dbg (&dev->dev,"Abort w1_search\n" );return ; }
Greg Kroah-Hartman
maintainerPATCH 20/40 powerpc: Fix cputable entry for 970MP rev 1.0
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Herrenschmidt <[email protected]>
commit d63ac5f6cf31c8a83170a9509b350c1489a7262b upstream.
Commit 44ae3ab3358e962039c36ad4ae461ae9fb29596c forgot to update the entry for the 970MP rev 1.0 processor when moving some CPU features bits to the MMU feature bit mask. This breaks booting on some rare G5 models using that chip revision.
--- arch/powerpc/kernel/cputable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/cputable.c +1 -1
@@ -268,7 +268,7 @@ static struct cpu_spec __initdata cpu_sp .cpu_features = CPU_FTRS_PPC970, .cpu_user_features =COMMON_USER_POWER4 | PPC_FEATURE_HAS_ALTIVEC_COMP, - .mmu_features = MMU_FTR_HPTE_TABLE, + .mmu_features = MMU_FTRS_PPC970, .icache_bsize = 128, .dcache_bsize = 128, .num_pmcs = 8,
Greg Kroah-Hartman
maintainerPATCH 21/40 selinux: use GFP_ATOMIC under spin_lock
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 4502403dcf8f5c76abd4dbab8726c8e4ecb5cd34 upstream.
The call tree here is:
sk_clone_lock() <- takes bh_lock_sock(newsk);xfrm_sk_clone_policy()__xfrm_sk_clone_policy()clone_policy() <- uses GFP_ATOMIC for allocationssecurity_xfrm_policy_clone()security_ops->xfrm_policy_clone_security()selinux_xfrm_policy_clone()
--- security/selinux/xfrm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/xfrm.c +1 -1
@@ -310,7 +310,7 @@ int selinux_xfrm_policy_clone(struct xfrif (old_ctx) { new_ctx =kmalloc (sizeof (*old_ctx) + old_ctx->ctx_len, -GFP_KERNEL ); +GFP_ATOMIC );if (!new_ctx)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 22/40 perf,x86: fix kernel crash with PEBS/BTS after suspend/resume
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephane Eranian <[email protected]>
commit 1d9d8639c063caf6efc2447f5f26aa637f844ff6 upstream.
This patch fixes a kernel crash when using precise sampling (PEBS) after a suspend/resume. Turns out the CPU notifier code is not invoked on CPU0 (BP). Therefore, the DS_AREA (used by PEBS) is not restored properly by the kernel and keeps it power-on/resume value of 0 causing any PEBS measurement to crash when running on CPU0.
The workaround is to add a hook in the actual resume code to restore the DS Area MSR value. It is invoked for all CPUS. So for all but CPU0, the DS_AREA will be restored twice but this is harmless.
--- arch/x86/kernel/cpu/perf_event_intel_ds.c | 8 ++++++++ arch/x86/power/cpu.c | 2 ++ include/linux/perf_event.h | 2 ++ 3 files changed, 12 insertions(+)
arch/x86/kernel/cpu/perf_event_intel_ds.c +8 -0
@@ -754,6 +754,14 @@ static void intel_ds_init(void) } } +void perf_restore_debug_store (void ) +{ +if (!x86_pmu.bts && !x86_pmu.pebs) +return ; + +init_debug_store_on_cpu (smp_processor_id ()); +} +#else /* CONFIG_CPU_SUP_INTEL */ static void reserve_ds_buffers (void )
arch/x86/power/cpu.c +2 -0
@@ -10,6 +10,7 @@#include <linux/suspend.h> #include <linux/smp.h> +#include <linux/perf_event.h> #include <asm/pgtable.h> #include <asm/proto.h>
@@ -224,6 +225,7 @@ static void __restore_processor_state(stdo_fpu_end ();mtrr_bp_restore (); +perf_restore_debug_store (); }/* Needed by apm.c */
include/linux/perf_event.h +2 -0
@@ -1153,6 +1153,7 @@ extern void perf_swevent_put_recursion_cextern void perf_event_enable (struct perf_event *event);extern void perf_event_disable (struct perf_event *event);extern void perf_event_task_tick (void ); +extern void perf_restore_debug_store (void );#else static inline void perf_event_task_sched_in (struct task_struct *task) { }
@@ -1187,6 +1188,7 @@ static inline void perf_swevent_put_recustatic inline void perf_event_enable (struct perf_event *event) { }static inline void perf_event_disable (struct perf_event *event) { }static inline void perf_event_task_tick (void ) { } +static inline void perf_restore_debug_store (void ) { }#endif #define perf_output_put (handle, x) perf_output_copy((handle), &(x), sizeof(x))
Greg Kroah-Hartman
maintainerPATCH 23/40 perf,x86: fix wrmsr_on_cpu() warning on suspend/resume
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 2a6e06b2aed6995af401dcd4feb5e79a0c7ea554 upstream.
Commit 1d9d8639c063 ("perf,x86: fix kernel crash with PEBS/BTS after suspend/resume") fixed a crash when doing PEBS performance profiling after resuming, but in using init_debug_store_on_cpu() to restore the DS_AREA mtrr it also resulted in a new WARN_ON() triggering.
init_debug_store_on_cpu() uses "wrmsr_on_cpu()", which in turn uses CPU cross-calls to do the MSR update. Which is not really valid at the early resume stage, and the warning is quite reasonable. Now, it all happens to _work_, for the simple reason that smp_call_function_single() ends up just doing the call directly on the CPU when the CPU number matches, but we really should just do the wrmsr() directly instead.
This duplicates the wrmsr() logic, but hopefully we can just remove the wrmsr_on_cpu() version eventually.
--- arch/x86/kernel/cpu/perf_event_intel_ds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_event_intel_ds.c +3 -1
@@ -756,10 +756,12 @@ static void intel_ds_init(void)void perf_restore_debug_store (void ) { +struct debug_store *ds =__this_cpu_read (cpu_hw_events.ds); +if (!x86_pmu.bts && !x86_pmu.pebs)return ; -init_debug_store_on_cpu (smp_processor_id ()); +wrmsrl (MSR_IA32_DS_AREA , (unsigned long )ds); }#else /* CONFIG_CPU_SUP_INTEL */
Greg Kroah-Hartman
maintainerPATCH 24/40 perf,x86: fix link failure for non-Intel configs
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Rientjes <[email protected]>
commit 6c4d3bc99b3341067775efd4d9d13cc8e655fd7c upstream.
Commit 1d9d8639c063 ("perf,x86: fix kernel crash with PEBS/BTS after suspend/resume") introduces a link failure since perf_restore_debug_store() is only defined for CONFIG_CPU_SUP_INTEL:
arch/x86/power/built-in.o: In function `restore_processor_state': (.text+0x45c): undefined reference to `perf_restore_debug_store'
Fix it by defining the dummy function appropriately.
--- include/linux/perf_event.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/linux/perf_event.h +5 -1
@@ -1153,7 +1153,6 @@ extern void perf_swevent_put_recursion_cextern void perf_event_enable (struct perf_event *event);extern void perf_event_disable (struct perf_event *event);extern void perf_event_task_tick (void ); -extern void perf_restore_debug_store (void );#else static inline void perf_event_task_sched_in (struct task_struct *task) { }
@@ -1188,6 +1187,11 @@ static inline void perf_swevent_put_recustatic inline void perf_event_enable (struct perf_event *event) { }static inline void perf_event_disable (struct perf_event *event) { }static inline void perf_event_task_tick (void ) { } +#endif + +#if defined(CONFIG_PERF_EVENTS ) && defined(CONFIG_CPU_SUP_INTEL ) +extern void perf_restore_debug_store (void ); +#else static inline void perf_restore_debug_store (void ) { }#endif
Greg Kroah-Hartman
maintainerPATCH 25/40 s390/mm: fix flush_tlb_kernel_range()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
commit f6a70a07079518280022286a1dceb797d12e1edf upstream.
Our flush_tlb_kernel_range() implementation calls __tlb_flush_mm() with &init_mm as argument. __tlb_flush_mm() however will only flush tlbs for the passed in mm if its mm_cpumask is not empty.
For the init_mm however its mm_cpumask has never any bits set. Which in turn means that our flush_tlb_kernel_range() implementation doesn't work at all.
This can be easily verified with a vmalloc/vfree loop which allocates a page, writes to it and then frees the page again. A crash will follow almost instantly.
To fix this remove the cpumask_empty() check in __tlb_flush_mm() since there shouldn't be too many mms with a zero mm_cpumask, besides the init_mm of course.
--- arch/s390/include/asm/tlbflush.h | 2 -- 1 file changed, 2 deletions(-)
arch/s390/include/asm/tlbflush.h +0 -2
@@ -73,8 +73,6 @@ static inline void __tlb_flush_idte(unsistatic inline void __tlb_flush_mm (struct mm_struct * mm) { -if (unlikely (cpumask_empty (mm_cpumask (mm)))) -return ;/* * If the machine has IDTE we prefer to do a per mm flush * on all cpus instead of doing a local flush if the mm
Greg Kroah-Hartman
maintainerPATCH 26/40 btrfs: use rcu_barrier() to wait for bdev puts at unmount
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <[email protected]>
commit bc178622d40d87e75abc131007342429c9b03351 upstream.
Doing this would reliably fail with -EBUSY for me:
# mount /dev/sdb2 /mnt/scratch; umount /mnt/scratch; mkfs.btrfs -f /dev/sdb2 ... unable to open /dev/sdb2: Device or resource busy
because mkfs.btrfs tries to open the device O_EXCL, and somebody still has it.
Using systemtap to track bdev gets & puts shows a kworker thread doing a blkdev put after mkfs attempts a get; this is left over from the unmount path:
btrfs_close_devices
__btrfs_close_devices call_rcu(&device->rcu, free_device); free_device INIT_WORK(&device->rcu_work, __free_device); schedule_work(&device->rcu_work);
so unmount might complete before __free_device fires & does its blkdev_put.
Adding an rcu_barrier() to btrfs_close_devices() causes unmount to wait until all blkdev_put()s are done, and the device is truly free once unmount completes.
--- fs/btrfs/volumes.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/btrfs/volumes.c +6 -0
@@ -546,6 +546,12 @@ int btrfs_close_devices(struct btrfs_fs___btrfs_close_devices (fs_devices);free_fs_devices (fs_devices); } +/* +* Wait for rcu kworkers under __btrfs_close_devices +* to finish all blkdev_puts so device is really +* free when umount is done. +*/ +rcu_barrier ();return ret; }
Greg Kroah-Hartman
maintainerPATCH 27/40 drm/i915: EBUSY status handling added to i915_gem_fault().
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Rogozhkin <[email protected]>
commit e79e0fe380847493266fba557217e2773c61bd1b upstream.
Subsequent threads returning EBUSY from vm_insert_pfn() was not handled correctly. As a result concurrent access from new threads to mmapped data caused SIGBUS.
Note that this fixes i-g-t/tests/gem_threaded_tiled_access.
--- drivers/gpu/drm/i915/i915_gem.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_gem.c +5 -0
@@ -1256,6 +1256,11 @@ out:case 0 :case -ERESTARTSYS :case -EINTR : +case -EBUSY : +/* +* EBUSY is ok: this just means that another thread +* already did the job. +*/ return VM_FAULT_NOPAGE ;case -ENOMEM :return VM_FAULT_OOM ;
Greg Kroah-Hartman
maintainerPATCH 28/40 hwmon: (sht15) Fix memory leak if regulator_enable() fails
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
Commit 3e78080f8148 ('hwmon: (sht15) Check return value of regulator_enable()') depends on the use of devm_kmalloc() for automatic resource cleanup in the failure cases, which was introduced in 3.7. In older stable branches, explicit cleanup is needed.
---
Applies to stable branches between 3.0 and 3.6 where commit 3e78080f8148 has been applied.
drivers/hwmon/sht15.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/sht15.c +1 -1
@@ -930,7 +930,7 @@ static int __devinit sht15_probe(structif (ret !=0 ) {dev_err (&pdev->dev,"failed to enable regulator: %d\n" , ret); -return ret; + goto err_free_data; }/*
Greg Kroah-Hartman
maintainerPATCH 29/40 block: use i_size_write() in bd_set_size()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guo Chao <[email protected]>
commit d646a02a9d44d1421f273ae3923d97b47b918176 upstream.
blkdev_ioctl(GETBLKSIZE) uses i_size_read() to read size of block device. If we update block size directly, reader may see intermediate result in some machines and configurations. Use i_size_write() instead.
--- fs/block_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/block_dev.c +3 -1
@@ -1052,7 +1052,9 @@ void bd_set_size(struct block_device *bd {unsigned bsize =bdev_logical_block_size (bdev); - bdev->bd_inode->i_size = size; +mutex_lock (&bdev->bd_inode->i_mutex); +i_size_write (bdev->bd_inode, size); +mutex_unlock (&bdev->bd_inode->i_mutex);while (bsize <PAGE_CACHE_SIZE ) {if (size & bsize)break ;
Greg Kroah-Hartman
maintainerPATCH 30/40 loopdev: fix a deadlock
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guo Chao <[email protected]>
commit 5370019dc2d2c2ff90e95d181468071362934f3a upstream.
bd_mutex and lo_ctl_mutex can be held in different order.
Path #1:
blkdev_open
blkdev_get
__blkdev_get (hold bd_mutex)
lo_open (hold lo_ctl_mutex)
Path #2:
blkdev_ioctl
lo_ioctl (hold lo_ctl_mutex)
lo_set_capacity (hold bd_mutex)
Lockdep does not report it, because path #2 actually holds a subclass of lo_ctl_mutex. This subclass seems creep into the code by mistake. The patch author actually just mentioned it in the changelog, see commit f028f3b2 ("loop: fix circular locking in loop_clr_fd()"), also see:
http://marc.info/?l=linux-kernel&m=123806169129727&w=2
Path #2 hold bd_mutex to call bd_set_size(), I've protected it with i_mutex in a previous patch, so drop bd_mutex at this site.
--- drivers/block/loop.c | 2 -- 1 file changed, 2 deletions(-)
drivers/block/loop.c +0 -2
@@ -1274,11 +1274,9 @@ static int loop_set_capacity(struct loop/* the width of sector_t may be narrow for bit-shift */ sz = sec; sz <<=9 ; -mutex_lock (&bdev->bd_mutex);bd_set_size (bdev, sz);/* let user-space know about the new size */ kobject_uevent (&disk_to_dev (bdev->bd_disk)->kobj,KOBJ_CHANGE ); -mutex_unlock (&bdev->bd_mutex); out:return err;
Greg Kroah-Hartman
maintainerPATCH 31/40 l2tp: Restore socket refcount when sendmsg succeeds
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
[ Upstream commit 8b82547e33e85fc24d4d172a93c796de1fefa81a ]
The sendmsg() syscall handler for PPPoL2TP doesn't decrease the socket reference counter after successful transmissions. Any successful sendmsg() call from userspace will then increase the reference counter forever, thus preventing the kernel's session and tunnel data from being freed later on.
The problem only happens when writing directly on L2TP sockets. PPP sockets attached to L2TP are unaffected as the PPP subsystem uses pppol2tp_xmit() which symmetrically increase/decrease reference counters.
This patch adds the missing call to sock_put() before returning from pppol2tp_sendmsg().
--- net/l2tp/l2tp_ppp.c | 1 + 1 file changed, 1 insertion(+)
net/l2tp/l2tp_ppp.c +1 -0
@@ -360,6 +360,7 @@ static int pppol2tp_sendmsg(struct kiocbl2tp_xmit_skb (session, skb, session->hdr_len);sock_put (ps->tunnel_sock); +sock_put (sk);return error;
Greg Kroah-Hartman
maintainerPATCH 32/40 rds: limit the size allocated by rds_message_alloc()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit ece6b0a2b25652d684a7ced4ae680a863af041e0 ]
Dave Jones reported the following bug:
"When fed mangled socket data, rds will trust what userspace gives it, and tries to allocate enormous amounts of memory larger than what kmalloc can satisfy."
WARNING: at mm/page_alloc.c:2393 __alloc_pages_nodemask+0xa0d/0xbe0() Hardware name: GA-MA78GM-S2H Modules linked in: vmw_vsock_vmci_transport vmw_vmci vsock fuse bnep dlci bridge 8021q garp stp mrp binfmt_misc l2tp_ppp l2tp_core rfcomm s Pid: 24652, comm: trinity-child2 Not tainted 3.8.0+ #65 Call Trace: [<ffffffff81044155>] warn_slowpath_common+0x75/0xa0 [<ffffffff8104419a>] warn_slowpath_null+0x1a/0x20 [<ffffffff811444ad>] __alloc_pages_nodemask+0xa0d/0xbe0 [<ffffffff8100a196>] ? native_sched_clock+0x26/0x90 [<ffffffff810b2128>] ? trace_hardirqs_off_caller+0x28/0xc0 [<ffffffff810b21cd>] ? trace_hardirqs_off+0xd/0x10 [<ffffffff811861f8>] alloc_pages_current+0xb8/0x180 [<ffffffff8113eaaa>] __get_free_pages+0x2a/0x80 [<ffffffff811934fe>] kmalloc_order_trace+0x3e/0x1a0 [<ffffffff81193955>] __kmalloc+0x2f5/0x3a0 [<ffffffff8104df0c>] ? local_bh_enable_ip+0x7c/0xf0 [<ffffffffa0401ab3>] rds_message_alloc+0x23/0xb0 [rds] [<ffffffffa04043a1>] rds_sendmsg+0x2b1/0x990 [rds] [<ffffffff810b21cd>] ? trace_hardirqs_off+0xd/0x10 [<ffffffff81564620>] sock_sendmsg+0xb0/0xe0 [<ffffffff810b2052>] ? get_lock_stats+0x22/0x70 [<ffffffff810b24be>] ? put_lock_stats.isra.23+0xe/0x40 [<ffffffff81567f30>] sys_sendto+0x130/0x180 [<ffffffff810b872d>] ? trace_hardirqs_on+0xd/0x10 [<ffffffff816c547b>] ? _raw_spin_unlock_irq+0x3b/0x60 [<ffffffff816cd767>] ? sysret_check+0x1b/0x56 [<ffffffff810b8695>] ? trace_hardirqs_on_caller+0x115/0x1a0 [<ffffffff81341d8e>] ? trace_hardirqs_on_thunk+0x3a/0x3f [<ffffffff816cd742>] system_call_fastpath+0x16/0x1b ---[ end trace eed6ae990d018c8b ]---
--- net/rds/message.c | 3 +++ 1 file changed, 3 insertions(+)
net/rds/message.c +3 -0
@@ -196,6 +196,9 @@ struct rds_message *rds_message_alloc(un {struct rds_message *rm; +if (extra_len >KMALLOC_MAX_SIZE -sizeof (struct rds_message )) +return NULL ; + rm =kzalloc (sizeof (struct rds_message ) + extra_len, gfp);if (!rm) goto out;
Greg Kroah-Hartman
maintainerPATCH 33/40 net: ipv6: Dont purge default router if accept_ra=2
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Colitti <[email protected]>
[ Upstream commit 3e8b0ac3e41e3c882222a5522d5df7212438ab51 ]
Setting net.ipv6.conf.<interface>.accept_ra=2 causes the kernel to accept RAs even when forwarding is enabled. However, enabling forwarding purges all default routes on the system, breaking connectivity until the next RA is received. Fix this by not purging default routes on interfaces that have accept_ra=2.
--- net/ipv6/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/route.c +2 -1
@@ -1885,7 +1885,8 @@ void rt6_purge_dflt_routers(struct net * restart:read_lock_bh (&table->tb6_lock);for (rt = table->tb6_root.leaf; rt; rt = rt->dst.rt6_next) { -if (rt->rt6i_flags & (RTF_DEFAULT |RTF_ADDRCONF )) { +if (rt->rt6i_flags & (RTF_DEFAULT |RTF_ADDRCONF ) && + (!rt->rt6i_idev || rt->rt6i_idev->cnf.accept_ra !=2 )) {dst_hold (&rt->dst);read_unlock_bh (&table->tb6_lock);ip6_del_rt (rt);
Greg Kroah-Hartman
maintainerPATCH 34/40 tcp: fix double-counted receiver RTT when leaving receiver fast path
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neal Cardwell <[email protected]>
[ Upstream commit aab2b4bf224ef8358d262f95b568b8ad0cecf0a0 ]
We should not update ts_recent and call tcp_rcv_rtt_measure_ts() both before and after going to step5. That wastes CPU and double-counts the receiver-side RTT sample.
--- net/ipv4/tcp_input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/ipv4/tcp_input.c +3 -3
@@ -5419,6 +5419,9 @@ int tcp_rcv_established(struct sock *sk,if (tcp_checksum_complete_user (sk, skb)) goto csum_error; +if ((int )skb->truesize > sk->sk_forward_alloc) + goto step5; +/* Predicted packet is in window by definition. * seq == rcv_nxt and rcv_wup <= rcv_nxt. * Hence, check seq<=rcv_wup reduces to:
@@ -5430,9 +5433,6 @@ int tcp_rcv_established(struct sock *sk,tcp_rcv_rtt_measure_ts (sk, skb); -if ((int )skb->truesize > sk->sk_forward_alloc) - goto step5; -NET_INC_STATS_BH (sock_net (sk),LINUX_MIB_TCPHPHITS );/* Bulk data transfer: receiver */
Greg Kroah-Hartman
maintainerPATCH 35/40 tun: add a missing nf_reset() in tun_net_xmit()
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit f8af75f3517a24838a36eb5797a1a3e60bf9e276 ]
Dave reported following crash :
general protection fault: 0000 [#1] SMP CPU 2 Pid: 25407, comm: qemu-kvm Not tainted 3.7.9-205.fc18.x86_64 #1 Hewlett-Packard HP Z400 Workstation/0B4Ch RIP: 0010:[<ffffffffa0399bd5>] [<ffffffffa0399bd5>] destroy_conntrack+0x35/0x120 [nf_conntrack] RSP: 0018:ffff880276913d78 EFLAGS: 00010206 RAX: 50626b6b7876376c RBX: ffff88026e530d68 RCX: ffff88028d158e00 RDX: ffff88026d0d5470 RSI: 0000000000000011 RDI: 0000000000000002 RBP: ffff880276913d88 R08: 0000000000000000 R09: ffff880295002900 R10: 0000000000000000 R11: 0000000000000003 R12: ffffffff81ca3b40 R13: ffffffff8151a8e0 R14: ffff880270875000 R15: 0000000000000002 FS: 00007ff3bce38a00(0000) GS:ffff88029fc40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 00007fd1430bd000 CR3: 000000027042b000 CR4: 00000000000027e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process qemu-kvm (pid: 25407, threadinfo ffff880276912000, task ffff88028c369720) Stack: ffff880156f59100 ffff880156f59100 ffff880276913d98 ffffffff815534f7 ffff880276913db8 ffffffff8151a74b ffff880270875000 ffff880156f59100 ffff880276913dd8 ffffffff8151a5a6 ffff880276913dd8 ffff88026d0d5470 Call Trace: [<ffffffff815534f7>] nf_conntrack_destroy+0x17/0x20 [<ffffffff8151a74b>] skb_release_head_state+0x7b/0x100 [<ffffffff8151a5a6>] __kfree_skb+0x16/0xa0 [<ffffffff8151a666>] kfree_skb+0x36/0xa0 [<ffffffff8151a8e0>] skb_queue_purge+0x20/0x40 [<ffffffffa02205f7>] __tun_detach+0x117/0x140 [tun] [<ffffffffa022184c>] tun_chr_close+0x3c/0xd0 [tun] [<ffffffff8119669c>] __fput+0xec/0x240 [<ffffffff811967fe>] ____fput+0xe/0x10 [<ffffffff8107eb27>] task_work_run+0xa7/0xe0 [<ffffffff810149e1>] do_notify_resume+0x71/0xb0 [<ffffffff81640152>] int_signal+0x12/0x17 Code: 00 00 04 48 89 e5 41 54 53 48 89 fb 4c 8b a7 e8 00 00 00 0f 85 de 00 00 00 0f b6 73 3e 0f b7 7b 2a e8 10 40 00 00 48 85 c0 74 0e <48> 8b 40 28 48 85 c0 74 05 48 89 df ff d0 48 c7 c7 08 6a 3a a0 RIP [<ffffffffa0399bd5>] destroy_conntrack+0x35/0x120 [nf_conntrack] RSP <ffff880276913d78>
This is because tun_net_xmit() needs to call nf_reset() before queuing skb into receive_queue
--- drivers/net/tun.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/tun.c +2 -0
@@ -417,6 +417,8 @@ static netdev_tx_t tun_net_xmit(struct s* for indefinite time. */ skb_orphan (skb); +nf_reset (skb); +/* Enqueue packet */ skb_queue_tail (&tun->socket.sk->sk_receive_queue, skb);
Greg Kroah-Hartman
maintainerPATCH 36/40 netlabel: correctly list all the static label mappings
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <[email protected]>
[ Upstream commits 0c1233aba1e948c37f6dc7620cb7c253fcd71ce9 and
a6a8fe950e1b8596bb06f2c89c3a1a4bf2011ba9 ]
When we have a large number of static label mappings that spill across the netlink message boundary we fail to properly save our state in the netlink_callback struct which causes us to repeat the same listings. This patch fixes this problem by saving the state correctly between calls to the NetLabel static label netlink "dumpit" routines.
--- net/netlabel/netlabel_unlabeled.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-)
net/netlabel/netlabel_unlabeled.c +11 -16
@@ -1192,8 +1192,6 @@ static int netlbl_unlabel_staticlist(strstruct netlbl_unlhsh_walk_arg cb_arg;u32 skip_bkt = cb->args[0 ];u32 skip_chain = cb->args[1 ]; -u32 skip_addr4 = cb->args[2 ]; -u32 skip_addr6 = cb->args[3 ];u32 iter_bkt;u32 iter_chain =0 , iter_addr4 =0 , iter_addr6 =0 ;struct netlbl_unlhsh_iface *iface;
@@ -1218,7 +1216,7 @@ static int netlbl_unlabel_staticlist(strcontinue ;netlbl_af4list_foreach_rcu (addr4, &iface->addr4_list) { -if (iter_addr4++ < skip_addr4) +if (iter_addr4++ < cb->args[2 ])continue ; if (netlbl_unlabel_staticlist_gen( NLBL_UNLABEL_C_STATICLIST,
@@ -1234,7 +1232,7 @@ static int netlbl_unlabel_staticlist(str#if defined(CONFIG_IPV6 ) || defined(CONFIG_IPV6_MODULE )netlbl_af6list_foreach_rcu (addr6, &iface->addr6_list) { -if (iter_addr6++ < skip_addr6) +if (iter_addr6++ < cb->args[3 ])continue ; if (netlbl_unlabel_staticlist_gen( NLBL_UNLABEL_C_STATICLIST,
@@ -1253,10 +1251,10 @@ static int netlbl_unlabel_staticlist(str unlabel_staticlist_return:rcu_read_unlock (); - cb->args[0 ] = skip_bkt; - cb->args[1 ] = skip_chain; - cb->args[2 ] = skip_addr4; - cb->args[3 ] = skip_addr6; + cb->args[0 ] = iter_bkt; + cb->args[1 ] = iter_chain; + cb->args[2 ] = iter_addr4; + cb->args[3 ] = iter_addr6;return skb->len; }
@@ -1276,12 +1274,9 @@ static int netlbl_unlabel_staticlistdef( {struct netlbl_unlhsh_walk_arg cb_arg;struct netlbl_unlhsh_iface *iface; -u32 skip_addr4 = cb->args[0 ]; -u32 skip_addr6 = cb->args[1 ]; -u32 iter_addr4 =0 ; +u32 iter_addr4 =0 , iter_addr6 =0 ;struct netlbl_af4list *addr4;#if defined(CONFIG_IPV6 ) || defined(CONFIG_IPV6_MODULE ) -u32 iter_addr6 =0 ;struct netlbl_af6list *addr6;#endif
@@ -1295,7 +1290,7 @@ static int netlbl_unlabel_staticlistdef( goto unlabel_staticlistdef_return; netlbl_af4list_foreach_rcu(addr4, &iface->addr4_list) { -if (iter_addr4++ < skip_addr4) +if (iter_addr4++ < cb->args[0 ])continue ; if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF, iface,
@@ -1308,7 +1303,7 @@ static int netlbl_unlabel_staticlistdef( }#if defined(CONFIG_IPV6 ) || defined(CONFIG_IPV6_MODULE ) netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) { -if (iter_addr6++ < skip_addr6) +if (iter_addr6++ < cb->args[1 ])continue ; if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF, iface,
@@ -1323,8 +1318,8 @@ static int netlbl_unlabel_staticlistdef( unlabel_staticlistdef_return:rcu_read_unlock (); - cb->args[0 ] = skip_addr4; - cb->args[1 ] = skip_addr6; + cb->args[0 ] = iter_addr4; + cb->args[1 ] = iter_addr6;return skb->len; }
Greg Kroah-Hartman
maintainerPATCH 37/40 bridging: fix rx_handlers return code
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Bercaru <[email protected]>
[ Upstream commit 3bc1b1add7a8484cc4a261c3e128dbe1528ce01f ]
The frames for which rx_handlers return RX_HANDLER_CONSUMED are no longer counted as dropped. They are counted as successfully received by 'netif_receive_skb'.
This allows network interface drivers to correctly update their RX-OK and RX-DRP counters based on the result of 'netif_receive_skb'.
--- net/core/dev.c | 1 + 1 file changed, 1 insertion(+)
net/core/dev.c +1 -0
@@ -3165,6 +3165,7 @@ ncls: }switch (rx_handler (&skb)) {case RX_HANDLER_CONSUMED : + ret =NET_RX_SUCCESS ; goto out;case RX_HANDLER_ANOTHER : goto another_round;
Greg Kroah-Hartman
maintainerPATCH 38/40 ipv6: stop multicast forwarding to process interface scoped addresses
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Frederic Sowa <[email protected]>
[ Upstream commit ddf64354af4a702ee0b85d0a285ba74c7278a460 ]
v2:
a) used struct ipv6_addr_props
v3:
a) reverted changes for ipv6_addr_props
v4:
a) do not use __ipv6_addr_needs_scope_id
--- net/ipv6/ip6_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/ip6_input.c +2 -1
@@ -257,7 +257,8 @@ int ip6_mc_input(struct sk_buff *skb)* IPv6 multicast router mode is now supported ;) */ if (dev_net (skb->dev)->ipv6.devconf_all->mc_forwarding && - !(ipv6_addr_type (&hdr->daddr) &IPV6_ADDR_LINKLOCAL ) && + !(ipv6_addr_type (&hdr->daddr) & + (IPV6_ADDR_LOOPBACK |IPV6_ADDR_LINKLOCAL )) &&likely (!(IP6CB (skb)->flags &IP6SKB_FORWARDED ))) {/* * Okay, we try to forward - split and duplicate
Greg Kroah-Hartman
maintainerPATCH 39/40 rtnl: fix info leak on RTM_GETLINK request for VF devices
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 84d73cd3fb142bf1298a8c13fd4ca50fd2432372 ]
Initialize the mac address buffer with 0 as the driver specific function will probably not fill the whole buffer. In fact, all in-kernel drivers fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible bytes. Therefore we currently leak 26 bytes of stack memory to userland via the netlink interface.
--- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+)
net/core/rtnetlink.c +1 -0
@@ -963,6 +963,7 @@ static int rtnl_fill_ifinfo(struct sk_bustruct ifla_vf_mac vf_mac;struct ifla_vf_vlan vf_vlan;struct ifla_vf_tx_rate vf_tx_rate; +memset (ivi.mac,0 ,sizeof (ivi.mac));if (dev->netdev_ops->ndo_get_vf_config (dev, i, &ivi))break ; vf_mac.vf = vf_vlan.vf = vf_tx_rate.vf = ivi.vf;
Greg Kroah-Hartman
maintainerPATCH 40/40 dcbnl: fix various netlink info leaks
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 29cd8ae0e1a39e239a3a7b67da1986add1199fc0 ]
The dcb netlink interface leaks stack memory in various places:
* perm_addr[] buffer is only filled at max with 12 of the 32 bytes but copied completely,
* no in-kernel driver fills all fields of an IEEE 802.1Qaz subcommand, so we're leaking up to 58 bytes for ieee_ets structs, up to 136 bytes for ieee_pfc structs, etc.,
* the same is true for CEE -- no in-kernel driver fills the whole struct,
Prevent all of the above stack info leaks by properly initializing the buffers/structures involved.
--- net/dcb/dcbnl.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/dcb/dcbnl.c +7 -0
@@ -335,6 +335,7 @@ static int dcbnl_getperm_hwaddr(struct n dcb->dcb_family =AF_UNSPEC ; dcb->cmd =DCB_CMD_GPERM_HWADDR ; +memset (perm_addr,0 ,sizeof (perm_addr)); netdev->dcbnl_ops->getpermhwaddr (netdev, perm_addr); ret = nla_put(dcbnl_skb, DCB_ATTR_PERM_HWADDR, sizeof(perm_addr),
@@ -1311,6 +1312,7 @@ static int dcbnl_ieee_get(struct net_devif (ops->ieee_getets) {struct ieee_ets ets; +memset (&ets,0 ,sizeof (ets)); err = ops->ieee_getets (netdev, &ets);if (!err)NLA_PUT (skb,DCB_ATTR_IEEE_ETS ,sizeof (ets), &ets);
@@ -1318,6 +1320,7 @@ static int dcbnl_ieee_get(struct net_devif (ops->ieee_getpfc) {struct ieee_pfc pfc; +memset (&pfc,0 ,sizeof (pfc)); err = ops->ieee_getpfc (netdev, &pfc);if (!err)NLA_PUT (skb,DCB_ATTR_IEEE_PFC ,sizeof (pfc), &pfc);
@@ -1344,6 +1347,7 @@ static int dcbnl_ieee_get(struct net_dev/* get peer info if available */ if (ops->ieee_peer_getets) {struct ieee_ets ets; +memset (&ets,0 ,sizeof (ets)); err = ops->ieee_peer_getets (netdev, &ets);if (!err)NLA_PUT (skb,DCB_ATTR_IEEE_PEER_ETS ,sizeof (ets), &ets);
@@ -1351,6 +1355,7 @@ static int dcbnl_ieee_get(struct net_devif (ops->ieee_peer_getpfc) {struct ieee_pfc pfc; +memset (&pfc,0 ,sizeof (pfc)); err = ops->ieee_peer_getpfc (netdev, &pfc);if (!err)NLA_PUT (skb,DCB_ATTR_IEEE_PEER_PFC ,sizeof (pfc), &pfc);
@@ -1551,6 +1556,7 @@ static int dcbnl_cee_get(struct net_devi/* get peer info if available */ if (ops->cee_peer_getpg) {struct cee_pg pg; +memset (&pg,0 ,sizeof (pg)); err = ops->cee_peer_getpg (netdev, &pg);if (!err)NLA_PUT (skb,DCB_ATTR_CEE_PEER_PG ,sizeof (pg), &pg);
@@ -1558,6 +1564,7 @@ static int dcbnl_cee_get(struct net_deviif (ops->cee_peer_getpfc) {struct cee_pfc pfc; +memset (&pfc,0 ,sizeof (pfc)); err = ops->cee_peer_getpfc (netdev, &pfc);if (!err)NLA_PUT (skb,DCB_ATTR_CEE_PEER_PFC ,sizeof (pfc), &pfc);
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.0.70 release. There are 40 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed Mar 20 21:10:06 UTC 2013. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.70-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
-------------
I am seeing the following warning right after resume:
[ 338.872618] ------------[ cut here ]------------ [ 338.872623] WARNING: at kernel/power/suspend_test.c:53 suspend_test_finish+0x86/0x90() [ 338.872625] Hardware name: HP EliteBook 6930p [ 338.872626] Component: resume devices, time: 10068 [ 338.872627] Modules linked in: ip6table_filter ip6_tables
ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc bluetooth radeon snd_hda_codec_analog snd_hda_intel snd_hda_codec ttm snd_hwdep snd_pcm snd_seq_midi snd_rawmidi binfmt_misc drm_kms_helper snd_seq_midi_event drm snd_seq snd_timer snd_seq_device snd pata_pcmcia joydev tpm_infineon dm_multipath soundcore psmouse snd_page_alloc pcmcia hp_accel ppdev serio_raw i2c_algo_bit lis3lv02d hp_wmi sparse_keymap parport_pc yenta_socket pcmcia_rsrc pcmcia_core input_polldev video mac_hid wmi tpm_tis lp parport firewire_ohci firewire_core sdhci_pci crc_itu_t sdhci e1000e [last unloaded: kvm]
[ 338.872662] Pid: 2656, comm: bash Not tainted 3.0.70-rc1+ #15 [ 338.872664] Call Trace: [ 338.872667] [<ffffffff8105ef1f>] warn_slowpath_common+0x7f/0xc0 [ 338.872670] [<ffffffff8105f016>] warn_slowpath_fmt+0x46/0x50 [ 338.872672] [<ffffffff810a1b16>] suspend_test_finish+0x86/0x90 [ 338.872675] [<ffffffff810a16f4>] suspend_devices_and_enter+0xd4/0x2e0 [ 338.872677] [<ffffffff810a1a1d>] enter_state+0x11d/0x150 [ 338.872679] [<ffffffff810a0e67>] state_store+0xb7/0xf0 [ 338.872682] [<ffffffff812d531f>] kobj_attr_store+0xf/0x30 [ 338.872685] [<ffffffff811ce64f>] sysfs_write_file+0xef/0x170 [ 338.872688] [<ffffffff8115e2a3>] vfs_write+0xb3/0x180 [ 338.872691] [<ffffffff8115e5ca>] sys_write+0x4a/0x90 [ 338.872694] [<ffffffff81604b42>] system_call_fastpath+0x16/0x1b [ 338.872696] ---[ end trace 9c87f459a9254076 ]--- [ 338.872805] PM: Finishing wakeup. [ 338.872806] Restarting tasks ... done. [ 338.886692] video LNXVIDEO:00: Restoring backlight state
-- Shuah