3.0.60-stable review
Subsystems (17)
Greg Kroah-Hartman
maintainercover 3.0.60-stable review
This is the start of the stable review cycle for the 3.0.60 release. There are 16 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 Mon Jan 21 01:20:05 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.60-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.60-rc1
Ben Hutchings <[email protected]>
staging: vt6656: Fix inconsistent structure packing
chao bi <[email protected]>
serial:ifx6x60:Delete SPI timer when shut down port
Bjørn Mork <[email protected]>
USB: option: blacklist network interface on ONDA MT8205 4G LTE
Bjørn Mork <[email protected]>
USB: option: add TP-LINK HSUPA Modem MA180
Andrew Cooper <[email protected]>
xen: Fix stack corruption in xen_failsafe_callback for 32bit PVOPS guests.
Julius Werner <[email protected]>
xhci: fix null-pointer dereference when destroying half-built segment rings
Philipp Reisner <[email protected]>
drbd: add missing part_round_stats to _drbd_start_io_acct
Tom Mingarelli <[email protected]>
intel-iommu: Prevent devices with RMRRs from being placed into SI Domain
Alan Stern <[email protected]>
USB: fix endpoint-disabling for failed config changes
Shuah Khan <[email protected]>
powerpc: fix wii_memory_fixups() compile error on 3.0.y tree
Eric Sandeen <[email protected]>
ext4: init pagevec in ext4_da_block_invalidatepages
Jesse Barnes <[email protected]>
x86/Sandy Bridge: reserve pages when integrated graphics is present
Heiko Carstens <[email protected]>
s390/time: fix sched_clock() overflow
Mark Rustad <[email protected]>
tcm_fc: Do not report target role when target is not defined
Mark Rustad <[email protected]>
tcm_fc: Do not indicate retry capability to initiators
Thomas Schwinge <[email protected]>
sh: Fix FDPIC binary loader
-------------
Diffstat:
Makefile | 4 +-- arch/powerpc/platforms/embedded6xx/wii.c | 6 ++-- arch/s390/include/asm/timex.h | 28 ++++++++++++++++++ arch/s390/kernel/time.c | 2 +- arch/s390/kvm/interrupt.c | 2 +- arch/sh/include/asm/elf.h | 4 +-- arch/x86/kernel/entry_32.S | 1 - arch/x86/kernel/setup.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/block/drbd/drbd_req.c | 1 + drivers/pci/intel-iommu.c | 31 ++++++++++++++++++++ drivers/staging/vt6656/bssdb.h | 1 - drivers/staging/vt6656/int.h | 1 - drivers/staging/vt6656/iocmd.h | 33 +++++++++++----------- drivers/staging/vt6656/iowpa.h | 8 ++---- drivers/target/tcm_fc/tfc_sess.c | 12 ++++++-- drivers/tty/serial/ifx6x60.c | 1 + drivers/usb/core/message.c | 53 +++++++++++++++++++--------------- drivers/usb/host/xhci-mem.c | 11 ++++++-- drivers/usb/serial/option.c | 9 +++++- fs/ext4/inode.c | 2 ++ 20 files changed, 227 insertions(+), 61 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/16 sh: Fix FDPIC binary loader
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Schwinge <[email protected]>
commit 4a71997a3279a339e7336ea5d0cd27282e2dea44 upstream.
Ensure that the aux table is properly initialized, even when optional features are missing. Without this, the FDPIC loader did not work. This was meant to be included in commit d5ab780305bb6d60a7b5a74f18cf84eb6ad153b1.
--- arch/sh/include/asm/elf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/sh/include/asm/elf.h +2 -2
@@ -202,9 +202,9 @@ extern void __kernel_vsyscall;if (vdso_enabled) \NEW_AUX_ENT (AT_SYSINFO_EHDR ,VDSO_BASE ); \else \ -NEW_AUX_ENT (AT_IGNORE ,0 ); + NEW_AUX_ENT(AT_IGNORE, 0)#else -#define VSYSCALL_AUX_ENT +#define VSYSCALL_AUX_ENT NEW_AUX_ENT(AT_IGNORE, 0)#endif /* CONFIG_VSYSCALL */ #ifdef CONFIG_SH_FPU
Greg Kroah-Hartman
maintainerPATCH 2/16 tcm_fc: Do not indicate retry capability to initiators
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rustad <[email protected]>
commit f2eeba214bcd0215b7f558cab6420e5fd153042b upstream.
When generating a PRLI response to an initiator, clear the FCP_SPPF_RETRY bit in the response.
Acked by Robert Love <[email protected]>
--- drivers/target/tcm_fc/tfc_sess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/tcm_fc/tfc_sess.c +1 -1
@@ -434,10 +434,10 @@ static int ft_prli_locked(struct fc_rpor/* * OR in our service parameters with other provider (initiator), if any. -* TBD XXX - indicate RETRY capability? */ fill: fcp_parm =ntohl (spp->spp_params); + fcp_parm &= ~FCP_SPPF_RETRY ; spp->spp_params =htonl (fcp_parm |FCP_SPPF_TARG_FCN );return FC_SPP_RESP_ACK ; }
Greg Kroah-Hartman
maintainerPATCH 3/16 tcm_fc: Do not report target role when target is not defined
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rustad <[email protected]>
commit edec8dfefa1f372b2dd8197da555352e76a10c03 upstream.
Clear the target role when no target is provided for the node performing a PRLI.
Acked by Robert Love <[email protected]>
--- drivers/target/tcm_fc/tfc_sess.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/target/tcm_fc/tfc_sess.c +8 -2
@@ -393,11 +393,11 @@ static int ft_prli_locked(struct fc_rpor tport =ft_tport_create (rdata->local_port);if (!tport) -return 0 ;/* not a target for this local port */ + goto not_target;/* not a target for this local port */ acl =ft_acl_get (tport->tpg, rdata);if (!acl) -return 0 ; + goto not_target;/* no target for this remote */ if (!rspp) goto fill;
@@ -440,6 +440,12 @@ fill: fcp_parm &= ~FCP_SPPF_RETRY ; spp->spp_params =htonl (fcp_parm |FCP_SPPF_TARG_FCN );return FC_SPP_RESP_ACK ; + +not_target: + fcp_parm =ntohl (spp->spp_params); + fcp_parm &= ~FCP_SPPF_TARG_FCN ; + spp->spp_params =htonl (fcp_parm); +return 0 ; }/**
Greg Kroah-Hartman
maintainerPATCH 4/16 s390/time: fix sched_clock() overflow
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 ed4f20943cd4c7b55105c04daedf8d63ab6d499c upstream.
Converting a 64 Bit TOD format value to nanoseconds means that the value must be divided by 4.096. In order to achieve that we multiply with 125 and divide by 512.
When used within sched_clock() this triggers an overflow after appr. 417 days. Resulting in a sched_clock() return value that is much smaller than previously and therefore may cause all sort of weird things in subsystems that rely on a monotonic sched_clock() behaviour.
To fix this implement a tod_to_ns() helper function which converts TOD values without overflow and call this function from both places that open coded the conversion: sched_clock() and kvm_s390_handle_wait().
--- arch/s390/include/asm/timex.h | 28 ++++++++++++++++++++++++++++ arch/s390/kernel/time.c | 2 +- arch/s390/kvm/interrupt.c | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-)
arch/s390/include/asm/timex.h +28 -0
@@ -126,4 +126,32 @@ static inline unsigned long long get_clo return get_clock_xt() - sched_clock_base_cc; } +/** +* tod_to_ns - convert a TOD format value to nanoseconds +* @todval: to be converted TOD format value +* Returns: number of nanoseconds that correspond to the TOD format value +* +* Converting a 64 Bit TOD format value to nanoseconds means that the value +* must be divided by 4.096. In order to achieve that we multiply with 125 +* and divide by 512: +* +* ns = (todval * 125) >> 9; +* +* In order to avoid an overflow with the multiplication we can rewrite this. +* With a split todval == 2^32 * th + tl (th upper 32 bits, tl lower 32 bits) +* we end up with +* +* ns = ((2^32 * th + tl) * 125 ) >> 9; +* -> ns = (2^23 * th * 125) + ((tl * 125) >> 9); +* +*/ +static inline unsigned long long tod_to_ns (unsigned long long todval) +{ +unsigned long long ns; + + ns = ((todval >>32 ) <<23 ) *125 ; + ns += ((todval &0xffffffff ) *125 ) >>9 ; +return ns; +} +#endif
arch/s390/kernel/time.c +1 -1
@@ -63,7 +63,7 @@ static DEFINE_PER_CPU(struct clock_event*/ unsigned long long notrace __kprobes sched_clock (void ) { -return (get_clock_monotonic () *125 ) >>9 ; +return tod_to_ns (get_clock_monotonic ()); }/*
arch/s390/kvm/interrupt.c +1 -1
@@ -358,7 +358,7 @@ int kvm_s390_handle_wait(struct kvm_vcpureturn 0 ; } - sltime = ((vcpu->arch.sie_block->ckc - now)*125 )>>9 ; + sltime =tod_to_ns (vcpu->arch.sie_block->ckc - now);hrtimer_start (&vcpu->arch.ckc_timer,ktime_set (0 , sltime) ,HRTIMER_MODE_REL );VCPU_EVENT (vcpu,5 ,"enabled wait via clock comparator: %llx ns" , sltime);
Greg Kroah-Hartman
maintainerPATCH 5/16 x86/Sandy Bridge: reserve pages when integrated graphics is present
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Barnes <[email protected]>
commit a9acc5365dbda29f7be2884efb63771dc24bd815 upstream.
SNB graphics devices have a bug that prevent them from accessing certain memory ranges, namely anything below 1M and in the pages listed in the table. So reserve those at boot if set detect a SNB gfx device on the CPU to avoid GPU hangs.
Stephane Marchesin had a similar patch to the page allocator awhile back, but rather than reserving pages up front, it leaked them at allocation time.
[ hpa: made a number of stylistic changes, marked arrays as static
const, and made less verbose; use "memblock=debug" for full verbosity. ]
--- arch/x86/kernel/setup.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+)
arch/x86/kernel/setup.c +78 -0
@@ -631,6 +631,81 @@ static __init void reserve_ibft_region(vstatic unsigned reserve_low =CONFIG_X86_RESERVE_LOW <<10 ; +static bool __init snb_gfx_workaround_needed (void ) +{ +int i; +u16 vendor, devid; +static const u16 snb_ids[] = { +0x0102 , +0x0112 , +0x0122 , +0x0106 , +0x0116 , +0x0126 , +0x010a , + }; + +/* Assume no if something weird is going on with PCI */ +if (!early_pci_allowed ()) +return false; + + vendor =read_pci_config_16 (0 ,2 ,0 ,PCI_VENDOR_ID ); +if (vendor !=0x8086 ) +return false; + + devid =read_pci_config_16 (0 ,2 ,0 ,PCI_DEVICE_ID ); +for (i =0 ; i <ARRAY_SIZE (snb_ids); i++) +if (devid == snb_ids[i]) +return true; + +return false; +} + +/* +* Sandy Bridge graphics has trouble with certain ranges, exclude +* them from allocation. +*/ +static void __init trim_snb_memory (void ) +{ +static const unsigned long bad_pages[] = { +0x20050000 , +0x20110000 , +0x20130000 , +0x20138000 , +0x40004000 , + }; +int i; + +if (!snb_gfx_workaround_needed ()) +return ; + +printk (KERN_DEBUG "reserving inaccessible SNB gfx pages\n" ); + +/* +* Reserve all memory below the 1 MB mark that has not +* already been reserved. +*/ +memblock_reserve (0 ,1 <<20 ); + +for (i =0 ; i <ARRAY_SIZE (bad_pages); i++) { +if (memblock_reserve (bad_pages[i],PAGE_SIZE )) +printk (KERN_WARNING "failed to reserve 0x%08lx\n" , + bad_pages[i]); + } +} + +/* +* Here we put platform-specific memory range workarounds, i.e. +* memory known to be corrupt or otherwise in need to be reserved on +* specific platforms. +* +* If this gets used more widely it could use a real dispatch mechanism. +*/ +static void __init trim_platform_memory_ranges (void ) +{ +trim_snb_memory (); +} +static void __init trim_bios_range (void ) {/*
@@ -651,6 +726,7 @@ static void __init trim_bios_range(void)* take them out. */ e820_remove_range (BIOS_BEGIN ,BIOS_END -BIOS_BEGIN ,E820_RAM ,1 ); +sanitize_e820_map (e820.map,ARRAY_SIZE (e820.map), &e820.nr_map); }
@@ -929,6 +1005,8 @@ void __init setup_arch(char **cmdline_p)setup_trampolines (); +trim_platform_memory_ranges (); +init_gbpages ();/* max_pfn_mapped is updated here */
Greg Kroah-Hartman
maintainerPATCH 6/16 ext4: init pagevec in ext4_da_block_invalidatepages
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 66bea92c69477a75a5d37b9bfed5773c92a3c4b4 upstream.
ext4_da_block_invalidatepages is missing a pagevec_init(), which means that pvec->cold contains random garbage.
This affects whether the page goes to the front or back of the LRU when ->cold makes it to free_hot_cold_page()
--- fs/ext4/inode.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ext4/inode.c +2 -0
@@ -2199,6 +2199,8 @@ static void ext4_da_block_invalidatepage index = mpd->first_page; end = mpd->next_page -1 ; + +pagevec_init (&pvec,0 );while (index <= end) { nr_pages =pagevec_lookup (&pvec, mapping, index,PAGEVEC_SIZE );if (nr_pages ==0 )
Greg Kroah-Hartman
maintainerPATCH 7/16 powerpc: fix wii_memory_fixups() compile error on 3.0.y tree
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuah Khan <[email protected]>
[not upstream as the code involved was removed in the 3.3.0 release]
Fix wii_memory_fixups() the following compile error on 3.0.y tree with wii_defconfig on 3.0.y tree.
CC arch/powerpc/platforms/embedded6xx/wii.oarch/powerpc/platforms/embedded6xx/wii.c: In function ‘wii_memory_fixups’:arch/powerpc/platforms/embedded6xx/wii.c:88:2: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘phys_addr_t’ [-Werror=format] arch/powerpc/platforms/embedded6xx/wii.c:88:2: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘phys_addr_t’ [-Werror=format] arch/powerpc/platforms/embedded6xx/wii.c:90:2: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘phys_addr_t’ [-Werror=format] arch/powerpc/platforms/embedded6xx/wii.c:90:2: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘phys_addr_t’ [-Werror=format]
cc1: all warnings being treated as errors
make[2]: *** [arch/powerpc/platforms/embedded6xx/wii.o] Error 1
make[1]: *** [arch/powerpc/platforms/embedded6xx] Error 2
make: *** [arch/powerpc/platforms] Error 2
--- arch/powerpc/platforms/embedded6xx/wii.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/platforms/embedded6xx/wii.c +4 -2
@@ -85,9 +85,11 @@ void __init wii_memory_fixups(void) wii_hole_start = p[0 ].base + p[0 ].size; wii_hole_size = p[1 ].base - wii_hole_start; -pr_info ("MEM1: <%08llx %08llx>\n" , p[0 ].base, p[0 ].size); +pr_info ("MEM1: <%08llx %08llx>\n" , + (unsigned long long ) p[0 ].base, (unsigned long long ) p[0 ].size);pr_info ("HOLE: <%08lx %08lx>\n" , wii_hole_start, wii_hole_size); -pr_info ("MEM2: <%08llx %08llx>\n" , p[1 ].base, p[1 ].size); +pr_info ("MEM2: <%08llx %08llx>\n" , + (unsigned long long ) p[1 ].base, (unsigned long long ) p[1 ].size); p[0 ].size += wii_hole_size + p[1 ].size;
Greg Kroah-Hartman
maintainerPATCH 8/16 USB: fix endpoint-disabling for failed config changes
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 36caff5d795429c572443894e8789c2150dd796b upstream.
This patch (as1631) fixes a bug that shows up when a config change fails for a device under an xHCI controller. The controller needs to be told to disable the endpoints that have been enabled for the new config. The existing code does this, but before storing the information about which endpoints were enabled! As a result, any second attempt to install the new config is doomed to fail because xhci-hcd will refuse to enable an endpoint that is already enabled.
The patch optimistically initializes the new endpoints' device structures before asking the device to switch to the new config. If the request fails then the endpoint information is already stored, so we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no trouble. The rest of the error path is slightly more complex now; we have to disable the new interfaces and call put_device() rather than simply deallocating them.
--- drivers/usb/core/message.c | 53 ++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 22 deletions(-)
drivers/usb/core/message.c +31 -22
@@ -1770,28 +1770,8 @@ free_interfaces: goto free_interfaces; } - ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), -USB_REQ_SET_CONFIGURATION ,0 , configuration,0 , -NULL ,0 ,USB_CTRL_SET_TIMEOUT ); -if (ret <0 ) { -/* All the old state is gone, so what else can we do? -* The device is probably useless now anyway. -*/ - cp =NULL ; - } - - dev->actconfig = cp; -if (!cp) { -usb_set_device_state (dev,USB_STATE_ADDRESS ); -usb_hcd_alloc_bandwidth (dev,NULL ,NULL ,NULL ); -mutex_unlock (hcd->bandwidth_mutex); -usb_autosuspend_device (dev); - goto free_interfaces; - } -mutex_unlock (hcd->bandwidth_mutex); -usb_set_device_state (dev,USB_STATE_CONFIGURED ); - -/* Initialize the new interface structures and the +/* +* Initialize the new interface structures and the * hc/hcd/usbcore interface/endpoint state. */ for (i =0 ; i < nintf; ++i) {
@@ -1835,6 +1815,35 @@ free_interfaces: }kfree (new_interfaces); + ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), +USB_REQ_SET_CONFIGURATION ,0 , configuration,0 , +NULL ,0 ,USB_CTRL_SET_TIMEOUT ); +if (ret <0 && cp) { +/* +* All the old state is gone, so what else can we do? +* The device is probably useless now anyway. +*/ +usb_hcd_alloc_bandwidth (dev,NULL ,NULL ,NULL ); +for (i =0 ; i < nintf; ++i) { +usb_disable_interface (dev, cp->interface[i], true); +put_device (&cp->interface[i]->dev); + cp->interface[i] =NULL ; + } + cp =NULL ; + } + + dev->actconfig = cp; +mutex_unlock (hcd->bandwidth_mutex); + +if (!cp) { +usb_set_device_state (dev,USB_STATE_ADDRESS ); + +/* Leave LPM disabled while the device is unconfigured. */ +usb_autosuspend_device (dev); +return ret; + } +usb_set_device_state (dev,USB_STATE_CONFIGURED ); +if (cp->string ==NULL && !(dev->quirks &USB_QUIRK_CONFIG_INTF_STRINGS )) cp->string =usb_cache_string (dev, cp->desc.iConfiguration);
Greg Kroah-Hartman
maintainerPATCH 9/16 intel-iommu: Prevent devices with RMRRs from being placed into SI Domain
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tom Mingarelli <[email protected]>
commit ea2447f700cab264019b52e2b417d689e052dcfd upstream.
This patch is to prevent non-USB devices that have RMRRs associated with them from being placed into the SI Domain during init. This fixes the issue where the RMRR info for devices being placed in and out of the SI Domain gets lost.
--- drivers/pci/intel-iommu.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
drivers/pci/intel-iommu.c +31 -0
@@ -2289,8 +2289,39 @@ static int domain_add_dev_info(struct dmreturn 0 ; } +static bool device_has_rmrr (struct pci_dev *dev) +{ +struct dmar_rmrr_unit *rmrr; +int i; + +for_each_rmrr_units (rmrr) { +for (i =0 ; i < rmrr->devices_cnt; i++) { +/* +* Return TRUE if this RMRR contains the device that +* is passed in. +*/ +if (rmrr->devices[i] == dev) +return true; + } + } +return false; +} +static int iommu_should_identity_map (struct pci_dev *pdev,int startup) { + +/* +* We want to prevent any device associated with an RMRR from +* getting placed into the SI Domain. This is done because +* problems exist when devices are moved in and out of domains +* and their respective RMRR info is lost. We exempt USB devices +* from this process due to their usage of RMRRs that are known +* to not be needed after BIOS hand-off to OS. +*/ +if (device_has_rmrr (pdev) && + (pdev->class >>8 ) !=PCI_CLASS_SERIAL_USB ) +return 0 ; +if ((iommu_identity_mapping &IDENTMAP_AZALIA ) &&IS_AZALIA (pdev))return 1 ;
Greg Kroah-Hartman
maintainerPATCH 10/16 drbd: add missing part_round_stats to _drbd_start_io_acct
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Philipp Reisner <[email protected]>
commit 72585d2428fa3a0daab02ebad1f41e5ef517dbaa upstream.
Without this, iostat frequently sees bogus svctime and >= 100% "utilization".
--- drivers/block/drbd/drbd_req.c | 1 + 1 file changed, 1 insertion(+)
drivers/block/drbd/drbd_req.c +1 -0
@@ -37,6 +37,7 @@ static void _drbd_start_io_acct(struct dconst int rw =bio_data_dir (bio);int cpu; cpu =part_stat_lock (); +part_round_stats (cpu, &mdev->vdisk->part0);part_stat_inc (cpu, &mdev->vdisk->part0, ios[rw]);part_stat_add (cpu, &mdev->vdisk->part0, sectors[rw],bio_sectors (bio));part_inc_in_flight (&mdev->vdisk->part0, rw);
Greg Kroah-Hartman
maintainerPATCH 11/16 xhci: fix null-pointer dereference when destroying half-built segment rings
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julius Werner <[email protected]>
commit 68e5254adb88bede68285f11fb442a4d34fb550c upstream.
xhci_alloc_segments_for_ring() builds a list of xhci_segments and links the tail to head at the end (forming a ring). When it bails out for OOM reasons half-way through, it tries to destroy its half-built list with xhci_free_segments_for_ring(), even though it is not a ring yet. This causes a null-pointer dereference upon hitting the last element.
Furthermore, one of its callers (xhci_ring_alloc()) mistakenly believes the output parameters to be valid upon this kind of OOM failure, and calls xhci_ring_free() on them. Since the (incomplete) list/ring should already be destroyed in that case, this would lead to a use after free.
This patch fixes those issues by having xhci_alloc_segments_for_ring() destroy its half-built, non-circular list manually and destroying the invalid struct xhci_ring in xhci_ring_alloc() with a plain kfree().
This patch should be backported to kernels as old as 2.6.31, that contains the commit 0ebbab37422315a5d0cb29792271085bafdf38c0 "USB: xhci:
Ring allocation and initialization."
A separate patch will need to be developed for kernels older than 3.4, since the ring allocation code was refactored in that kernel.
[bwh: Backported to 3.2:
- Adjust context
- Since segment allocation is done directly in xhci_ring_alloc(), walk the list starting from ring->first_seg when freeing]
--- drivers/usb/host/xhci-mem.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-mem.c +9 -2
@@ -180,8 +180,15 @@ static struct xhci_ring *xhci_ring_allocstruct xhci_segment *next; next =xhci_segment_alloc (xhci, flags); -if (!next) +if (!next) { + prev = ring->first_seg; +while (prev) { + next = prev->next; +xhci_segment_free (xhci, prev); + prev = next; + } goto fail; + }xhci_link_segments (xhci, prev, next, link_trbs, isoc); prev = next;
@@ -201,7 +208,7 @@ static struct xhci_ring *xhci_ring_allocreturn ring; fail: -xhci_ring_free (xhci, ring); +kfree (ring);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 12/16 xen: Fix stack corruption in xen_failsafe_callback for 32bit PVOPS guests.
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Cooper <[email protected]>
commit 9174adbee4a9a49d0139f5d71969852b36720809 upstream.
This fixes CVE-2013-0190 / XSA-40
There has been an error on the xen_failsafe_callback path for failed iret, which causes the stack pointer to be wrong when entering the iret_exc error path. This can result in the kernel crashing.
In the classic kernel case, the relevant code looked a little like:
popl %eax # Error code from hypervisor
jz 5f
addl $16,%esp
jmp iret_exc # Hypervisor said iret fault
5: addl $16,%esp
# Hypervisor said segment selector fault
Here, there are two identical addls on either option of a branch which appears to have been optimised by hoisting it above the jz, and converting it to an lea, which leaves the flags register unaffected.
In the PVOPS case, the code looks like:
popl_cfi %eax # Error from the hypervisor
lea 16(%esp),%esp # Add $16 before choosing fault path
CFI_ADJUST_CFA_OFFSET -16
jz 5f
addl $16,%esp # Incorrectly adjust %esp again
jmp iret_exc
It is possible unprivileged userspace applications to cause this behaviour, for example by loading an LDT code selector, then changing the code selector to be not-present. At this point, there is a race condition where it is possible for the hypervisor to return back to userspace from an interrupt, fault on its own iret, and inject a failsafe_callback into the kernel.
This bug has been present since the introduction of Xen PVOPS support in commit 5ead97c84 (xen: Core Xen implementation), in 2.6.23.
--- arch/x86/kernel/entry_32.S | 1 - 1 file changed, 1 deletion(-)
arch/x86/kernel/entry_32.S +0 -1
@@ -1078,7 +1078,6 @@ ENTRY(xen_failsafe_callback) lea 16(%esp),%esp CFI_ADJUST_CFA_OFFSET -16 jz 5f - addl $16,%esp jmp iret_exc 5: pushl_cfi $-1 /* orig_ax = -1 => not a system call */ SAVE_ALL
Greg Kroah-Hartman
maintainerPATCH 13/16 USB: option: add TP-LINK HSUPA Modem MA180
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 99beb2e9687ffd61c92a9875141eabe6f57a71b9 upstream.
The driver description files gives these names to the vendor specific functions on this modem:
Diagnostics VID_2357&PID_0201&MI_00
NMEA VID_2357&PID_0201&MI_01
Modem VID_2357&PID_0201&MI_03
Networkcard VID_2357&PID_0201&MI_04
--- drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/option.c +6 -0
@@ -449,6 +449,10 @@ static void option_instat_callback(struc#define PETATEL_VENDOR_ID 0x1ff4#define PETATEL_PRODUCT_NP10T 0x600e +/* TP-LINK Incorporated products */ +#define TPLINK_VENDOR_ID 0x2357 +#define TPLINK_PRODUCT_MA180 0x0201 +/* some devices interfaces need special handling due to a number of reasons */ enum option_blacklist_reason {OPTION_BLACKLIST_NONE =0 ,
@@ -1311,6 +1315,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) }, { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, + { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
Greg Kroah-Hartman
maintainerPATCH 14/16 USB: option: blacklist network interface on ONDA MT8205 4G LTE
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
commit 2291dff02e5f8c708a46a7c4c888f2c467e26642 upstream.
The driver description files gives these names to the vendor specific functions on this modem:
Diag VID_19D2&PID_0265&MI_00
NMEA VID_19D2&PID_0265&MI_01
AT cmd VID_19D2&PID_0265&MI_02
Modem VID_19D2&PID_0265&MI_03
Net VID_19D2&PID_0265&MI_04
--- drivers/usb/serial/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/option.c +2 -1
@@ -934,7 +934,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0254, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */ .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff), /* ONDA MT8205 */ + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },
Greg Kroah-Hartman
maintainerPATCH 15/16 serial:ifx6x60:Delete SPI timer when shut down port
In reply to Greg Kroah-Hartman3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: chao bi <[email protected]>
commit 014b9b4ce84281ccb3d723c792bed19815f3571a upstream.
When shut down SPI port, it's possible that MRDY has been asserted and a SPI timer was activated waiting for SRDY assert, in the case, it needs to delete this timer.
--- drivers/tty/serial/ifx6x60.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/serial/ifx6x60.c +1 -0
@@ -551,6 +551,7 @@ static void ifx_port_shutdown(struct tty container_of(port, struct ifx_spi_device, tty_port);mrdy_set_low (ifx_dev); +del_timer (&ifx_dev->spi_timer);clear_bit (IFX_SPI_STATE_TIMER_PENDING , &ifx_dev->flags);tasklet_kill (&ifx_dev->io_work_tasklet); }
Greg Kroah-Hartman
maintainerPATCH 16/16 staging: vt6656: Fix inconsistent structure packing
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 1ee4c55fc9620451b2a825d793042a7e0775391b upstream.
vt6656 has several headers that use the #pragma pack(1) directive to enable structure packing, but never disable it. The layout of structures defined in other headers can then depend on which order the various headers are included in, breaking the One Definition Rule.
In practice this resulted in crashes on x86_64 until the order of header inclusion was changed for some files in commit 11d404cb56ecd ('staging:
vt6656: fix headers and add cfg80211.'). But we need a proper fix that won't be affected by future changes to the order of inclusion.
This removes the #pragma pack(1) directives and adds __packed to the structure definitions for which packing appears to have been intended.
--- drivers/staging/vt6656/bssdb.h | 1 - drivers/staging/vt6656/int.h | 1 - drivers/staging/vt6656/iocmd.h | 33 ++++++++++++++++----------------- drivers/staging/vt6656/iowpa.h | 8 +++----- 4 files changed, 19 insertions(+), 24 deletions(-)
drivers/staging/vt6656/bssdb.h +0 -1
@@ -92,7 +92,6 @@ typedef struct tagSRSNCapObject { } SRSNCapObject, *PSRSNCapObject;// BSS info(AP) -#pragma pack(1) typedef struct tagKnownBSS { // BSS info BOOL bActive;
drivers/staging/vt6656/int.h +0 -1
@@ -34,7 +34,6 @@#include "device.h" /*--------------------- Export Definitions -------------------------*/ -#pragma pack(1) typedef struct tagSINTData { BYTE byTSR0; BYTE byPkt0;
drivers/staging/vt6656/iocmd.h +16 -17
@@ -95,13 +95,12 @@ typedef enum tagWZONETYPE {// Ioctl interface structure // Command structure // -#pragma pack(1)typedef struct tagSCmdRequest {u8 name[16 ];void *data;u16 wResult;u16 wCmdCode; -}SCmdRequest , *PSCmdRequest ; +} __packed SCmdRequest, *PSCmdRequest;// // Scan
@@ -111,7 +110,7 @@ typedef struct tagSCmdScan {u8 ssid[SSID_MAXLEN +2 ]; -} SCmdScan, *PSCmdScan; +}__packed SCmdScan, *PSCmdScan;// // BSS Join
@@ -126,7 +125,7 @@ typedef struct tagSCmdBSSJoin {BOOL bPSEnable;BOOL bShareKeyAuth; -} SCmdBSSJoin, *PSCmdBSSJoin; +}__packed SCmdBSSJoin, *PSCmdBSSJoin;// // Zonetype Setting
@@ -137,7 +136,7 @@ typedef struct tagSCmdZoneTypeSet {BOOL bWrite;WZONETYPE ZoneType; -} SCmdZoneTypeSet, *PSCmdZoneTypeSet; +}__packed SCmdZoneTypeSet, *PSCmdZoneTypeSet; typedef struct tagSWPAResult { char ifname[100];
@@ -145,7 +144,7 @@ typedef struct tagSWPAResult {u8 key_mgmt;u8 eap_type;BOOL authenticated; -} SWPAResult, *PSWPAResult; +}__packed SWPAResult, *PSWPAResult; typedef struct tagSCmdStartAP {
@@ -157,7 +156,7 @@ typedef struct tagSCmdStartAP {BOOL bShareKeyAuth;u8 byBasicRate; -} SCmdStartAP, *PSCmdStartAP; +}__packed SCmdStartAP, *PSCmdStartAP; typedef struct tagSCmdSetWEP {
@@ -167,7 +166,7 @@ typedef struct tagSCmdSetWEP {BOOL bWepKeyAvailable[WEP_NKEYS ];u32 auWepKeyLength[WEP_NKEYS ]; -} SCmdSetWEP, *PSCmdSetWEP; +}__packed SCmdSetWEP, *PSCmdSetWEP; typedef struct tagSBSSIDItem {
@@ -180,14 +179,14 @@ typedef struct tagSBSSIDItem {BOOL bWEPOn;u32 uRSSI; -} SBSSIDItem; +}__packed SBSSIDItem;typedef struct tagSBSSIDList {u32 uItem;SBSSIDItem sBSSIDList[0 ]; -}SBSSIDList , *PSBSSIDList ; +} __packed SBSSIDList, *PSBSSIDList; typedef struct tagSNodeItem {
@@ -208,7 +207,7 @@ typedef struct tagSNodeItem {u32 uTxAttempts;u16 wFailureRatio; -} SNodeItem; +}__packed SNodeItem; typedef struct tagSNodeList {
@@ -216,7 +215,7 @@ typedef struct tagSNodeList {u32 uItem;SNodeItem sNodeList[0 ]; -} SNodeList, *PSNodeList; +}__packed SNodeList, *PSNodeList; typedef struct tagSCmdLinkStatus {
@@ -229,7 +228,7 @@ typedef struct tagSCmdLinkStatus {u32 uChannel;u32 uLinkRate; -} SCmdLinkStatus, *PSCmdLinkStatus; +}__packed SCmdLinkStatus, *PSCmdLinkStatus;// // 802.11 counter
@@ -247,7 +246,7 @@ typedef struct tagSDot11MIBCount {u32 ReceivedFragmentCount;u32 MulticastReceivedFrameCount;u32 FCSErrorCount; -} SDot11MIBCount, *PSDot11MIBCount; +}__packed SDot11MIBCount, *PSDot11MIBCount;
@@ -355,13 +354,13 @@ typedef struct tagSStatMIBCount {u32 ullTxBroadcastBytes[2 ];u32 ullTxMulticastBytes[2 ];u32 ullTxDirectedBytes[2 ]; -} SStatMIBCount, *PSStatMIBCount; +}__packed SStatMIBCount, *PSStatMIBCount;typedef struct tagSCmdValue {u32 dwValue; -}SCmdValue , *PSCmdValue ; +} __packed SCmdValue, *PSCmdValue;// // hostapd & viawget ioctl related
@@ -431,7 +430,7 @@ struct viawget_hostapd_param {u8 ssid[32 ]; } scan_req; } u; -}; +} __packed;/*--------------------- Export Classes ----------------------------*/
drivers/staging/vt6656/iowpa.h +3 -5
@@ -67,12 +67,11 @@ enum { -#pragma pack(1)typedef struct viawget_wpa_header {u8 type;u16 req_ie_len;u16 resp_ie_len; -}viawget_wpa_header ; +} __packed viawget_wpa_header;struct viawget_wpa_param {u32 cmd;
@@ -113,9 +112,8 @@ struct viawget_wpa_param {u8 *buf; } scan_results; } u; -}; +} __packed; -#pragma pack(1)struct viawget_scan_result {u8 bssid[6 ];u8 ssid[32 ];
@@ -130,7 +128,7 @@ struct viawget_scan_result {int noise;int level;int maxrate; -}; +} __packed;/*--------------------- Export Classes ----------------------------*/
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.0.60 release. There are 16 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 Mon Jan 21 01:20:05 UTC 2013. Anything received after that time might be too late.
Quoted 8 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.60-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Patches applied cleanly to 3.0.y, 3.4.y, and 3.7.y. Compiled and booted on the following systems:
HP EliteBook 6930p Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics
Cross-compile tests:
alpha: defconfig passed on all
arm: defconfig passed on all
arm64: not applicable to 3.0.y, 3.4.y. defconfig passed on 3.7.y
c6x: not applicable to 3.0.y, defconfig passed on 3.4.y, and 3.7.y.
mips: defconfig passed on all
mipsel: defconfig passed on all
powerpc: wii_defconfig passed on all
sh: defconfig passed on all
sparc: defconfig passed on all
tile: tilegx_defconfig passed on all
-- Shuah
At Fri, 18 Jan 2013 17:21:38 -0800,
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.0.60 release. There are 16 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.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
- Test machine: debian wheezy x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GB
I reviewed the following patches and it looks good to me.
Quoted 2 lines
-------------
Pseudo-Shortlog of commits:
...
Quoted 4 lines
chao bi <[email protected]>
serial:ifx6x60:Delete SPI timer when shut down port
Eric Sandeen <[email protected]>
ext4: init pagevec inext4_da_block_invalidatepages
Thanks,
Satoru