3.12.41-stable review
Subsystems (3)
cover 3.12.41-stable review
This is the start of the stable review cycle for the 3.12.41 release. There are 83 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 Apr 29 20:39:50 CEST 2015. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.41-rc1.xz
and the diffstat can be found below.
thanks,
js
===============
Al Viro (3):
ocfs2: _really_ sync the right range ioctx_alloc(): fix vma (and file) leak on failure nick kvfree() from apparmor
Alex Elder (3):
conditionally define U32_MAX
kernel.h: define u8, s8, u32, etc. limits
remove extra definitions of U32_MAX
Ameya Palande (1):
mfd: kempld-core: Fix callback return value check
Andreas Werner (1):
can: flexcan: Deferred on Regulator return EPROBE_DEFER
Bart Van Assche (1):
Defer processing of REQ_PREEMPT requests for blocked devices
Ben Hutchings (1):
tcp: Fix crash in TCP Fast Open
Bjorn Helgaas (1):
Input: sirfsoc-onkey - fix GPL v2 license string typo
Brian Silverman (1):
sched: Fix RLIMIT_RTTIME when PI-boosting to RT
Catalin Marinas (1):
arm64: Use the reserved TTBR0 if context switching to the init_mm
Chen Gang (1):
[media] drivers: media: usb: b2c2: use usb_*_coherent() instead of
pci_*_consistent() in flexcop-usb.c
Christian Borntraeger (1):
KVM: remove redundant assignments in __kvm_set_memory_region
Christian Gmeiner (1):
x86/reboot: Add reboot quirk for Certec BPC600
D.S. Ljungmark (1):
ipv6: Don't reduce hop limit for an interface
Darshana Padmadas (1):
iio: imu: Use iio_trigger_get for indio_dev->trig assignment
David Disseldorp (1):
cifs: fix use-after-free bug in find_writable_file
David Miller (1):
radeon: Do not directly dereference pointers to BIOS area.
Dmitry M. Fedin (1):
ALSA: usb - Creative USB X-Fi Pro SB1095 volume knob support
Dmitry Tunin (2):
Bluetooth: ath3k: Add support of MCI 13d3:3408 bt device
Bluetooth: ath3k: Add support of AR3012 bluetooth 13d3:3423 device
Doug Goldstein (2):
USB: ftdi_sio: Added custom PID for Synapse Wireless product
USB: ftdi_sio: Use jtag quirk for SNAP Connect E10
Emmanuel Grumbach (1):
iwlwifi: dvm: run INIT firmware again upon .start()
Eric Dumazet (1):
tcp: tcp_make_synack() should clear skb->tstamp
Eric W. Biederman (8):
8139cp: Call dev_kfree_skby_any instead of kfree_skb. 8139too: Call dev_kfree_skby_any instead of dev_kfree_skb.
r8169: Call dev_kfree_skby_any instead of dev_kfree_skb.
bonding: Call dev_kfree_skby_any instead of kfree_skb.
bnx2: Call dev_kfree_skby_any instead of dev_kfree_skb.
tg3: Call dev_kfree_skby_any instead of dev_kfree_skb.
ixgb: Call dev_kfree_skby_any instead of dev_kfree_skb.
benet: Call dev_kfree_skby_any instead of kfree_skb.
Ethan Zhao (1):
cpufreq: fix a NULL pointer dereference in __cpufreq_governor()
Florian Westphal (1):
netfilter: conntrack: disable generic tracking for known protocols
Gu Zheng (1):
mm/memory hotplug: postpone the reset of obsolete pgdat
Hans Verkuil (1):
sh_veu: v4l2_dev wasn't set
Hui Wang (1):
ALSA: hda - Add one more node in the EAPD supporting candidate list
Igor Mammedov (1):
kvm: avoid page allocation failure in kvm_set_memory_region()
Janne Heikkinen (1):
Bluetooth: Add USB device 04ca:3010 as Atheros AR3012
Jim Snow (1):
sb_edac: Fix erroneous bytes->gigabytes conversion
Jiri Slaby (2):
core, nfqueue, openvswitch: fix compilation warning x86/reboot: Sort reboot DMI quirks by vendor
Joe Perches (1):
selinux: fix sel_write_enforce broken return value
John Soni Jose (1):
be2iscsi: Fix kernel panic when device initialization fails
Kailang Yang (1):
ALSA: hda/realtek - Make more stable to get pin sense for ALC283
Konstantin Khlebnikov (1):
proc/pagemap: walk page tables under pte lock
Lennart Sorensen (1):
crypto: testmgr - fix 3.12.40 regression
Lu Baolu (2):
usb: xhci: handle Config Error Change (CEC) in xhci driver
usb: xhci: apply XHCI_AVOID_BEI quirk to all Intel xHCI controllers
Majd Dibbiny (1):
IB/mlx4: Saturate RoCE port PMA counters in case of overflow
Marek Szyprowski (1):
media: s5p-mfc: fix mmap support for 64bit arch
Mark Brown (1):
video: vgacon: Don't build on arm64
Markos Chandras (1):
net: ethernet: pcnet32: Setup the SRAM and NOUFLO on Am79C97{3, 5}
Martin K. Petersen (1):
libata: Blacklist queued TRIM on Samsung SSD 850 Pro
Masoud Sharbiani (1):
x86/reboot: Remove the duplicate C6100 entry in the reboot quirks list
Michal Kubeček (1):
tcp: prevent fetching dst twice in early demux code
Mike Christie (1):
iscsi target: fix oops when adding reject pdu
Nadav Amit (1):
KVM: x86: SYSENTER emulation is broken
Neal Cardwell (1):
tcp: fix FRTO undo on cumulative ACK of SACKed range
NeilBrown (1):
Input: twl4030-pwrbutton - ensure a wakeup event is recorded.
Paolo Bonzini (1):
kvm: commonize allocation of the new memory slots
Peter Feiner (1):
mm: softdirty: unmapped addresses between VMAs are clean
Peter Hurley (2):
n_tty: Merge .receive_buf() flavors
n_tty: Fix read buffer overwrite when no newline
Peter Ujfalusi (1):
dmaengine: omap-dma: Fix memory leak when terminating running transfer
Rainer Koenig (1):
Input: elantech - add more Fujtisu notebooks to force crc_enabled
Sasha Levin (2):
net: rds: use correct size for max unacked packets and bytes
net: llc: use correct size for sysctl timeout entries
Seth Jennings (1):
sb_edac: avoid INTERNAL ERROR message in EDAC with unspecified channel
Shachar Raindel (1):
IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic
Stefan Agner (1):
tty: serial: fsl_lpuart: clear receive flag on FIFO flush
Stefan Lippers-Hollmann (1):
x86/reboot: Add ASRock Q1900DC-ITX mainboard reboot quirk
Sudip Mukherjee (1):
nbd: fix possible memory leak
Takashi Iwai (1):
ALSA: hda - Fix headphone pin config for Lifebook T731
Tejun Heo (2):
writeback: add missing INITIAL_JIFFIES init in
global_update_bandwidth()
writeback: fix possible underflow in write bandwidth calculation
Tyrel Datwyler (1):
powerpc/pseries: Little endian fixes for post mobility device tree
update
Ulrik De Bie (1):
Input: elantech - fix crc_enabled for Fujitsu H730
Vineet Gupta (1):
ARC: SA_SIGINFO ucontext regs off-by-one
Viorel Suman (1):
iio: inv_mpu6050: Clear timestamps fifo while resetting hardware fifo
arch/arc/kernel/signal.c | 4 +- arch/arm64/include/asm/mmu_context.h | 9 + arch/powerpc/platforms/pseries/mobility.c | 44 ++-- arch/x86/kernel/reboot.c | 296 +++++++++++++----------- arch/x86/kvm/emulate.c | 27 +-- crypto/testmgr.c | 2 + drivers/ata/libata-core.c | 1 + drivers/block/nbd.c | 8 +- drivers/bluetooth/ath3k.c | 6 + drivers/bluetooth/btusb.c | 3 + drivers/cpufreq/cpufreq.c | 7 + drivers/dma/omap-dma.c | 1 + drivers/edac/sb_edac.c | 46 ++-- drivers/gpu/drm/radeon/radeon_bios.c | 10 +- drivers/iio/imu/adis_trigger.c | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 25 +- drivers/infiniband/core/umem.c | 8 + drivers/infiniband/hw/mlx4/mad.c | 20 +- drivers/input/misc/sirfsoc-onkey.c | 2 +- drivers/input/misc/twl4030-pwrbutton.c | 1 + drivers/input/mouse/elantech.c | 35 ++- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 2 +- drivers/media/platform/sh_veu.c | 1 + drivers/media/usb/b2c2/flexcop-usb.c | 6 +- drivers/mfd/kempld-core.c | 2 +- drivers/net/bonding/bond_3ad.c | 2 +- drivers/net/bonding/bond_alb.c | 2 +- drivers/net/bonding/bond_main.c | 10 +- drivers/net/can/flexcan.c | 11 +- drivers/net/ethernet/amd/pcnet32.c | 31 ++- drivers/net/ethernet/broadcom/bnx2.c | 6 +- drivers/net/ethernet/broadcom/tg3.c | 14 +- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 +- drivers/net/ethernet/realtek/8139cp.c | 2 +- drivers/net/ethernet/realtek/8139too.c | 4 +- drivers/net/ethernet/realtek/r8169.c | 6 +- drivers/net/wireless/iwlwifi/dvm/dev.h | 1 - drivers/net/wireless/iwlwifi/dvm/ucode.c | 5 - drivers/scsi/be2iscsi/be_main.c | 2 +- drivers/scsi/scsi_lib.c | 4 +- drivers/target/iscsi/iscsi_target.c | 2 +- drivers/tty/n_tty.c | 143 ++++++++---- drivers/tty/serial/fsl_lpuart.c | 3 + drivers/usb/host/xhci-hub.c | 9 +- drivers/usb/host/xhci-pci.c | 2 +- drivers/usb/serial/ftdi_sio.c | 9 +- drivers/usb/serial/ftdi_sio_ids.h | 6 + drivers/video/console/Kconfig | 3 +- fs/aio.c | 3 + fs/cifs/file.c | 1 + fs/ocfs2/file.c | 14 +- fs/proc/task_mmu.c | 68 ++++-- fs/reiserfs/reiserfs.h | 2 - include/linux/blk_types.h | 4 +- include/linux/ceph/decode.h | 17 -- include/linux/kernel.h | 13 ++ include/linux/mm.h | 2 + kernel/sched/core.c | 5 +- mm/memory_hotplug.c | 13 +- mm/page-writeback.c | 7 +- mm/util.c | 10 + net/ipv4/tcp_illinois.c | 1 - net/ipv4/tcp_input.c | 7 +- net/ipv4/tcp_ipv4.c | 2 +- net/ipv4/tcp_output.c | 3 + net/ipv6/ndisc.c | 9 +- net/ipv6/tcp_ipv6.c | 2 +- net/llc/sysctl_net_llc.c | 8 +- net/netfilter/nf_conntrack_proto_generic.c | 26 ++- net/netfilter/nfnetlink_queue_core.c | 2 +- net/rds/sysctl.c | 4 +- security/apparmor/include/apparmor.h | 1 - security/apparmor/lib.c | 14 -- security/selinux/selinuxfs.c | 2 +- sound/pci/hda/patch_realtek.c | 13 +- sound/usb/mixer_quirks.c | 1 + virt/kvm/kvm_main.c | 41 ++-- 78 files changed, 708 insertions(+), 440 deletions(-)
Signature · 1 line
2.3.5
PATCH 1/83 core, nfqueue, openvswitch: fix compilation warning
3.12-stable review patch. If anyone has any objections, please let me know.
===============
Stable commit "core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors", upstream commit 36d5fe6a000790f56039afe26834265db0a3ad4c, was not correctly backported and missed to change a const 'from' parameter to non-const. This results in a new batch of warnings:
net/netfilter/nfnetlink_queue_core.c: In function ‘nfqnl_zcopy’:net/netfilter/nfnetlink_queue_core.c:272:2: warning: passing argument 1 of ‘skb_orphan_frags’ discards ‘const’ qualifier from pointer target type [enabled by default]
if (unlikely(skb_orphan_frags(from, GFP_ATOMIC))) {
^
In file included from net/netfilter/nfnetlink_queue_core.c:18:0:include/linux/skbuff.h:1822:19: note: expected ‘struct sk_buff *’ but argument is of type ‘const struct sk_buff *’
static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask)
^
net/netfilter/nfnetlink_queue_core.c:273:3: warning: passing argument 1 of ‘skb_tx_error’ discards ‘const’ qualifier from pointer target type [enabled by default]
skb_tx_error(from);
^
In file included from net/netfilter/nfnetlink_queue_core.c:18:0:include/linux/skbuff.h:630:13: note: expected ‘struct sk_buff *’ but argument is of type ‘const struct sk_buff *’
extern void skb_tx_error(struct sk_buff *skb);
Remove const from the 'from' parameter, the same as in the upstream commit.
As far as I can see, this leaked into 3.10, 3.12, and 3.13 already.
--- net/netfilter/nfnetlink_queue_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nfnetlink_queue_core.c +1 -1
@@ -236,7 +236,7 @@ nfqnl_flush(struct nfqnl_instance *queue, nfqnl_cmpfn cmpfn, unsigned long data) }static int -nfqnl_zcopy (struct sk_buff *to,const struct sk_buff *from,int len,int hlen) +nfqnl_zcopy (struct sk_buff *to,struct sk_buff *from,int len,int hlen) {int i, j =0 ;int plen =0 ;/* length of skb->head fragment */
Signature · 1 line
2.3.5
PATCH 2/83 arm64: Use the reserved TTBR0 if context switching to the init_mm
From: Catalin Marinas <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e53f21bce4d35a93b23d8fa1a840860f6c74f59e upstream.
The idle_task_exit() function may call switch_mm() with next == &init_mm. On arm64, init_mm.pgd cannot be used for user mappings, so this patch simply sets the reserved TTBR0.
--- arch/arm64/include/asm/mmu_context.h | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm64/include/asm/mmu_context.h +9 -0
@@ -151,6 +151,15 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, {unsigned int cpu =smp_processor_id (); +/* +* init_mm.pgd does not contain any user mappings and it is always +* active for kernel addresses in TTBR1. Just set the reserved TTBR0. +*/ +if (next == &init_mm) { +cpu_set_reserved_ttbr0 (); +return ; + } +if (!cpumask_test_and_set_cpu (cpu,mm_cpumask (next)) || prev != next)check_and_switch_context (next, tsk); }
Signature · 1 line
2.3.5
PATCH 3/83 powerpc/pseries: Little endian fixes for post mobility device tree update
In reply to Jiri SlabyFrom: Tyrel Datwyler <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f6ff04149637723261aa4738958b0098b929ee9e upstream.
We currently use the device tree update code in the kernel after resuming from a suspend operation to re-sync the kernels view of the device tree with that of the hypervisor. The code as it stands is not endian safe as it relies on parsing buffers returned by RTAS calls that thusly contains data in big endian format.
This patch annotates variables and structure members with __be types as well as performing necessary byte swaps to cpu endian for data that needs to be parsed.
--- arch/powerpc/platforms/pseries/mobility.c | 44 ++++++++++++++++--------------- 1 file changed, 23 insertions(+), 21 deletions(-)
arch/powerpc/platforms/pseries/mobility.c +23 -21
@@ -24,10 +24,10 @@static struct kobject *mobility_kobj;struct update_props_workarea { -u32 phandle; -u32 state; -u64 reserved; -u32 nprops; +__be32 phandle; +__be32 state; +__be64 reserved; +__be32 nprops; } __packed;#define NODE_ACTION_MASK 0xff000000
@@ -53,11 +53,11 @@ static int mobility_rtas_call(int token, char *buf, s32 scope)return rc; } -static int delete_dt_node (u32 phandle) +static int delete_dt_node (__be32 phandle) {struct device_node *dn; - dn =of_find_node_by_phandle (phandle); + dn =of_find_node_by_phandle (be32_to_cpu (phandle));if (!dn)return -ENOENT ;
@@ -126,7 +126,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,return 0 ; } -static int update_dt_node (u32 phandle,s32 scope) +static int update_dt_node (__be32 phandle,s32 scope) {struct update_props_workarea *upwa;struct device_node *dn;
@@ -135,6 +135,7 @@ static int update_dt_node(u32 phandle, s32 scope)char *prop_data;char *rtas_buf;int update_properties_token; +u32 nprops;u32 vd; update_properties_token =rtas_token ("ibm,update-properties" );
@@ -145,7 +146,7 @@ static int update_dt_node(u32 phandle, s32 scope)if (!rtas_buf)return -ENOMEM ; - dn =of_find_node_by_phandle (phandle); + dn =of_find_node_by_phandle (be32_to_cpu (phandle));if (!dn) {kfree (rtas_buf);return -ENOENT ;
@@ -161,6 +162,7 @@ static int update_dt_node(u32 phandle, s32 scope)break ; prop_data = rtas_buf +sizeof (*upwa); + nprops =be32_to_cpu (upwa->nprops);/* On the first call to ibm,update-properties for a node the * the first property value descriptor contains an empty
@@ -169,17 +171,17 @@ static int update_dt_node(u32 phandle, s32 scope)*/ if (*prop_data ==0 ) { prop_data++; - vd = *(u32 *)prop_data; + vd =be32_to_cpu (*(__be32 *)prop_data); prop_data += vd +sizeof (vd); - upwa->nprops--; + nprops--; } -for (i =0 ; i < upwa->nprops; i++) { +for (i =0 ; i < nprops; i++) {char *prop_name; prop_name = prop_data; prop_data +=strlen (prop_name) +1 ; - vd = *(u32 *)prop_data; + vd =be32_to_cpu (*(__be32 *)prop_data); prop_data +=sizeof (vd);switch (vd) {
@@ -211,13 +213,13 @@ static int update_dt_node(u32 phandle, s32 scope)return 0 ; } -static int add_dt_node (u32 parent_phandle,u32 drc_index) +static int add_dt_node (__be32 parent_phandle,__be32 drc_index) {struct device_node *dn;struct device_node *parent_dn;int rc; - parent_dn =of_find_node_by_phandle (parent_phandle); + parent_dn =of_find_node_by_phandle (be32_to_cpu (parent_phandle));if (!parent_dn)return -ENOENT ;
@@ -236,7 +238,7 @@ static int add_dt_node(u32 parent_phandle, u32 drc_index)int pseries_devicetree_update (s32 scope) {char *rtas_buf; -u32 *data; +__be32 *data;int update_nodes_token;int rc;
@@ -253,17 +255,17 @@ int pseries_devicetree_update(s32 scope)if (rc && rc !=1 )break ; - data = (u32 *)rtas_buf +4 ; -while (*data &NODE_ACTION_MASK ) { + data = (__be32 *)rtas_buf +4 ; +while (be32_to_cpu (*data) &NODE_ACTION_MASK ) {int i; -u32 action = *data &NODE_ACTION_MASK ; -int node_count = *data &NODE_COUNT_MASK ; +u32 action =be32_to_cpu (*data) &NODE_ACTION_MASK ; +u32 node_count =be32_to_cpu (*data) &NODE_COUNT_MASK ; data++;for (i =0 ; i < node_count; i++) { -u32 phandle = *data++; -u32 drc_index; +__be32 phandle = *data++; +__be32 drc_index;switch (action) {case DELETE_DT_NODE :
Signature · 1 line
2.3.5
PATCH 4/83 net: ethernet: pcnet32: Setup the SRAM and NOUFLO on Am79C97{3, 5}
In reply to Jiri SlabyFrom: Markos Chandras <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 87f966d97b89774162df04d2106c6350c8fe4cb3 upstream.
On a MIPS Malta board, tons of fifo underflow errors have been observed when using u-boot as bootloader instead of YAMON. The reason for that is that YAMON used to set the pcnet device to SRAM mode but u-boot does not. As a result, the default Tx threshold (64 bytes) is now too small to keep the fifo relatively used and it can result to Tx fifo underflow errors. As a result of which, it's best to setup the SRAM on supported controllers so we can always use the NOUFLO bit.
--- drivers/net/ethernet/amd/pcnet32.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
drivers/net/ethernet/amd/pcnet32.c +29 -2
@@ -1516,7 +1516,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) {struct pcnet32_private *lp;int i, media; -int fdx, mii, fset, dxsuflo; +int fdx, mii, fset, dxsuflo, sram;int chip_version;char *chipname;struct net_device *dev;
@@ -1553,7 +1553,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) }/* initialize variables */ - fdx = mii = fset = dxsuflo =0 ; + fdx = mii = fset = dxsuflo = sram =0 ; chip_version = (chip_version >>12 ) &0xffff ;switch (chip_version) {
@@ -1586,6 +1586,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) chipname ="PCnet/FAST III 79C973" ;/* PCI */ fdx =1 ; mii =1 ; + sram =1 ;break ;case 0x2626 : chipname ="PCnet/Home 79C978" ;/* PCI */
@@ -1609,6 +1610,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) chipname ="PCnet/FAST III 79C975" ;/* PCI */ fdx =1 ; mii =1 ; + sram =1 ;break ;case 0x2628 : chipname ="PCnet/PRO 79C976" ;
@@ -1637,6 +1639,31 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) dxsuflo =1 ; } +/* +* The Am79C973/Am79C975 controllers come with 12K of SRAM +* which we can use for the Tx/Rx buffers but most importantly, +* the use of SRAM allow us to use the BCR18:NOUFLO bit to avoid +* Tx fifo underflows. +*/ +if (sram) { +/* +* The SRAM is being configured in two steps. First we +* set the SRAM size in the BCR25:SRAM_SIZE bits. According +* to the datasheet, each bit corresponds to a 512-byte +* page so we can have at most 24 pages. The SRAM_SIZE +* holds the value of the upper 8 bits of the 16-bit SRAM size. +* The low 8-bits start at 0x00 and end at 0xff. So the +* address range is from 0x0000 up to 0x17ff. Therefore, +* the SRAM_SIZE is set to 0x17. The next step is to set +* the BCR26:SRAM_BND midway through so the Tx and Rx +* buffers can share the SRAM equally. +*/ + a->write_bcr (ioaddr,25 ,0x17 ); + a->write_bcr (ioaddr,26 ,0xc ); +/* And finally enable the NOUFLO bit */ + a->write_bcr (ioaddr,18 , a->read_bcr (ioaddr,18 ) | (1 <<11 )); + } + dev =alloc_etherdev (sizeof (*lp));if (!dev) { ret = -ENOMEM ;
Signature · 1 line
2.3.5
PATCH 5/83 mfd: kempld-core: Fix callback return value check
In reply to Jiri SlabyFrom: Ameya Palande <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c8648508ebfc597058d2cd00b6c539110264a167 upstream.
On success, callback function returns 0. So invert the if condition check so that we can break out of loop.
--- drivers/mfd/kempld-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/kempld-core.c +1 -1
@@ -629,7 +629,7 @@ static int __init kempld_init(void)if (force_device_id[0 ]) {for (id = kempld_dmi_table; id->matches[0 ].slot !=DMI_NONE ; id++)if (strstr (id->ident, force_device_id)) -if (id->callback && id->callback (id)) +if (id->callback && !id->callback (id))break ;if (id->matches[0 ].slot ==DMI_NONE )return -ENODEV ;
Signature · 1 line
2.3.5
PATCH 6/83 x86/reboot: Remove the duplicate C6100 entry in the reboot quirks list
In reply to Jiri SlabyFrom: Masoud Sharbiani <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b5eafc6f07c95e9f3dd047e72737449cb03c9956 upstream.
Two entries for the same system type were added, with two different vendor
names: 'Dell' and 'Dell, Inc.'.
Since a prefix match is being used by the DMI parsing code, we can eliminate the latter as redundant.
--- arch/x86/kernel/reboot.c | 8 -------- 1 file changed, 8 deletions(-)
arch/x86/kernel/reboot.c +0 -8
@@ -370,14 +370,6 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { .callback = set_pci_reboot, .ident = "Dell PowerEdge C6100", .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), - DMI_MATCH(DMI_PRODUCT_NAME, "C6100"), - }, - }, - { /* Some C6100 machines were shipped with vendor being 'Dell'. */ - .callback = set_pci_reboot, - .ident = "Dell PowerEdge C6100", - .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell" ), DMI_MATCH(DMI_PRODUCT_NAME, "C6100"), },
Signature · 1 line
2.3.5
PATCH 7/83 x86/reboot: Sort reboot DMI quirks by vendor
In reply to Jiri Slaby3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e56e57f6613d5ed5c3127419341d1aa989a11971 upstream.
Grouping them by vendor should make it easier to spot duplicates.
--- arch/x86/kernel/reboot.c | 270 +++++++++++++++++++++++++---------------------- 1 file changed, 141 insertions(+), 129 deletions(-)
arch/x86/kernel/reboot.c +141 -129
@@ -136,244 +136,256 @@ static int __init set_kbd_reboot(const struct dmi_system_id *d)* This is a single dmi_table handling all reboot quirks. */ static struct dmi_system_id __initdata reboot_dmi_table[] = { - {/* Handle problems with rebooting on Dell E520's */ - .callback = set_bios_reboot, - .ident ="Dell E520" , + +/* Acer */ + {/* Handle reboot issue on Acer Aspire one */ + .callback = set_kbd_reboot, + .ident ="Acer Aspire One A110" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Dell DM061" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"AOA110" ), }, }, - {/* Handle problems with rebooting on Dell 1300's */ - .callback = set_bios_reboot, - .ident ="Dell PowerEdge 1300" , + +/* Apple */ + {/* Handle problems with rebooting on Apple MacBook5 */ + .callback = set_pci_reboot, + .ident ="Apple MacBook5" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Computer Corporation" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge 1300/" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"MacBook5" ), }, }, - {/* Handle problems with rebooting on Dell 300's */ - .callback = set_bios_reboot, - .ident ="Dell PowerEdge 300" , + {/* Handle problems with rebooting on Apple MacBookPro5 */ + .callback = set_pci_reboot, + .ident ="Apple MacBookPro5" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Computer Corporation" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge 300/" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"MacBookPro5" ), }, }, - {/* Handle problems with rebooting on Dell Optiplex 745's SFF */ - .callback = set_bios_reboot, - .ident ="Dell OptiPlex 745" , + {/* Handle problems with rebooting on Apple Macmini3,1 */ + .callback = set_pci_reboot, + .ident ="Apple Macmini3,1" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 745" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Macmini3,1" ), }, }, - {/* Handle problems with rebooting on Dell Optiplex 745's DFF */ - .callback = set_bios_reboot, - .ident ="Dell OptiPlex 745" , + {/* Handle problems with rebooting on the iMac9,1. */ + .callback = set_pci_reboot, + .ident ="Apple iMac9,1" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 745" ), -DMI_MATCH (DMI_BOARD_NAME ,"0MM599" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"iMac9,1" ), }, }, - {/* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */ + +/* ASUS */ + {/* Handle problems with rebooting on ASUS P4S800 */ .callback = set_bios_reboot, - .ident ="Dell OptiPlex 745" , + .ident ="ASUS P4S800" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 745" ), -DMI_MATCH (DMI_BOARD_NAME ,"0KW626" ), +DMI_MATCH (DMI_BOARD_VENDOR ,"ASUSTeK Computer INC." ), +DMI_MATCH (DMI_BOARD_NAME ,"P4S800" ), }, }, - {/* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */ + +/* Dell */ + {/* Handle problems with rebooting on Dell DXP061 */ .callback = set_bios_reboot, - .ident ="Dell OptiPlex 330" , + .ident ="Dell DXP061" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 330" ), -DMI_MATCH (DMI_BOARD_NAME ,"0KP561" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Dell DXP061" ), }, }, - {/* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */ + {/* Handle problems with rebooting on Dell E520's */ .callback = set_bios_reboot, - .ident ="Dell OptiPlex 360" , + .ident ="Dell E520" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 360" ), -DMI_MATCH (DMI_BOARD_NAME ,"0T656F" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Dell DM061" ), }, }, - {/* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */ - .callback = set_bios_reboot, - .ident ="Dell OptiPlex 760" , + {/* Handle problems with rebooting on the Latitude E5410. */ + .callback = set_pci_reboot, + .ident ="Dell Latitude E5410" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 760" ), -DMI_MATCH (DMI_BOARD_NAME ,"0G919G" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Latitude E5410" ), }, }, - {/* Handle problems with rebooting on Dell 2400's */ - .callback = set_bios_reboot, - .ident ="Dell PowerEdge 2400" , + {/* Handle problems with rebooting on the Latitude E5420. */ + .callback = set_pci_reboot, + .ident ="Dell Latitude E5420" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Computer Corporation" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge 2400" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Latitude E5420" ), }, }, - {/* Handle problems with rebooting on Dell T5400's */ - .callback = set_bios_reboot, - .ident ="Dell Precision T5400" , + {/* Handle problems with rebooting on the Latitude E6320. */ + .callback = set_pci_reboot, + .ident ="Dell Latitude E6320" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Precision WorkStation T5400" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Latitude E6320" ), }, }, - {/* Handle problems with rebooting on Dell T7400's */ - .callback = set_bios_reboot, - .ident ="Dell Precision T7400" , + {/* Handle problems with rebooting on the Latitude E6420. */ + .callback = set_pci_reboot, + .ident ="Dell Latitude E6420" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Precision WorkStation T7400" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Latitude E6420" ), }, }, - {/* Handle problems with rebooting on HP laptops */ + {/* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */ .callback = set_bios_reboot, - .ident ="HP Compaq Laptop" , + .ident ="Dell OptiPlex 330" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Hewlett-Packard" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"HP Compaq" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 330" ), +DMI_MATCH (DMI_BOARD_NAME ,"0KP561" ), }, }, - {/* Handle problems with rebooting on Dell XPS710 */ + {/* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */ .callback = set_bios_reboot, - .ident ="Dell XPS710" , + .ident ="Dell OptiPlex 360" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Dell XPS710" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 360" ), +DMI_MATCH (DMI_BOARD_NAME ,"0T656F" ), }, }, - {/* Handle problems with rebooting on Dell DXP061 */ + {/* Handle problems with rebooting on Dell Optiplex 745's SFF */ .callback = set_bios_reboot, - .ident ="Dell DXP061" , + .ident ="Dell OptiPlex 745" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Dell DXP061" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 745" ), }, }, - {/* Handle problems with rebooting on Sony VGN-Z540N */ + {/* Handle problems with rebooting on Dell Optiplex 745's DFF */ .callback = set_bios_reboot, - .ident ="Sony VGN-Z540N" , + .ident ="Dell OptiPlex 745" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Sony Corporation" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"VGN-Z540N" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 745" ), +DMI_MATCH (DMI_BOARD_NAME ,"0MM599" ), }, }, - {/* Handle problems with rebooting on ASUS P4S800 */ + {/* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */ .callback = set_bios_reboot, - .ident ="ASUS P4S800" , + .ident ="Dell OptiPlex 745" , .matches = { -DMI_MATCH (DMI_BOARD_VENDOR ,"ASUSTeK Computer INC." ), -DMI_MATCH (DMI_BOARD_NAME ,"P4S800" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 745" ), +DMI_MATCH (DMI_BOARD_NAME ,"0KW626" ), }, }, - - {/* Handle reboot issue on Acer Aspire one */ - .callback = set_kbd_reboot, - .ident ="Acer Aspire One A110" , + {/* Handle problems with rebooting on Dell OptiPlex 760 with 0G919G */ + .callback = set_bios_reboot, + .ident ="Dell OptiPlex 760" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"AOA110" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 760" ), +DMI_MATCH (DMI_BOARD_NAME ,"0G919G" ), }, }, - {/* Handle problems with rebooting on Apple MacBook5 */ + {/* Handle problems with rebooting on the OptiPlex 990. */ .callback = set_pci_reboot, - .ident ="Apple MacBook5" , + .ident ="Dell OptiPlex 990" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"MacBook5" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 990" ), }, }, - {/* Handle problems with rebooting on Apple MacBookPro5 */ - .callback = set_pci_reboot, - .ident ="Apple MacBookPro5" , + {/* Handle problems with rebooting on Dell 300's */ + .callback = set_bios_reboot, + .ident ="Dell PowerEdge 300" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"MacBookPro5" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Computer Corporation" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge 300/" ), }, }, - {/* Handle problems with rebooting on Apple Macmini3,1 */ - .callback = set_pci_reboot, - .ident ="Apple Macmini3,1" , + {/* Handle problems with rebooting on Dell 1300's */ + .callback = set_bios_reboot, + .ident ="Dell PowerEdge 1300" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Macmini3,1" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Computer Corporation" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge 1300/" ), }, }, - {/* Handle problems with rebooting on the iMac9,1. */ - .callback = set_pci_reboot, - .ident ="Apple iMac9,1" , + {/* Handle problems with rebooting on Dell 2400's */ + .callback = set_bios_reboot, + .ident ="Dell PowerEdge 2400" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Apple Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"iMac9,1" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Computer Corporation" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PowerEdge 2400" ), }, }, - {/* Handle problems with rebooting on the Latitude E6320. */ + {/* Handle problems with rebooting on the Dell PowerEdge C6100. */ .callback = set_pci_reboot, - .ident ="Dell Latitude E6320" , + .ident ="Dell PowerEdge C6100" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Latitude E6320" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Dell" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"C6100" ), }, }, - {/* Handle problems with rebooting on the Latitude E5410. */ + {/* Handle problems with rebooting on the Precision M6600. */ .callback = set_pci_reboot, - .ident ="Dell Latitude E5410" , + .ident ="Dell Precision M6600" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Latitude E5410" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Precision M6600" ), }, }, - {/* Handle problems with rebooting on the Latitude E5420. */ - .callback = set_pci_reboot, - .ident ="Dell Latitude E5420" , + {/* Handle problems with rebooting on Dell T5400's */ + .callback = set_bios_reboot, + .ident ="Dell Precision T5400" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Latitude E5420" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Precision WorkStation T5400" ), }, }, - {/* Handle problems with rebooting on the Latitude E6420. */ - .callback = set_pci_reboot, - .ident ="Dell Latitude E6420" , + {/* Handle problems with rebooting on Dell T7400's */ + .callback = set_bios_reboot, + .ident ="Dell Precision T7400" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Latitude E6420" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Precision WorkStation T7400" ), }, }, - {/* Handle problems with rebooting on the OptiPlex 990. */ - .callback = set_pci_reboot, - .ident ="Dell OptiPlex 990" , + {/* Handle problems with rebooting on Dell XPS710 */ + .callback = set_bios_reboot, + .ident ="Dell XPS710" , .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"OptiPlex 990" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Dell XPS710" ), }, }, - {/* Handle problems with rebooting on the Precision M6600. */ - .callback = set_pci_reboot, - .ident ="Dell Precision M6600" , + +/* Hewlett-Packard */ + {/* Handle problems with rebooting on HP laptops */ + .callback = set_bios_reboot, + .ident ="HP Compaq Laptop" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), -DMI_MATCH (DMI_PRODUCT_NAME ,"Precision M6600" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Hewlett-Packard" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"HP Compaq" ), }, }, - {/* Handle problems with rebooting on the Dell PowerEdge C6100. */ - .callback = set_pci_reboot, - .ident ="Dell PowerEdge C6100" , + +/* Sony */ + {/* Handle problems with rebooting on Sony VGN-Z540N */ + .callback = set_bios_reboot, + .ident ="Sony VGN-Z540N" , .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Dell" ), -DMI_MATCH (DMI_PRODUCT_NAME ,"C6100" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Sony Corporation" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"VGN-Z540N" ), }, }, + { } };
Signature · 1 line
2.3.5
PATCH 8/83 x86/reboot: Add reboot quirk for Certec BPC600
In reply to Jiri SlabyFrom: Christian Gmeiner <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit aadca6fa4068ad1f92c492bc8507b7ed350825a2 upstream.
Certec BPC600 needs reboot=pci to actually reboot.
--- arch/x86/kernel/reboot.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/x86/kernel/reboot.c +10 -0
@@ -191,6 +191,16 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { }, }, +/* Certec */ + {/* Handle problems with rebooting on Certec BPC600 */ + .callback = set_pci_reboot, + .ident = "Certec BPC600", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Certec" ), + DMI_MATCH(DMI_PRODUCT_NAME, "BPC600"), + }, + }, + /* Dell */ { /* Handle problems with rebooting on Dell DXP061 */ .callback = set_bios_reboot,
Signature · 1 line
2.3.5
PATCH 9/83 n_tty: Merge .receive_buf() flavors
In reply to Jiri SlabyFrom: Peter Hurley <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 5c32d12378313e0096ea0d450462aa638a90fb6e upstream.
N_TTY's direct and flow-controlled flavors of the .receive_buf() method are nearly identical; fold together.
--- drivers/tty/n_tty.c | 43 ++++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 27 deletions(-)
drivers/tty/n_tty.c +16 -27
@@ -1683,32 +1683,9 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp, } } -static void n_tty_receive_buf (struct tty_struct *tty,const unsigned char *cp, -char *fp,int count) -{ -int room, n; - -down_read (&tty->termios_rwsem); - -while (1 ) { - room =receive_room (tty); - n =min (count, room); -if (!n) -break ; -__receive_buf (tty, cp, fp, n); - cp += n; -if (fp) - fp += n; - count -= n; - } - - tty->receive_room = room; -n_tty_check_throttle (tty); -up_read (&tty->termios_rwsem); -} - -static int n_tty_receive_buf2 (struct tty_struct *tty,const unsigned char *cp, -char *fp,int count) +static int +n_tty_receive_buf_common (struct tty_struct *tty,const unsigned char *cp, +char *fp,int count,int flow) {struct n_tty_data *ldata = tty->disc_data;int room, n, rcvd =0 ;
@@ -1719,7 +1696,7 @@ static int n_tty_receive_buf2(struct tty_struct *tty, const unsigned char *cp, room =receive_room (tty); n =min (count, room);if (!n) { -if (!room) +if (flow && !room) ldata->no_room =1 ;break ; }
@@ -1738,6 +1715,18 @@ static int n_tty_receive_buf2(struct tty_struct *tty, const unsigned char *cp,return rcvd; } +static void n_tty_receive_buf (struct tty_struct *tty,const unsigned char *cp, +char *fp,int count) +{ +n_tty_receive_buf_common (tty, cp, fp, count,0 ); +} + +static int n_tty_receive_buf2 (struct tty_struct *tty,const unsigned char *cp, +char *fp,int count) +{ +return n_tty_receive_buf_common (tty, cp, fp, count,1 ); +} +int is_ignored (int sig) { return (sigismember(¤t->blocked, sig) ||
Signature · 1 line
2.3.5
PATCH 10/83 conditionally define U32_MAX
In reply to Jiri SlabyFrom: Alex Elder <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 77719536dc00f8fd8f5abe6dadbde5331c37f996 upstream.
The symbol U32_MAX is defined in several spots. Change these definitions to be conditional. This is in preparation for the next patch, which centralizes the definition in <linux/kernel.h>.
--- fs/reiserfs/reiserfs.h | 2 ++ include/linux/ceph/decode.h | 2 ++ net/ipv4/tcp_illinois.c | 2 ++ 3 files changed, 6 insertions(+)
fs/reiserfs/reiserfs.h +2 -0
@@ -1958,7 +1958,9 @@ struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}#define MAX_US_INT 0xffff// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset +#ifndef U32_MAX #define U32_MAX (~(__u32)0) +#endif /* !U32_MAX */ static inline loff_t max_reiserfs_offset (struct inode *inode) {
include/linux/ceph/decode.h +2 -0
@@ -10,6 +10,7 @@/* This seemed to be the easiest place to define these */ +#ifndef U32_MAX #define U8_MAX ((u8)(~0U))#define U16_MAX ((u16)(~0U))#define U32_MAX ((u32)(~0U))
@@ -24,6 +25,7 @@#define S16_MIN ((s16)(-S16_MAX - 1))#define S32_MIN ((s32)(-S32_MAX - 1))#define S64_MIN ((s64)(-S64_MAX - 1LL)) +#endif /* !U32_MAX */ /* * in all cases,
net/ipv4/tcp_illinois.c +2 -0
@@ -23,7 +23,9 @@#define ALPHA_MIN ((3*ALPHA_SCALE)/10)/* ~0.3 */ #define ALPHA_MAX (10*ALPHA_SCALE)/* 10.0 */ #define ALPHA_BASE ALPHA_SCALE/* 1.0 */ +#ifndef U32_MAX #define U32_MAX ((u32)~0U) +#endif /* !U32_MAX */ #define RTT_MAX (U32_MAX / ALPHA_MAX)/* 3.3 secs */ #define BETA_SHIFT 6
Signature · 1 line
2.3.5
PATCH 11/83 kernel.h: define u8, s8, u32, etc. limits
In reply to Jiri SlabyFrom: Alex Elder <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 89a0714106aac7309c7dfa0f004b39e1e89d2942 upstream.
Create constants that define the maximum and minimum values representable by the kernel types u8, s8, u16, s16, and so on.
--- include/linux/kernel.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
include/linux/kernel.h +13 -0
@@ -29,6 +29,19 @@#define ULLONG_MAX (~0ULL)#define SIZE_MAX (~(size_t)0) +#define U8_MAX ((u8)~0U) +#define S8_MAX ((s8)(U8_MAX>>1)) +#define S8_MIN ((s8)(-S8_MAX - 1)) +#define U16_MAX ((u16)~0U) +#define S16_MAX ((s16)(U16_MAX>>1)) +#define S16_MIN ((s16)(-S16_MAX - 1)) +#define U32_MAX ((u32)~0U) +#define S32_MAX ((s32)(U32_MAX>>1)) +#define S32_MIN ((s32)(-S32_MAX - 1)) +#define U64_MAX ((u64)~0ULL) +#define S64_MAX ((s64)(U64_MAX>>1)) +#define S64_MIN ((s64)(-S64_MAX - 1)) +#define STACK_MAGIC 0xdeadbeef#define REPEAT_BYTE (x) ((~0ul / 0xff) * (x))
Signature · 1 line
2.3.5
PATCH 12/83 remove extra definitions of U32_MAX
In reply to Jiri SlabyFrom: Alex Elder <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 04f9b74e4d96d349de12fdd4e6626af4a9f75e09 upstream.
Now that the definition is centralized in <linux/kernel.h>, the definitions of U32_MAX (and related) elsewhere in the kernel can be removed.
--- fs/reiserfs/reiserfs.h | 4 ---- include/linux/ceph/decode.h | 19 ------------------- net/ipv4/tcp_illinois.c | 3 --- 3 files changed, 26 deletions(-)
fs/reiserfs/reiserfs.h +0 -4
@@ -1958,10 +1958,6 @@ struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}#define MAX_US_INT 0xffff// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset -#ifndef U32_MAX -#define U32_MAX (~(__u32)0) -#endif /* !U32_MAX */ -static inline loff_t max_reiserfs_offset (struct inode *inode) {if (get_inode_item_key_version (inode) ==KEY_FORMAT_3_5 )
include/linux/ceph/decode.h +0 -19
@@ -8,25 +8,6 @@#include <linux/ceph/types.h> -/* This seemed to be the easiest place to define these */ - -#ifndef U32_MAX -#define U8_MAX ((u8)(~0U)) -#define U16_MAX ((u16)(~0U)) -#define U32_MAX ((u32)(~0U)) -#define U64_MAX ((u64)(~0ULL)) - -#define S8_MAX ((s8)(U8_MAX >> 1)) -#define S16_MAX ((s16)(U16_MAX >> 1)) -#define S32_MAX ((s32)(U32_MAX >> 1)) -#define S64_MAX ((s64)(U64_MAX >> 1LL)) - -#define S8_MIN ((s8)(-S8_MAX - 1)) -#define S16_MIN ((s16)(-S16_MAX - 1)) -#define S32_MIN ((s32)(-S32_MAX - 1)) -#define S64_MIN ((s64)(-S64_MAX - 1LL)) -#endif /* !U32_MAX */ -/* * in all cases, * void **p pointer to position pointer
net/ipv4/tcp_illinois.c +0 -3
@@ -23,9 +23,6 @@#define ALPHA_MIN ((3*ALPHA_SCALE)/10)/* ~0.3 */ #define ALPHA_MAX (10*ALPHA_SCALE)/* 10.0 */ #define ALPHA_BASE ALPHA_SCALE/* 1.0 */ -#ifndef U32_MAX -#define U32_MAX ((u32)~0U) -#endif /* !U32_MAX */ #define RTT_MAX (U32_MAX / ALPHA_MAX)/* 3.3 secs */ #define BETA_SHIFT 6
Signature · 1 line
2.3.5
PATCH 13/83 ALSA: hda - Add one more node in the EAPD supporting candidate list
In reply to Jiri SlabyFrom: Hui Wang <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit af95b41426e0b58279f8ff0ebe420df49a4e96b8 upstream.
We have a HP machine which use the codec node 0x17 connecting the internal speaker, and from the node capability, we saw the EAPD, if we don't set the EAPD on for this node, the internal speaker can't output any sound.
--- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +1 -1
@@ -270,7 +270,7 @@ static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) {/* We currently only handle front, HP */ static hda_nid_t pins[] = { -0x0f ,0x10 ,0x14 ,0x15 ,0 +0x0f ,0x10 ,0x14 ,0x15 ,0x17 ,0 };hda_nid_t *p;for (p = pins; *p; p++)
Signature · 1 line
2.3.5
PATCH 14/83 ALSA: usb - Creative USB X-Fi Pro SB1095 volume knob support
In reply to Jiri SlabyFrom: "Dmitry M. Fedin" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3dc8523fa7412e731441c01fb33f003eb3cfece1 upstream.
Adds an entry for Creative USB X-Fi to the rc_config array in mixer_quirks.c to allow use of volume knob on the device. Adds support for newer X-Fi Pro card, known as "Model No. SB1095" with USB ID "041e:3237"
--- sound/usb/mixer_quirks.c | 1 + 1 file changed, 1 insertion(+)
sound/usb/mixer_quirks.c +1 -0
@@ -178,6 +178,7 @@ static const struct rc_config { { USB_ID(0x041e, 0x3040), 2, 2, 6, 6, 2, 0x6e91 }, /* Live! 24-bit */ { USB_ID(0x041e, 0x3042), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 */ { USB_ID(0x041e, 0x30df), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 Pro */ + { USB_ID(0x041e, 0x3237), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 Pro */ { USB_ID(0x041e, 0x3048), 2, 2, 6, 6, 2, 0x6e91 }, /* Toshiba SB0500 */ };
Signature · 1 line
2.3.5
PATCH 15/83 ALSA: hda/realtek - Make more stable to get pin sense for ALC283
In reply to Jiri SlabyFrom: Kailang Yang <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a59d7199f62b8336570972dcc288321d0ec999fe upstream.
Pin sense will active when power pin is wake up. Power pin will not wake up immediately during resume state. Add some delay to wait for power pin activated.
--- sound/pci/hda/patch_realtek.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_realtek.c +2 -0
@@ -2723,6 +2723,8 @@ static void alc283_init(struct hda_codec *codec)if (!hp_pin)return ; + +msleep (30 ); hp_pin_sense =snd_hda_jack_detect (codec, hp_pin);/* Index 0x43 Direct Drive HP AMP LPM Control 1 */
Signature · 1 line
2.3.5
PATCH 16/83 ALSA: hda - Fix headphone pin config for Lifebook T731
In reply to Jiri SlabyFrom: Takashi Iwai <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit cc7016ab1a22fb26f388c2fb2b692b89897cbc3e upstream.
Some BIOS version of Fujitsu Lifebook T731 seems to set up the headphone pin (0x21) without the assoc number 0x0f while it's set only to the output on the docking port (0x1a). With the recent commit [03ad6a8c93b6: ALSA: hda - Fix "PCM" name being used on one DAC when
there are two DACs], this resulted in the weird mixer element
mapping where the headphone on the laptop is assigned as a shared volume with the speaker and the docking port is assigned as an individual headphone.
This patch improves the situation by correcting the headphone pin config to the more appropriate value.
--- sound/pci/hda/patch_realtek.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/pci/hda/patch_realtek.c +9 -0
@@ -3710,6 +3710,7 @@ enum {ALC269_FIXUP_QUANTA_MUTE ,ALC269_FIXUP_LIFEBOOK ,ALC269_FIXUP_LIFEBOOK_EXTMIC , +ALC269_FIXUP_LIFEBOOK_HP_PIN ,ALC269_FIXUP_AMIC ,ALC269_FIXUP_DMIC , ALC269VB_FIXUP_AMIC,
@@ -3834,6 +3835,13 @@ static const struct hda_fixup alc269_fixups[] = { { } }, }, + [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x21, 0x0221102f }, /* HP out */ + { } + }, + }, [ALC269_FIXUP_AMIC] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) {
@@ -4133,6 +4141,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x104d ,0x9084 ,"Sony VAIO" ,ALC275_FIXUP_SONY_HWEQ ),SND_PCI_QUIRK_VENDOR (0x104d ,"Sony VAIO" ,ALC269_FIXUP_SONY_VAIO ),SND_PCI_QUIRK (0x10cf ,0x1475 ,"Lifebook" ,ALC269_FIXUP_LIFEBOOK ), +SND_PCI_QUIRK (0x10cf ,0x15dc ,"Lifebook T731" ,ALC269_FIXUP_LIFEBOOK_HP_PIN ),SND_PCI_QUIRK (0x10cf ,0x1845 ,"Lifebook U904" ,ALC269_FIXUP_LIFEBOOK_EXTMIC ),SND_PCI_QUIRK (0x17aa ,0x20f2 ,"Thinkpad SL410/510" ,ALC269_FIXUP_SKU_IGNORE ), SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
Signature · 1 line
2.3.5
PATCH 17/83 ARC: SA_SIGINFO ucontext regs off-by-one
In reply to Jiri SlabyFrom: Vineet Gupta <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6914e1e3f63caa829431160f0f7093292daef2d5 upstream.
The regfile provided to SA_SIGINFO signal handler as ucontext was off by one due to pt_regs gutter cleanups in 2013.
Before handling signal, user pt_regs are copied onto user_regs_struct and copied back later. Both structs are binary compatible. This was all fine until commit 2fa919045b72 (ARC: pt_regs update #2) which removed the empty stack slot at top of pt_regs (corresponding to first pad) and made the corresponding fixup in struct user_regs_struct (the pad in there was moved out of @scratch - not removed altogether as it is part of ptrace ABI)
struct user_regs_struct {
+ long pad;
struct {
- long pad;
long bta, lp_start, lp_end,....
} scratch; ...
}
This meant that now user_regs_struct was off by 1 reg w.r.t pt_regs and signal code needs to user_regs_struct.scratch to reflect it as pt_regs, which is what this commit does.
This problem was hidden for 2 years, because both save/restore, despite using wrong location, were using the same location. Only an interim inspection (reproducer below) exposed the issue.
void handle_segv(int signo, siginfo_t *info, void *context) {
ucontext_t *uc = context;
struct user_regs_struct *regs = &(uc->uc_mcontext.regs);
printf("regs %x %x\n", <=== prints 7 8 (vs. 8 9)
regs->scratch.r8, regs->scratch.r9);
}
int main()
{
struct sigaction sa;
sa.sa_sigaction = handle_segv;
sa.sa_flags = SA_SIGINFO;
sigemptyset(&sa.sa_mask);
sigaction(SIGSEGV, &sa, NULL);
asm volatile(
"mov r7, 7 \n"
"mov r8, 8 \n"
"mov r9, 9 \n"
"mov r10, 10 \n"
:::"r7","r8","r9","r10");
*((unsigned int*)0x10) = 0;
}--- arch/arc/kernel/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arc/kernel/signal.c +2 -2
@@ -67,7 +67,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, sigset_t *set) {int err; - err =__copy_to_user (&(sf->uc.uc_mcontext.regs), regs, + err =__copy_to_user (&(sf->uc.uc_mcontext.regs.scratch), regs,sizeof (sf->uc.uc_mcontext.regs.scratch)); err |=__copy_to_user (&sf->uc.uc_sigmask, set,sizeof (sigset_t));
@@ -83,7 +83,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)if (!err)set_current_blocked (&set); - err |=__copy_from_user (regs, &(sf->uc.uc_mcontext.regs), + err |=__copy_from_user (regs, &(sf->uc.uc_mcontext.regs.scratch),sizeof (sf->uc.uc_mcontext.regs.scratch));return err;
Signature · 1 line
2.3.5
PATCH 18/83 selinux: fix sel_write_enforce broken return value
In reply to Jiri SlabyFrom: Joe Perches <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6436a123a147db51a0b06024a8350f4c230e73ff upstream.
Return a negative error value like the rest of the entries in this function.
--- security/selinux/selinuxfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/selinuxfs.c +1 -1
@@ -150,7 +150,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf, goto out;/* No partial writes. */ - length =EINVAL ; + length = -EINVAL ;if (*ppos !=0 ) goto out;
Signature · 1 line
2.3.5
PATCH 19/83 tcp: Fix crash in TCP Fast Open
In reply to Jiri SlabyFrom: Ben Hutchings <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
Commit 355a901e6cf1 ("tcp: make connect() mem charging friendly") changed tcp_send_syn_data() to perform an open-coded copy of the 'syn' skb rather than using skb_copy_expand().
The open-coded copy does not cover the skb_shared_info::gso_segs field, so in the new skb it is left set to 0. When this commit was backported into stable branches between 3.10.y and 3.16.7-ckty inclusive, it triggered the BUG() in tcp_transmit_skb().
Since Linux 3.18 the GSO segment count is kept in the tcp_skb_cb::tcp_gso_segs field and tcp_send_syn_data() does copy the tcp_skb_cb structure to the new skb, so mainline and newer stable branches are not affected.
Set skb_shared_info::gso_segs to the correct value of 1.
--- net/ipv4/tcp_output.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/tcp_output.c +1 -0
@@ -2919,6 +2919,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) goto fallback; syn_data->ip_summed =CHECKSUM_PARTIAL ;memcpy (syn_data->cb, syn->cb,sizeof (syn->cb)); +skb_shinfo (syn_data)->gso_segs =1 ;if (unlikely (memcpy_fromiovecend (skb_put (syn_data, space), fo->data->msg_iov,0 , space))) {kfree_skb (syn_data);
Signature · 1 line
2.3.5
PATCH 20/83 IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic
In reply to Jiri SlabyFrom: Shachar Raindel <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8494057ab5e40df590ef6ef7d66324d3ae33356b upstream.
Properly verify that the resulting page aligned end address is larger than both the start address and the length of the memory area requested.
Both the start and length arguments for ib_umem_get are controlled by the user. A misbehaving user can provide values which will cause an integer overflow when calculating the page aligned end address.
This overflow can cause also miscalculation of the number of pages mapped, and additional logic issues.
Addresses: CVE-2014-8159
--- drivers/infiniband/core/umem.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/infiniband/core/umem.c +8 -0
@@ -94,6 +94,14 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,if (dmasync)dma_set_attr (DMA_ATTR_WRITE_BARRIER , &attrs); +/* +* If the combination of the addr and size requested for this memory +* region causes an integer overflow, return error. +*/ +if ((PAGE_ALIGN (addr + size) <= size) || + (PAGE_ALIGN (addr + size) <= addr)) +return ERR_PTR (-EINVAL ); +if (!can_do_mlock ())return ERR_PTR (-EPERM );
Signature · 1 line
2.3.5
PATCH 21/83 iwlwifi: dvm: run INIT firmware again upon .start()
In reply to Jiri SlabyFrom: Emmanuel Grumbach <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 9c8928f5176766bec79f272bd47b7124e11cccbd upstream.
The assumption before this patch was that we don't need to run again the INIT firmware after the system booted. The INIT firmware runs calibrations which impact the physical layer's behavior.
Users reported that it may be helpful to run these calibrations again every time the interface is brought up. The penatly is minimal, since the calibrations run fast. This fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=94341
--- drivers/net/wireless/iwlwifi/dvm/dev.h | 1 - drivers/net/wireless/iwlwifi/dvm/ucode.c | 5 ----- 2 files changed, 6 deletions(-)
drivers/net/wireless/iwlwifi/dvm/dev.h +0 -1
@@ -708,7 +708,6 @@ struct iwl_priv {unsigned long reload_jiffies;int reload_count;bool ucode_loaded; -bool init_ucode_run;/* Don't run init uCode again */ u8 plcp_delta_threshold;
drivers/net/wireless/iwlwifi/dvm/ucode.c +0 -5
@@ -425,9 +425,6 @@ int iwl_run_init_ucode(struct iwl_priv *priv)if (!priv->fw->img[IWL_UCODE_INIT ].sec[0 ].len)return 0 ; -if (priv->init_ucode_run) -return 0 ; -iwl_init_notification_wait (&priv->notif_wait, &calib_wait, calib_complete,ARRAY_SIZE (calib_complete), iwlagn_wait_calib, priv);
@@ -447,8 +444,6 @@ int iwl_run_init_ucode(struct iwl_priv *priv)*/ ret =iwl_wait_notification (&priv->notif_wait, &calib_wait,UCODE_CALIB_TIMEOUT ); -if (!ret) - priv->init_ucode_run = true; goto out;
Signature · 1 line
2.3.5
PATCH 22/83 nbd: fix possible memory leak
In reply to Jiri SlabyFrom: Sudip Mukherjee <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ff6b8090e26ef7649ef0cc6b42389141ef48b0cf upstream.
we have already allocated memory for nbd_dev, but we were not releasing that memory and just returning the error value.
--- drivers/block/nbd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/block/nbd.c +4 -4
@@ -814,10 +814,6 @@ static int __init nbd_init(void)return -EINVAL ; } - nbd_dev =kcalloc (nbds_max,sizeof (*nbd_dev),GFP_KERNEL ); -if (!nbd_dev) -return -ENOMEM ; - part_shift =0 ;if (max_part >0 ) { part_shift =fls (max_part);
@@ -839,6 +835,10 @@ static int __init nbd_init(void)if (nbds_max >1UL << (MINORBITS - part_shift))return -EINVAL ; + nbd_dev =kcalloc (nbds_max,sizeof (*nbd_dev),GFP_KERNEL ); +if (!nbd_dev) +return -ENOMEM ; +for (i =0 ; i < nbds_max; i++) {struct gendisk *disk =alloc_disk (1 << part_shift);if (!disk)
Signature · 1 line
2.3.5
PATCH 23/83 mm/memory hotplug: postpone the reset of obsolete pgdat
In reply to Jiri SlabyFrom: Gu Zheng <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b0dc3a342af36f95a68fe229b8f0f73552c5ca08 upstream.
Qiu Xishi reported the following BUG when testing hot-add/hot-remove node under stress condition:
BUG: unable to handle kernel paging request at 0000000000025f60
IP: next_online_pgdat+0x1/0x50
PGD 0
Oops: 0000 [#1] SMP
ACPI: Device does not support D3cold
Modules linked in: fuse nls_iso8859_1 nls_cp437 vfat fat loop dm_mod coretemp mperf crc32c_intel ghash_clmulni_intel aesni_intel ablk_helper cryptd lrw gf128mul glue_helper aes_x86_64 pcspkr microcode igb dca i2c_algo_bit ipv6 megaraid_sas iTCO_wdt i2c_i801 i2c_core iTCO_vendor_support tg3 sg hwmon ptp lpc_ich pps_core mfd_core acpi_pad rtc_cmos button ext3 jbd mbcache sd_mod crc_t10dif scsi_dh_alua scsi_dh_rdac scsi_dh_hp_sw scsi_dh_emc scsi_dh ahci libahci libata scsi_mod [last unloaded: rasf]
CPU: 23 PID: 238 Comm: kworker/23:1 Tainted: G O 3.10.15-5885-euler0302 #1
Hardware name: HUAWEI TECHNOLOGIES CO.,LTD. Huawei N1/Huawei N1, BIOS V100R001 03/02/2015
Workqueue: events vmstat_update
task: ffffa800d32c0000 ti: ffffa800d32ae000 task.ti: ffffa800d32ae000
RIP: 0010: next_online_pgdat+0x1/0x50
RSP: 0018:ffffa800d32afce8 EFLAGS: 00010286
RAX: 0000000000001440 RBX: ffffffff81da53b8 RCX: 0000000000000082
RDX: 0000000000000000 RSI: 0000000000000082 RDI: 0000000000000000
RBP: ffffa800d32afd28 R08: ffffffff81c93bfc R09: ffffffff81cbdc96
R10: 00000000000040ec R11: 00000000000000a0 R12: ffffa800fffb3440
R13: ffffa800d32afd38 R14: 0000000000000017 R15: ffffa800e6616800
FS: 0000000000000000(0000) GS:ffffa800e6600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000025f60 CR3: 0000000001a0b000 CR4: 00000000001407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
refresh_cpu_vm_stats+0xd0/0x140
vmstat_update+0x11/0x50
process_one_work+0x194/0x3d0
worker_thread+0x12b/0x410
kthread+0xc6/0xd0
ret_from_fork+0x7c/0xb0The cause is the "memset(pgdat, 0, sizeof(*pgdat))" at the end of try_offline_node, which will reset all the content of pgdat to 0, as the pgdat is accessed lock-free, so that the users still using the pgdat will panic, such as the vmstat_update routine.
process A: offline node XX:
vmstat_updat()
refresh_cpu_vm_stats()
for_each_populated_zone()
find online node XX
cond_resched()
offline cpu and memory, then try_offline_node() node_set_offline(nid), and memset(pgdat, 0, sizeof(*pgdat))
zone = next_zone(zone)
pg_data_t *pgdat = zone->zone_pgdat; // here pgdat is NULL now
next_online_pgdat(pgdat)
next_online_node(pgdat->node_id); // NULL pointer access
So the solution here is postponing the reset of obsolete pgdat from try_offline_node() to hotadd_new_pgdat(), and just resetting pgdat->nr_zones and pgdat->classzone_idx to be 0 rather than the memset 0 to avoid breaking pointer information in pgdat.
--- mm/memory_hotplug.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
mm/memory_hotplug.c +4 -9
@@ -1018,6 +1018,10 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)return NULL ;arch_refresh_nodedata (nid, pgdat); + }else { +/* Reset the nr_zones and classzone_idx to 0 before reuse */ + pgdat->nr_zones =0 ; + pgdat->classzone_idx =0 ; }/* we can use NODE_DATA(nid) from here */
@@ -1821,15 +1825,6 @@ void try_offline_node(int nid)if (is_vmalloc_addr (zone->wait_table))vfree (zone->wait_table); } - -/* -* Since there is no way to guarentee the address of pgdat/zone is not -* on stack of any kernel threads or used by other kernel objects -* without reference counting or other symchronizing method, do not -* reset node_data and free pgdat here. Just reset it to 0 and reuse -* the memory when the node is online again. -*/ -memset (pgdat,0 ,sizeof (*pgdat)); }EXPORT_SYMBOL (try_offline_node);
Signature · 1 line
2.3.5
PATCH 24/83 sched: Fix RLIMIT_RTTIME when PI-boosting to RT
In reply to Jiri SlabyFrom: Brian Silverman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 746db9443ea57fd9c059f62c4bfbf41cf224fe13 upstream.
When non-realtime tasks get priority-inheritance boosted to a realtime scheduling class, RLIMIT_RTTIME starts to apply to them. However, the counter used for checking this (the same one used for SCHED_RR timeslices) was not getting reset. This meant that tasks running with a non-realtime scheduling class which are repeatedly boosted to a realtime one, but never block while they are running realtime, eventually hit the timeout without ever running for a time over the limit. This patch resets the realtime timeslice counter when un-PI-boosting from an RT to a non-RT scheduling class.
I have some test code with two threads and a shared PTHREAD_PRIO_INHERIT mutex which induces priority boosting and spins while boosted that gets killed by a SIGXCPU on non-fixed kernels but doesn't with this patch applied. It happens much faster with a CONFIG_PREEMPT_RT kernel, and does happen eventually with PREEMPT_VOLUNTARY kernels.
--- kernel/sched/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
kernel/sched/core.c +4 -1
@@ -3060,8 +3060,11 @@ void rt_mutex_setprio(struct task_struct *p, int prio)if (rt_prio (prio)) p->sched_class = &rt_sched_class; -else +else { +if (rt_prio (oldprio)) + p->rt.timeout =0 ; p->sched_class = &fair_sched_class; + } p->prio = prio;
Signature · 1 line
2.3.5
PATCH 25/83 writeback: add missing INITIAL_JIFFIES init in global_update_bandwidth()
In reply to Jiri SlabyFrom: Tejun Heo <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 7d70e15480c0450d2bfafaad338a32e884fc215e upstream.
global_update_bandwidth() uses static variable update_time as the timestamp for the last update but forgets to initialize it to INITIALIZE_JIFFIES.
This means that global_dirty_limit will be 5 mins into the future on 32bit and some large amount jiffies into the past on 64bit. This isn't critical as the only effect is that global_dirty_limit won't be updated for the first 5 mins after booting on 32bit machines, especially given the auxiliary nature of global_dirty_limit's role - protecting against global dirty threshold's sudden dips; however, it does lead to unintended suboptimal behavior. Fix it.
--- mm/page-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page-writeback.c +1 -1
@@ -943,7 +943,7 @@ static void global_update_bandwidth(unsigned long thresh, unsigned long now) {static DEFINE_SPINLOCK (dirty_lock); -static unsigned long update_time; +static unsigned long update_time =INITIAL_JIFFIES ;/* * check locklessly first to optimize away locking for the most time
Signature · 1 line
2.3.5
PATCH 26/83 writeback: fix possible underflow in write bandwidth calculation
In reply to Jiri SlabyFrom: Tejun Heo <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c72efb658f7c8b27ca3d0efb5cfd5ded9fcac89e upstream.
Quoted 1 line
From
1ebf33901ecc75d9496862dceb1ef0377980587cMon Sep 17 00:00:00 2001
From: Tejun Heo <[email protected]>
Date: Mon, 23 Mar 2015 00:08:19 -0400
2f800fbd777b ("writeback: fix dirtied pages accounting on redirty") introduced account_page_redirty() which reverts stat updates for a redirtied page, making BDI_DIRTIED no longer monotonically increasing.
bdi_update_write_bandwidth() uses the delta in BDI_DIRTIED as the basis for bandwidth calculation. While unlikely, since the above patch, the newer value may be lower than the recorded past value and underflow the bandwidth calculation leading to a wild result.
Fix it by subtracing min of the old and new values when calculating delta. AFAIK, there hasn't been any report of it happening but the resulting erratic behavior would be non-critical and temporary, so it's possible that the issue is happening without being reported. The risk of the fix is very low, so tagged for -stable.
--- mm/page-writeback.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
mm/page-writeback.c +4 -1
@@ -878,8 +878,11 @@ static void bdi_update_write_bandwidth(struct backing_dev_info *bdi,* bw * elapsed + write_bandwidth * (period - elapsed) * write_bandwidth = --------------------------------------------------- * period +* +* @written may have decreased due to account_page_redirty(). +* Avoid underflowing @bw calculation. */ - bw = written - bdi->written_stamp; + bw = written -min (written, bdi->written_stamp); bw *=HZ ;if (unlikely (elapsed > period)) {do_div (bw, elapsed);
Signature · 1 line
2.3.5
PATCH 27/83 radeon: Do not directly dereference pointers to BIOS area.
In reply to Jiri SlabyFrom: David Miller <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f2c9e560b406f2f6b14b345c7da33467dee9cdf2 upstream.
Use readb() and memcpy_fromio() accessors instead.
--- drivers/gpu/drm/radeon/radeon_bios.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon_bios.c +7 -3
@@ -76,7 +76,7 @@ static bool igp_read_bios_from_vram(struct radeon_device *rdev)static bool radeon_read_bios (struct radeon_device *rdev) { -uint8_t __iomem *bios; +uint8_t __iomem *bios, val1, val2;size_t size; rdev->bios =NULL ;
@@ -86,15 +86,19 @@ static bool radeon_read_bios(struct radeon_device *rdev)return false; } -if (size ==0 || bios[0 ] !=0x55 || bios[1 ] !=0xaa ) { + val1 =readb (&bios[0 ]); + val2 =readb (&bios[1 ]); + +if (size ==0 || val1 !=0x55 || val2 !=0xaa ) {pci_unmap_rom (rdev->pdev, bios);return false; } - rdev->bios =kmemdup (bios, size,GFP_KERNEL ); + rdev->bios =kzalloc (size,GFP_KERNEL );if (rdev->bios ==NULL ) {pci_unmap_rom (rdev->pdev, bios);return false; } +memcpy_fromio (rdev->bios, bios, size);pci_unmap_rom (rdev->pdev, bios);return true; }
Signature · 1 line
2.3.5
PATCH 28/83 USB: ftdi_sio: Added custom PID for Synapse Wireless product
In reply to Jiri SlabyFrom: Doug Goldstein <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4899c054a90439477b24da8977db8d738376fe90 upstream.
Synapse Wireless uses the FTDI VID with a custom PID of 0x9090 for their SNAP Stick 200 product.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -618,6 +618,7 @@ static struct usb_device_id id_table_combined [] = { .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) }, /* * ELV devices: */
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -561,6 +561,12 @@*/ #define FTDI_NT_ORIONLXM_PID 0x7c90/* OrionLXm Substation Automation Platform */ +/* +* Synapse Wireless product ids (FTDI_VID) +* http://www.synapse-wireless.com +*/ +#define FTDI_SYNAPSE_SS200_PID 0x9090/* SS200 - SNAP Stick 200 */ +/********************************/ /** third-party VID/PID combos **/
Signature · 1 line
2.3.5
PATCH 29/83 USB: ftdi_sio: Use jtag quirk for SNAP Connect E10
In reply to Jiri SlabyFrom: Doug Goldstein <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b229a0f840f774d29d8fedbf5deb344ca36b7f1a upstream.
This patch uses the existing CALAO Systems ftdi_8u2232c_probe in order to avoid attaching a TTY to the JTAG port as this board is based on the CALAO Systems reference design and needs the same fix up.
--- drivers/usb/serial/ftdi_sio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/usb/serial/ftdi_sio.c +6 -2
@@ -1906,8 +1906,12 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial) {struct usb_device *udev = serial->dev; -if ((udev->manufacturer && !strcmp (udev->manufacturer,"CALAO Systems" )) || - (udev->product && !strcmp (udev->product,"BeagleBone/XDS100V2" ))) +if (udev->manufacturer && !strcmp (udev->manufacturer,"CALAO Systems" )) +return ftdi_jtag_probe (serial); + +if (udev->product && + (!strcmp (udev->product,"BeagleBone/XDS100V2" ) || + !strcmp (udev->product,"SNAP Connect E10" )))return ftdi_jtag_probe (serial);return 0 ;
Signature · 1 line
2.3.5
PATCH 30/83 Defer processing of REQ_PREEMPT requests for blocked devices
In reply to Jiri SlabyFrom: Bart Van Assche <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit bba0bdd7ad4713d82338bcd9b72d57e9335a664b upstream.
SCSI transport drivers and SCSI LLDs block a SCSI device if the transport layer is not operational. This means that in this state no requests should be processed, even if the REQ_PREEMPT flag has been set. This patch avoids that a rescan shortly after a cable pull sporadically triggers the following kernel oops:
BUG: unable to handle kernel paging request at ffffc9001a6bc084 IP: [<ffffffffa04e08f2>] mlx4_ib_post_send+0xd2/0xb30 [mlx4_ib] Process rescan-scsi-bus (pid: 9241, threadinfo ffff88053484a000, task ffff880534aae100) Call Trace: [<ffffffffa0718135>] srp_post_send+0x65/0x70 [ib_srp] [<ffffffffa071b9df>] srp_queuecommand+0x1cf/0x3e0 [ib_srp] [<ffffffffa0001ff1>] scsi_dispatch_cmd+0x101/0x280 [scsi_mod] [<ffffffffa0009ad1>] scsi_request_fn+0x411/0x4d0 [scsi_mod] [<ffffffff81223b37>] __blk_run_queue+0x27/0x30 [<ffffffff8122a8d2>] blk_execute_rq_nowait+0x82/0x110 [<ffffffff8122a9c2>] blk_execute_rq+0x62/0xf0 [<ffffffffa000b0e8>] scsi_execute+0xe8/0x190 [scsi_mod] [<ffffffffa000b2f3>] scsi_execute_req+0xa3/0x130 [scsi_mod] [<ffffffffa000c1aa>] scsi_probe_lun+0x17a/0x450 [scsi_mod] [<ffffffffa000ce86>] scsi_probe_and_add_lun+0x156/0x480 [scsi_mod] [<ffffffffa000dc2f>] __scsi_scan_target+0xdf/0x1f0 [scsi_mod] [<ffffffffa000dfa3>] scsi_scan_host_selected+0x183/0x1c0 [scsi_mod] [<ffffffffa000edfb>] scsi_scan+0xdb/0xe0 [scsi_mod] [<ffffffffa000ee13>] store_scan+0x13/0x20 [scsi_mod] [<ffffffff811c8d9b>] sysfs_write_file+0xcb/0x160 [<ffffffff811589de>] vfs_write+0xce/0x140 [<ffffffff81158b53>] sys_write+0x53/0xa0 [<ffffffff81464592>] system_call_fastpath+0x16/0x1b [<00007f611c9d9300>] 0x7f611c9d92ff
--- drivers/scsi/scsi_lib.c | 4 +++- include/linux/blk_types.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/scsi/scsi_lib.c +3 -1
@@ -1258,9 +1258,11 @@ int scsi_prep_state_check(struct scsi_device *sdev, struct request *req) "rejecting I/O to dead device\n"); ret =BLKPREP_KILL ;break ; -case SDEV_QUIESCE :case SDEV_BLOCK :case SDEV_CREATED_BLOCK : + ret =BLKPREP_DEFER ; +break ; +case SDEV_QUIESCE :/* * If the devices is blocked we defer normal commands. */
include/linux/blk_types.h +3 -1
@@ -170,7 +170,9 @@ enum rq_flag_bits { __REQ_ELVPRIV,/* elevator private data attached */ __REQ_FAILED,/* set if the request failed */ __REQ_QUIET,/* don't worry about errors */ - __REQ_PREEMPT,/* set for "ide_preempt" requests */ + __REQ_PREEMPT,/* set for "ide_preempt" requests and also +for requests for which the SCSI "quiesce" +state must be ignored. */ __REQ_ALLOCED,/* request came from our alloc pool */ __REQ_COPY_USER,/* contains copies of user pages */ __REQ_FLUSH_SEQ, /* request for flush sequence */
Signature · 1 line
2.3.5
PATCH 31/83 iio: inv_mpu6050: Clear timestamps fifo while resetting hardware fifo
In reply to Jiri SlabyFrom: Viorel Suman <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4dac0a8eefd55bb1f157d1a5a084531334a2d74c upstream.
A hardware fifo reset always imply an invalidation of the existing timestamps, so we'll clear timestamps fifo on successfull hardware fifo reset.
--- drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c +14 -11
@@ -25,6 +25,16 @@#include <linux/poll.h> #include "inv_mpu_iio.h" +static void inv_clear_kfifo (struct inv_mpu6050_state *st) +{ +unsigned long flags; + +/* take the spin lock sem to avoid interrupt kick in */ +spin_lock_irqsave (&st->time_stamp_lock, flags); +kfifo_reset (&st->timestamps); +spin_unlock_irqrestore (&st->time_stamp_lock, flags); +} +int inv_reset_fifo (struct iio_dev *indio_dev) {int result;
@@ -51,6 +61,10 @@ int inv_reset_fifo(struct iio_dev *indio_dev) INV_MPU6050_BIT_FIFO_RST);if (result) goto reset_fifo_fail; + +/* clear timestamps fifo */ +inv_clear_kfifo (st); +/* enable interrupt */ if (st->chip_config.accl_fifo_enable || st->chip_config.gyro_fifo_enable) {
@@ -84,16 +98,6 @@ reset_fifo_fail:return result; } -static void inv_clear_kfifo (struct inv_mpu6050_state *st) -{ -unsigned long flags; - -/* take the spin lock sem to avoid interrupt kick in */ -spin_lock_irqsave (&st->time_stamp_lock, flags); -kfifo_reset (&st->timestamps); -spin_unlock_irqrestore (&st->time_stamp_lock, flags); -} -/** * inv_mpu6050_irq_handler() - Cache a timestamp at each data ready interrupt. */
@@ -187,7 +191,6 @@ end_session: flush_fifo:/* Flush HW and SW FIFOs. */ inv_reset_fifo (indio_dev); -inv_clear_kfifo (st);mutex_unlock (&indio_dev->mlock);iio_trigger_notify_done (indio_dev->trig);
Signature · 1 line
2.3.5
PATCH 32/83 iio: imu: Use iio_trigger_get for indio_dev->trig assignment
In reply to Jiri SlabyFrom: Darshana Padmadas <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4ce7ca89d6e8eae9e201cd0e972ba323f33e2fb4 upstream.
This patch uses iio_trigger_get to increment the reference count of trigger device, to avoid incorrect assignment. Can result in a null pointer dereference during removal if the trigger has been changed before removal.
This patch refers to a similar situation encountered through the following discussion:
http://www.spinics.net/lists/linux-iio/msg13669.html
--- drivers/iio/imu/adis_trigger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/adis_trigger.c +1 -1
@@ -60,7 +60,7 @@ int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)iio_trigger_set_drvdata (adis->trig, adis); ret =iio_trigger_register (adis->trig); - indio_dev->trig = adis->trig; + indio_dev->trig =iio_trigger_get (adis->trig);if (ret) goto error_free_irq;
Signature · 1 line
2.3.5
PATCH 33/83 dmaengine: omap-dma: Fix memory leak when terminating running transfer
In reply to Jiri SlabyFrom: Peter Ujfalusi <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 02d88b735f5a60f04dbf6d051b76e1877a0d0844 upstream.
In omap_dma_start_desc the vdesc->node is removed from the virt-dma framework managed lists (to be precise from the desc_issued list). If a terminate_all comes before the transfer finishes the omap_desc will not be freed up because it is not in any of the lists and we stopped the DMA channel so the transfer will not going to complete.
There is no special sequence for leaking memory when using cyclic (audio)
transfer: with every start and stop of a cyclic transfer the driver leaks struct omap_desc worth of memory.
Free up the allocated memory directly in omap_dma_terminate_all() since the framework will not going to do that for us.
--- drivers/dma/omap-dma.c | 1 + 1 file changed, 1 insertion(+)
drivers/dma/omap-dma.c +1 -0
@@ -487,6 +487,7 @@ static int omap_dma_terminate_all(struct omap_chan *c)* c->desc is NULL and exit.) */ if (c->desc) { +omap_dma_desc_free (&c->desc->vd); c->desc =NULL ;/* Avoid stopping the dma twice */ if (!c->paused)
Signature · 1 line
2.3.5
PATCH 34/83 x86/reboot: Add ASRock Q1900DC-ITX mainboard reboot quirk
In reply to Jiri SlabyFrom: Stefan Lippers-Hollmann <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 80313b3078fcd2ca51970880d90757f05879a193 upstream.
The ASRock Q1900DC-ITX mainboard (Baytrail-D) hangs randomly in both BIOS and UEFI mode while rebooting unless reboot=pci is used. Add a quirk to reboot via the pci method.
The problem is very intermittent and hard to debug, it might succeed rebooting just fine 40 times in a row - but fails half a dozen times the next day. It seems to be slightly less common in BIOS CSM mode than native UEFI (with the CSM disabled), but it does happen in either mode. Since I've started testing this patch in late january, rebooting has been 100% reliable.
Most of the time it already hangs during POST, but occasionally it might even make it through the bootloader and the kernel might even start booting, but then hangs before the mode switch. The same symptoms occur with grub-efi, gummiboot and grub-pc, just as well as (at least) kernel 3.16-3.19 and 4.0-rc6 (I haven't tried older kernels than 3.16). Upgrading to the most current mainboard firmware of the ASRock Q1900DC-ITX, version 1.20, does not improve the situation.
( Searching the web seems to suggest that other Bay Trail-D mainboards
might be affected as well. )
--
--- arch/x86/kernel/reboot.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/x86/kernel/reboot.c +10 -0
@@ -181,6 +181,16 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { }, }, +/* ASRock */ + {/* Handle problems with rebooting on ASRock Q1900DC-ITX */ + .callback = set_pci_reboot, + .ident = "ASRock Q1900DC-ITX", + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"ASRock" ), + DMI_MATCH(DMI_BOARD_NAME, "Q1900DC-ITX"), + }, + }, + /* ASUS */ { /* Handle problems with rebooting on ASUS P4S800 */ .callback = set_bios_reboot,
Signature · 1 line
2.3.5
PATCH 35/83 can: flexcan: Deferred on Regulator return EPROBE_DEFER
In reply to Jiri SlabyFrom: Andreas Werner <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 555828ef45f825d6ee06559f0304163550eed380 upstream.
Return EPROBE_DEFER if Regulator returns EPROBE_DEFER
If the Flexcan driver is built into kernel and a regulator is used to enable the CAN transceiver, the Flexcan driver may not use the regulator.
When initializing the Flexcan device with a regulator defined in the device tree, but not initialized, the regulator subsystem returns EPROBE_DEFER, hence the Flexcan init fails.
The solution for this is to return EPROBE_DEFER if regulator is not initialized and wait until the regulator is initialized.
--- drivers/net/can/flexcan.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/can/flexcan.c +8 -3
@@ -1046,12 +1046,19 @@ static int flexcan_probe(struct platform_device *pdev)const struct flexcan_devtype_data *devtype_data;struct net_device *dev;struct flexcan_priv *priv; +struct regulator *reg_xceiver;struct resource *mem;struct clk *clk_ipg =NULL , *clk_per =NULL ;void __iomem *base;int err, irq;u32 clock_freq =0 ; + reg_xceiver =devm_regulator_get (&pdev->dev,"xceiver" ); +if (PTR_ERR (reg_xceiver) == -EPROBE_DEFER ) +return -EPROBE_DEFER ; +else if (IS_ERR (reg_xceiver)) + reg_xceiver =NULL ; +if (pdev->dev.of_node)of_property_read_u32 (pdev->dev.of_node,"clock-frequency" , &clock_freq);
@@ -1113,9 +1120,7 @@ static int flexcan_probe(struct platform_device *pdev) priv->pdata = pdev->dev.platform_data; priv->devtype_data = devtype_data; - priv->reg_xceiver =devm_regulator_get (&pdev->dev,"xceiver" ); -if (IS_ERR (priv->reg_xceiver)) - priv->reg_xceiver =NULL ; + priv->reg_xceiver = reg_xceiver;netif_napi_add (dev, &priv->napi, flexcan_poll,FLEXCAN_NAPI_WEIGHT );
Signature · 1 line
2.3.5
PATCH 36/83 usb: xhci: handle Config Error Change (CEC) in xhci driver
In reply to Jiri SlabyFrom: Lu Baolu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 9425183d177aa4a2f09d01a74925124f0778b595 upstream.
Linux xHCI driver doesn't report and handle port cofig error change. If Port Configure Error for root hub port occurs, CEC bit in PORTSC would be set by xHC and remains 1. This happends when the root port fails to configure its link partner, e.g. the port fails to exchange port capabilities information using Port Capability LMPs.
Then the Port Status Change Events will be blocked until all status change bits(CEC is one of the change bits) are cleared('0') (refer to xHCI spec 4.19.2). Otherwise, the port status change event for this root port will not be generated anymore, then root port would look like dead for user and can't be recovered until a Host Controller Reset(HCRST).
This patch is to check CEC bit in PORTSC in xhci_get_port_status() and set a Config Error in the return status if CEC is set. This will cause a ClearPortFeature request, where CEC bit is cleared in xhci_clear_port_change_bit().
[The commit log is based on initial Marvell patch posted at
http://marc.info/?l=linux-kernel&m=142323612321434&w=2]
--- drivers/usb/host/xhci-hub.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-hub.c +8 -1
@@ -383,6 +383,10 @@ static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue, status =PORT_PLC ; port_change_bit ="link state" ;break ; +case USB_PORT_FEAT_C_PORT_CONFIG_ERROR : + status =PORT_CEC ; + port_change_bit ="config error" ; +break ;default :/* Should never happen */ return ;
@@ -583,6 +587,8 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, status |=USB_PORT_STAT_C_LINK_STATE <<16 ;if ((raw_port_status &PORT_WRC )) status |=USB_PORT_STAT_C_BH_RESET <<16 ; +if ((raw_port_status &PORT_CEC )) + status |=USB_PORT_STAT_C_CONFIG_ERROR <<16 ; }if (hcd->speed !=HCD_USB3 ) {
@@ -1001,6 +1007,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,case USB_PORT_FEAT_C_OVER_CURRENT :case USB_PORT_FEAT_C_ENABLE :case USB_PORT_FEAT_C_PORT_LINK_STATE : +case USB_PORT_FEAT_C_PORT_CONFIG_ERROR :xhci_clear_port_change_bit (xhci, wValue, wIndex, port_array[wIndex], temp);break ;
@@ -1066,7 +1073,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)*/ status = bus_state->resuming_ports; - mask =PORT_CSC |PORT_PEC |PORT_OCC |PORT_PLC |PORT_WRC ; + mask =PORT_CSC |PORT_PEC |PORT_OCC |PORT_PLC |PORT_WRC |PORT_CEC ;spin_lock_irqsave (&xhci->lock, flags);/* For each port, did anything change? If so, set that bit in buf. */
Signature · 1 line
2.3.5
PATCH 37/83 usb: xhci: apply XHCI_AVOID_BEI quirk to all Intel xHCI controllers
In reply to Jiri SlabyFrom: Lu Baolu <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 227a4fd801c8a9fa2c4700ab98ec1aec06e3b44d upstream.
When a device with an isochronous endpoint is plugged into the Intel xHCI host controller, and the driver submits multiple frames per URB, the xHCI driver will set the Block Event Interrupt (BEI) flag on all but the last TD for the URB. This causes the host controller to place an event on the event ring, but not send an interrupt. When the last TD for the URB completes, BEI is cleared, and we get an interrupt for the whole URB.
However, under Intel xHCI host controllers, if the event ring is full of events from transfers with BEI set, an "Event Ring is Full" event will be posted to the last entry of the event ring, but no interrupt is generated. Host will cease all transfer and command executions and wait until software completes handling the pending events in the event ring. That means xHC stops, but event of "event ring is full" is not notified. As the result, the xHC looks like dead to user.
This patch is to apply XHCI_AVOID_BEI quirk to Intel xHC devices. And it should be backported to kernels as old as 3.0, that contains the commit 69e848c2090a ("Intel xhci: Support EHCI/xHCI port switching.").
--- drivers/usb/host/xhci-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-pci.c +1 -1
@@ -108,6 +108,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)if (pdev->vendor ==PCI_VENDOR_ID_INTEL ) { xhci->quirks |=XHCI_LPM_SUPPORT ; xhci->quirks |=XHCI_INTEL_HOST ; + xhci->quirks |=XHCI_AVOID_BEI ; }if (pdev->vendor ==PCI_VENDOR_ID_INTEL && pdev->device ==PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI ) {
@@ -123,7 +124,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)* PPT chipsets. */ xhci->quirks |=XHCI_SPURIOUS_REBOOT ; - xhci->quirks |=XHCI_AVOID_BEI ; }if (pdev->vendor ==PCI_VENDOR_ID_INTEL && pdev->device ==PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI ) {
Signature · 1 line
2.3.5
PATCH 38/83 tty: serial: fsl_lpuart: clear receive flag on FIFO flush
In reply to Jiri SlabyFrom: Stefan Agner <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8e4934c6d6c659e22b1b746af4196683e77ce6ca upstream.
When the receiver was enabled during startup, a character could have been in the FIFO when the UART get initially used. The driver configures the (receive) watermark level, and flushes the FIFO. However, the receive flag (RDRF) could still be set at that stage (as mentioned in the register description of UARTx_RWFIFO). This leads to an interrupt which won't be handled properly in interrupt mode: The receive interrupt function lpuart_rxint checks the FIFO count, which is 0 at that point (due to the flush during initialization). The problem does not manifest when using DMA to receive characters.
Fix this situation by explicitly read the status register, which leads to clearing of the RDRF flag. Due to the flush just after the status flag read, a explicit data read is not to required.
--- drivers/tty/serial/fsl_lpuart.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/fsl_lpuart.c +3 -0
@@ -362,6 +362,9 @@ static void lpuart_setup_watermark(struct lpuart_port *sport)writeb (val |UARTPFIFO_TXFE |UARTPFIFO_RXFE , sport->port.membase +UARTPFIFO ); +/* explicitly clear RDRF */ +readb (sport->port.membase +UARTSR1 ); +/* flush Tx and Rx FIFO */ writeb (UARTCFIFO_TXFLUSH |UARTCFIFO_RXFLUSH , sport->port.membase +UARTCFIFO );
Signature · 1 line
2.3.5
PATCH 39/83 n_tty: Fix read buffer overwrite when no newline
In reply to Jiri SlabyFrom: Peter Hurley <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fb5ef9e7da39968fec6d6f37f20a23d23740c75e upstream.
In canon mode, the read buffer head will advance over the buffer tail if the input > 4095 bytes without receiving a line termination char.
Discard additional input until a line termination is received. Before evaluating for overflow, the 'room' value is normalized for I_PARMRK and 1 byte is reserved for line termination (even in !icanon mode, in case the mode is switched). The following table shows the transform:
actual buffer | 'room' value before overflow calc
space avail | !I_PARMRK | I_PARMRK
--------------------------------------------------
0 | -1 | -1
1 | 0 | 0
2 | 1 | 0
3 | 2 | 0
4+ | 3 | 1When !icanon or when icanon and the read buffer contains newlines, normalized 'room' values of -1 and 0 are clamped to 0, and 'overflow' is 0, so read_head is not adjusted and the input i/o loop exits (setting no_room if called from flush_to_ldisc()). No input is discarded since the reader does have input available to read which ensures forward progress.
When icanon and the read buffer does not contain newlines and the normalized 'room' value is 0, then overflow and room are reset to 1, so that the i/o loop will process the next input char normally (except for parity errors which are ignored). Thus, erasures, signalling chars, 7-bit mode, etc. will continue to be handled properly.
If the input char processed was not a line termination char, then the canon_head index will not have advanced, so the normalized 'room' value will now be -1 and 'overflow' will be set, which indicates the read_head can safely be reset, effectively erasing the last char processed.
If the input char processed was a line termination, then the canon_head index will have advanced, so 'overflow' is cleared to 0, the read_head is not reset, and 'room' is cleared to 0, which exits the i/o loop (because the reader now have input available to read which ensures forward progress).
Note that it is possible for a line termination to be received, and for the reader to copy the line to the user buffer before the input i/o loop is ready to process the next input char. This is why the i/o loop recomputes the room/overflow state with every input char while handling overflow.
Finally, if the input data was processed without receiving a line termination (so that overflow is still set), the pty driver must receive a write wakeup. A pty writer may be waiting to write more data in n_tty_write() but without unthrottling here that wakeup will not arrive, and forward progress will halt. (Normally, the pty writer is woken when the reader reads data out of the buffer and more space become available).
--- drivers/tty/n_tty.c | 106 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 27 deletions(-)
drivers/tty/n_tty.c +79 -27
@@ -246,8 +246,6 @@ static void n_tty_write_wakeup(struct tty_struct *tty)static void n_tty_check_throttle (struct tty_struct *tty) { -if (tty->driver->type ==TTY_DRIVER_TYPE_PTY ) -return ;/* * Check the remaining room for the input canonicalization * mode. We don't want to throttle the driver if we're in
@@ -1511,23 +1509,6 @@ n_tty_receive_char_lnext(struct tty_struct *tty, unsigned char c, char flag)n_tty_receive_char_flagged (tty, c, flag); } -/** -* n_tty_receive_buf - data receive -* @tty: terminal device -* @cp: buffer -* @fp: flag buffer -* @count: characters -* -* Called by the terminal driver when a block of characters has -* been received. This function must be called from soft contexts -* not from interrupt context. The driver is responsible for making -* calls one at a time and in order (or using flush_to_ldisc) -* -* n_tty_receive_buf()/producer path: -* claims non-exclusive termios_rwsem -* publishes read_head and canon_head -*/ -static void n_tty_receive_buf_real_raw (struct tty_struct *tty,const unsigned char *cp,char *fp,int count)
@@ -1683,24 +1664,85 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp, } } +/** +* n_tty_receive_buf_common - process input +* @tty: device to receive input +* @cp: input chars +* @fp: flags for each char (if NULL, all chars are TTY_NORMAL) +* @count: number of input chars in @cp +* +* Called by the terminal driver when a block of characters has +* been received. This function must be called from soft contexts +* not from interrupt context. The driver is responsible for making +* calls one at a time and in order (or using flush_to_ldisc) +* +* Returns the # of input chars from @cp which were processed. +* +* In canonical mode, the maximum line length is 4096 chars (including +* the line termination char); lines longer than 4096 chars are +* truncated. After 4095 chars, input data is still processed but +* not stored. Overflow processing ensures the tty can always +* receive more input until at least one line can be read. +* +* In non-canonical mode, the read buffer will only accept 4095 chars; +* this provides the necessary space for a newline char if the input +* mode is switched to canonical. +* +* Note it is possible for the read buffer to _contain_ 4096 chars +* in non-canonical mode: the read buffer could already contain the +* maximum canon line of 4096 chars when the mode is switched to +* non-canonical. +* +* n_tty_receive_buf()/producer path: +* claims non-exclusive termios_rwsem +* publishes commit_head or canon_head +*/ static int n_tty_receive_buf_common (struct tty_struct *tty,const unsigned char *cp,char *fp,int count,int flow) {struct n_tty_data *ldata = tty->disc_data; -int room, n, rcvd =0 ; +int room, n, rcvd =0 , overflow;down_read (&tty->termios_rwsem);while (1 ) { - room =receive_room (tty); +/* +* When PARMRK is set, each input char may take up to 3 chars +* in the read buf; reduce the buffer space avail by 3x +* +* If we are doing input canonicalization, and there are no +* pending newlines, let characters through without limit, so +* that erase characters will be handled. Other excess +* characters will be beeped. +* +* paired with store in *_copy_from_read_buf() -- guarantees +* the consumer has loaded the data in read_buf up to the new +* read_tail (so this producer will not overwrite unread data) +*/ +size_t tail = ldata->read_tail; + + room =N_TTY_BUF_SIZE - (ldata->read_head - tail); +if (I_PARMRK (tty)) + room = (room +2 ) /3 ; + room--; +if (room <=0 ) { + overflow = ldata->icanon && ldata->canon_head == tail; +if (overflow && room <0 ) + ldata->read_head--; + room = overflow; + ldata->no_room = flow && !room; + }else + overflow =0 ; + n =min (count, room); -if (!n) { -if (flow && !room) - ldata->no_room =1 ; +if (!n)break ; - } -__receive_buf (tty, cp, fp, n); + +/* ignore parity errors if handling overflow */ +if (!overflow || !fp || *fp !=TTY_PARITY ) +__receive_buf (tty, cp, fp, n); + cp += n;if (fp) fp += n;
@@ -1709,7 +1751,17 @@ n_tty_receive_buf_common(struct tty_struct *tty, const unsigned char *cp, } tty->receive_room = room; -n_tty_check_throttle (tty); + +/* Unthrottle if handling overflow on pty */ +if (tty->driver->type ==TTY_DRIVER_TYPE_PTY ) { +if (overflow) { +tty_set_flow_change (tty,TTY_UNTHROTTLE_SAFE ); +tty_unthrottle_safe (tty); +__tty_set_flow_change (tty,0 ); + } + }else +n_tty_check_throttle (tty); +up_read (&tty->termios_rwsem);return rcvd;
Signature · 1 line
2.3.5
PATCH 40/83 cifs: fix use-after-free bug in find_writable_file
In reply to Jiri SlabyFrom: David Disseldorp <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e1e9bda22d7ddf88515e8fe401887e313922823e upstream.
Under intermittent network outages, find_writable_file() is susceptible to the following race condition, which results in a user-after-free in the cifs_writepages code-path:
Thread 1 Thread 2
======== ========
inv_file = NULL
refind = 0spin_lock(&cifs_file_list_lock)
// invalidHandle found on openFileList
inv_file = open_file
// inv_file->count currently 1
cifsFileInfo_get(inv_file)
// inv_file->count = 2
spin_unlock(&cifs_file_list_lock);
cifs_reopen_file() cifs_close()
// fails (rc != 0) ->cifsFileInfo_put()
spin_lock(&cifs_file_list_lock)
// inv_file->count = 1
spin_unlock(&cifs_file_list_lock)spin_lock(&cifs_file_list_lock);
list_move_tail(&inv_file->flist,
&cifs_inode->openFileList);
spin_unlock(&cifs_file_list_lock);
cifsFileInfo_put(inv_file);
->spin_lock(&cifs_file_list_lock)
// inv_file->count = 0 list_del(&cifs_file->flist); // cleanup!! kfree(cifs_file); spin_unlock(&cifs_file_list_lock);
spin_lock(&cifs_file_list_lock);
++refind;
// refind = 1
goto refind_writable;
At this point we loop back through with an invalid inv_file pointer and a refind value of 1. On second pass, inv_file is not overwritten on openFileList traversal, and is subsequently dereferenced.
--- fs/cifs/file.c | 1 + 1 file changed, 1 insertion(+)
fs/cifs/file.c +1 -0
@@ -1821,6 +1821,7 @@ refind_writable:cifsFileInfo_put (inv_file);spin_lock (&cifs_file_list_lock); ++refind; + inv_file =NULL ; goto refind_writable; } }
Signature · 1 line
2.3.5
PATCH 41/83 be2iscsi: Fix kernel panic when device initialization fails
In reply to Jiri SlabyFrom: John Soni Jose <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2e7cee027b26cbe7e6685a7a14bd2850bfe55d33 upstream.
Kernel panic was happening as iscsi_host_remove() was called on
a host which was not yet added.
--- drivers/scsi/be2iscsi/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/be2iscsi/be_main.c +1 -1
@@ -5080,9 +5080,9 @@ free_port: hba_free:if (phba->msix_enabled)pci_disable_msix (phba->pcidev); -iscsi_host_remove (phba->shost);pci_dev_put (phba->pcidev);iscsi_host_free (phba->shost); +pci_set_drvdata (pcidev,NULL ); disable_pci:pci_disable_device (pcidev);return ret;
Signature · 1 line
2.3.5
PATCH 42/83 ocfs2: _really_ sync the right range
In reply to Jiri SlabyFrom: Al Viro <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 64b4e2526d1cf6e6a4db6213d6e2b6e6ab59479a upstream.
"ocfs2 syncs the wrong range" had been broken; prior to it the code was doing the wrong thing in case of O_APPEND, all right, but _after_ it we were syncing the wrong range in 100% cases. *ppos, aka iocb->ki_pos is incremented prior to that point, so we are always doing sync on the area _after_ the one we'd written to.
Spotted by Joseph Qi <[email protected]> back in January; unfortunately, I'd missed his mail back then ;-/
--- fs/ocfs2/file.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
fs/ocfs2/file.c +10 -4
@@ -2369,10 +2369,14 @@ out_dio:/* buffered aio wouldn't have proper lock coverage today */ BUG_ON (ret == -EIOCBQUEUED && !(file->f_flags &O_DIRECT )); +if (unlikely (written <=0 )) + goto no_sync; +if (((file->f_flags &O_DSYNC ) && !direct_io) ||IS_SYNC (inode) || ((file->f_flags &O_DIRECT ) && !direct_io)) { - ret =filemap_fdatawrite_range (file->f_mapping, *ppos, - *ppos + count -1 ); + ret =filemap_fdatawrite_range (file->f_mapping, + iocb->ki_pos - written, + iocb->ki_pos -1 );if (ret <0 ) written = ret;
@@ -2383,10 +2387,12 @@ out_dio: }if (!ret) - ret =filemap_fdatawait_range (file->f_mapping, *ppos, - *ppos + count -1 ); + ret =filemap_fdatawait_range (file->f_mapping, + iocb->ki_pos - written, + iocb->ki_pos -1 ); } +no_sync:/* * deep in g_f_a_w_n()->ocfs2_direct_IO we pass in a ocfs2_dio_end_io * function pointer which is called when o_direct io completes so that
Signature · 1 line
2.3.5
PATCH 43/83 ioctx_alloc(): fix vma (and file) leak on failure
In reply to Jiri SlabyFrom: Al Viro <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit deeb8525f9bcea60f5e86521880c1161de7a5829 upstream.
If we fail past the aio_setup_ring(), we need to destroy the mapping. We don't need to care about anybody having found ctx, or added requests to it, since the last failure exit is exactly the failure to make ctx visible to lookups.
Reproducer (based on one by Joe Mario <[email protected]>):
void count(char *p)
{
char s[80];
printf("%s: ", p);
fflush(stdout);
sprintf(s, "/bin/cat /proc/%d/maps|/bin/fgrep -c '/[aio] (deleted)'", getpid());
system(s);
}int main()
{
io_context_t *ctx;
int created, limit, i, destroyed;
FILE *f;
count("before");
if ((f = fopen("/proc/sys/fs/aio-max-nr", "r")) == NULL)
perror("opening aio-max-nr");
else if (fscanf(f, "%d", &limit) != 1)
fprintf(stderr, "can't parse aio-max-nr\n");
else if ((ctx = calloc(limit, sizeof(io_context_t))) == NULL)
perror("allocating aio_context_t array");
else {
for (i = 0, created = 0; i < limit; i++) {
if (io_setup(1000, ctx + created) == 0)
created++;
}
for (i = 0, destroyed = 0; i < created; i++)
if (io_destroy(ctx[i]) == 0)
destroyed++;
printf("created %d, failed %d, destroyed %d\n",
created, limit - created, destroyed);
count("after");
}
}--- fs/aio.c | 3 +++ 1 file changed, 3 insertions(+)
fs/aio.c +3 -0
@@ -718,6 +718,9 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) err_cleanup:aio_nr_sub (ctx->max_reqs); err_ctx: +atomic_set (&ctx->dead,1 ); +if (ctx->mmap_size) +vm_munmap (ctx->mmap_base, ctx->mmap_size);aio_free_ring (ctx); err:mutex_unlock (&ctx->ring_lock);
Signature · 1 line
2.3.5
PATCH 44/83 iscsi target: fix oops when adding reject pdu
In reply to Jiri SlabyFrom: Mike Christie <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b815fc12d4dd2b5586184fb4f867caff05a810d4 upstream.
This fixes a oops due to a double list add when adding a reject PDU for iscsit_allocate_iovecs allocation failures. The cmd has already been added to the conn_cmd_list in iscsit_setup_scsi_cmd, so this has us call iscsit_reject_cmd.
Note that for ERL0 the reject PDU is not actually sent, so this patch is not completely tested. Just verified we do not oops. The problem is the add reject functions return -1 which is returned all the way up to iscsi_target_rx_thread which for ERL0 will drop the connection.
--- drivers/target/iscsi/iscsi_target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/iscsi/iscsi_target.c +1 -1
@@ -1172,7 +1172,7 @@ iscsit_handle_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,* traditional iSCSI block I/O. */ if (iscsit_allocate_iovecs (cmd) <0 ) { -return iscsit_add_reject_cmd (cmd, +return iscsit_reject_cmd (cmd,ISCSI_REASON_BOOKMARK_NO_RESOURCES , buf); } immed_data = cmd->immediate_data;
Signature · 1 line
2.3.5
PATCH 45/83 sh_veu: v4l2_dev wasn't set
In reply to Jiri SlabyFrom: Hans Verkuil <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ab3120300be067a2d41a027c41db0b2c662ab200 upstream.
The v4l2_dev field of struct video_device must be set correctly. This was never done for this driver, so no video nodes were created anymore.
--- drivers/media/platform/sh_veu.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/sh_veu.c +1 -0
@@ -1183,6 +1183,7 @@ static int sh_veu_probe(struct platform_device *pdev) } *vdev = sh_veu_videodev; + vdev->v4l2_dev = &veu->v4l2_dev;spin_lock_init (&veu->lock);mutex_init (&veu->fop_lock); vdev->lock = &veu->fop_lock;
Signature · 1 line
2.3.5
PATCH 46/83 media: s5p-mfc: fix mmap support for 64bit arch
In reply to Jiri SlabyFrom: Marek Szyprowski <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 05b676ab42f624425d5f6519276e506b812fa058 upstream.
TASK_SIZE is depends on the systems architecture (32 or 64 bits) and it should not be used for defining offset boundary for mmaping buffers for CAPTURE and OUTPUT queues. This patch fixes support for MMAP calls on the CAPTURE queue on 64bit architectures (like ARM64).
--- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/s5p-mfc/s5p_mfc_common.h +1 -1
@@ -30,7 +30,7 @@/* Offset base used to differentiate between CAPTURE and OUTPUT * while mmaping */ -#define DST_QUEUE_OFF_BASE (TASK_SIZE / 2) +#define DST_QUEUE_OFF_BASE (1 << 30)#define MFC_BANK1_ALLOC_CTX 0#define MFC_BANK2_ALLOC_CTX 1
Signature · 1 line
2.3.5
PATCH 47/83 net: rds: use correct size for max unacked packets and bytes
In reply to Jiri SlabyFrom: Sasha Levin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit db27ebb111e9f69efece08e4cb6a34ff980f8896 upstream.
Max unacked packets/bytes is an int while sizeof(long) was used in the sysctl table.
This means that when they were getting read we'd also leak kernel memory to userspace along with the timeout values.
--- net/rds/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/rds/sysctl.c +2 -2
@@ -71,14 +71,14 @@ static struct ctl_table rds_sysctl_rds_table[] = { { .procname = "max_unacked_packets", .data = &rds_sysctl_max_unacked_packets, - .maxlen = sizeof(unsigned long), + .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, }, { .procname = "max_unacked_bytes", .data = &rds_sysctl_max_unacked_bytes, - .maxlen = sizeof(unsigned long), + .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, },
Signature · 1 line
2.3.5
PATCH 48/83 net: llc: use correct size for sysctl timeout entries
In reply to Jiri SlabyFrom: Sasha Levin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6b8d9117ccb4f81b1244aafa7bc70ef8fa45fc49 upstream.
The timeout entries are sizeof(int) rather than sizeof(long), which means that when they were getting read we'd also leak kernel memory to userspace along with the timeout values.
--- net/llc/sysctl_net_llc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/llc/sysctl_net_llc.c +4 -4
@@ -18,28 +18,28 @@ static struct ctl_table llc2_timeout_table[] = { { .procname = "ack", .data = &sysctl_llc2_ack_timeout, - .maxlen = sizeof(long), + .maxlen = sizeof(sysctl_llc2_ack_timeout), .mode = 0644, .proc_handler = proc_dointvec_jiffies, }, { .procname = "busy", .data = &sysctl_llc2_busy_timeout, - .maxlen = sizeof(long), + .maxlen = sizeof(sysctl_llc2_busy_timeout), .mode = 0644, .proc_handler = proc_dointvec_jiffies, }, { .procname = "p", .data = &sysctl_llc2_p_timeout, - .maxlen = sizeof(long), + .maxlen = sizeof(sysctl_llc2_p_timeout), .mode = 0644, .proc_handler = proc_dointvec_jiffies, }, { .procname = "rej", .data = &sysctl_llc2_rej_timeout, - .maxlen = sizeof(long), + .maxlen = sizeof(sysctl_llc2_rej_timeout), .mode = 0644, .proc_handler = proc_dointvec_jiffies, },
Signature · 1 line
2.3.5
PATCH 49/83 IB/mlx4: Saturate RoCE port PMA counters in case of overflow
In reply to Jiri SlabyFrom: Majd Dibbiny <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 61a3855bb726cbb062ef02a31a832dea455456e0 upstream.
For RoCE ports, we set the u32 PMA values based on u64 HCA counters. In case of overflow, according to the IB spec, we have to saturate a counter to its max value, do that.
--- drivers/infiniband/hw/mlx4/mad.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/infiniband/hw/mlx4/mad.c +16 -4
@@ -64,6 +64,14 @@ enum {#define GUID_TBL_BLK_NUM_ENTRIES 8#define GUID_TBL_BLK_SIZE (GUID_TBL_ENTRY_SIZE * GUID_TBL_BLK_NUM_ENTRIES) +/* Counters should be saturate once they reach their maximum value */ +#define ASSIGN_32BIT_COUNTER (counter, value) do {\ + if ((value) > U32_MAX) \ + counter = cpu_to_be32(U32_MAX); \ + else \ + counter = cpu_to_be32(value); \ +} while (0) +struct mlx4_mad_rcv_buf {struct ib_grh grh;u8 payload[256 ];
@@ -730,10 +738,14 @@ static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,static void edit_counter (struct mlx4_counter *cnt,struct ib_pma_portcounters *pma_cnt) { - pma_cnt->port_xmit_data =cpu_to_be32 ((be64_to_cpu (cnt->tx_bytes)>>2 )); - pma_cnt->port_rcv_data =cpu_to_be32 ((be64_to_cpu (cnt->rx_bytes)>>2 )); - pma_cnt->port_xmit_packets =cpu_to_be32 (be64_to_cpu (cnt->tx_frames)); - pma_cnt->port_rcv_packets =cpu_to_be32 (be64_to_cpu (cnt->rx_frames)); +ASSIGN_32BIT_COUNTER (pma_cnt->port_xmit_data, + (be64_to_cpu (cnt->tx_bytes) >>2 )); +ASSIGN_32BIT_COUNTER (pma_cnt->port_rcv_data, + (be64_to_cpu (cnt->rx_bytes) >>2 )); +ASSIGN_32BIT_COUNTER (pma_cnt->port_xmit_packets, +be64_to_cpu (cnt->tx_frames)); +ASSIGN_32BIT_COUNTER (pma_cnt->port_rcv_packets, +be64_to_cpu (cnt->rx_frames)); } static int iboe_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
Signature · 1 line
2.3.5
PATCH 50/83 drivers: media: usb: b2c2: use usb_*_coherent() instead of pci_*_consistent() in flexcop-usb.c
In reply to Jiri SlabyFrom: Chen Gang <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6c7e346974ad6d20898026f209581fb6dd8ce3f0 upstream.
Some architectures do not support PCI, but still support USB, so need
let our usb driver try to use usb_* instead of pci_* to support these
architectures, or can not pass compiling.
The related error (with allmodconfig for arc):
CC [M] drivers/media/usb/b2c2/flexcop-usb.o
drivers/media/usb/b2c2/flexcop-usb.c: In function ‘flexcop_usb_transfer_exit’:
drivers/media/usb/b2c2/flexcop-usb.c:393: error: implicit declaration of function ‘pci_free_consistent’ drivers/media/usb/b2c2/flexcop-usb.c: In function ‘flexcop_usb_transfer_init’:
drivers/media/usb/b2c2/flexcop-usb.c:410: error: implicit declaration of function ‘pci_alloc_consistent’
--- drivers/media/usb/b2c2/flexcop-usb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/usb/b2c2/flexcop-usb.c +3 -3
@@ -390,7 +390,7 @@ static void flexcop_usb_transfer_exit(struct flexcop_usb *fc_usb) }if (fc_usb->iso_buffer !=NULL ) -pci_free_consistent (NULL , +usb_free_coherent (fc_usb->udev, fc_usb->buffer_size, fc_usb->iso_buffer, fc_usb->dma_addr); }
@@ -407,8 +407,8 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)"each of %d bytes size = %d.\n" ,B2C2_USB_NUM_ISO_URB , B2C2_USB_FRAMES_PER_ISO, frame_size, bufsize); - fc_usb->iso_buffer =pci_alloc_consistent (NULL , - bufsize, &fc_usb->dma_addr); + fc_usb->iso_buffer =usb_alloc_coherent (fc_usb->udev, + bufsize,GFP_KERNEL , &fc_usb->dma_addr);if (fc_usb->iso_buffer ==NULL )return -ENOMEM ;
Signature · 1 line
2.3.5
PATCH 51/83 video: vgacon: Don't build on arm64
In reply to Jiri SlabyFrom: Mark Brown <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ee23794b86689e655cedd616e98c03bc3c74f5ec upstream.
arm64 is unlikely to have a VGA console and does not export screen_info causing build failures if the driver is build, for example in all*config. Add a dependency on !ARM64 to prevent this.
This list is getting quite long, it may be easier to depend on a symbol which architectures that do support the driver can select.
--- drivers/video/console/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/console/Kconfig +2 -1
@@ -8,7 +8,8 @@ config VGA_CONSOLE bool "VGA text console" if EXPERT || !X86 depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \ !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \ - (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) + (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \ + !ARM64 default y help Saying Y here will allow you to use Linux in text mode through a
Signature · 1 line
2.3.5
PATCH 52/83 tcp: prevent fetching dst twice in early demux code
In reply to Jiri SlabyFrom: Michal Kubeček <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit d0c294c53a771ae7e84506dfbd8c18c30f078735 ]
On s390x, gcc 4.8 compiles this part of tcp_v6_early_demux()
struct dst_entry *dst = sk->sk_rx_dst;
if (dst)
dst = dst_check(dst, inet6_sk(sk)->rx_dst_cookie);to code reading sk->sk_rx_dst twice, once for the test and once for the argument of ip6_dst_check() (dst_check() is inline). This allows ip6_dst_check() to be called with null first argument, causing a crash.
Protect sk->sk_rx_dst access by ACCESS_ONCE() both in IPv4 and IPv6 TCP early demux code.
--- net/ipv4/tcp_ipv4.c | 2 +- net/ipv6/tcp_ipv6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_ipv4.c +1 -1
@@ -1875,7 +1875,7 @@ void tcp_v4_early_demux(struct sk_buff *skb) skb->sk = sk; skb->destructor = sock_edemux;if (sk->sk_state !=TCP_TIME_WAIT ) { -struct dst_entry *dst = sk->sk_rx_dst; +struct dst_entry *dst =ACCESS_ONCE (sk->sk_rx_dst);if (dst) dst =dst_check (dst,0 );
net/ipv6/tcp_ipv6.c +1 -1
@@ -1616,7 +1616,7 @@ static void tcp_v6_early_demux(struct sk_buff *skb) skb->sk = sk; skb->destructor = sock_edemux;if (sk->sk_state !=TCP_TIME_WAIT ) { -struct dst_entry *dst = sk->sk_rx_dst; +struct dst_entry *dst =ACCESS_ONCE (sk->sk_rx_dst);if (dst) dst =dst_check (dst,inet6_sk (sk)->rx_dst_cookie);
Signature · 1 line
2.3.5
PATCH 53/83 ipv6: Don't reduce hop limit for an interface
In reply to Jiri SlabyFrom: "D.S. Ljungmark" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 6fd99094de2b83d1d4c8457f2c83483b2828e75a ]
A local route may have a lower hop_limit set than global routes do.
RFC 3756, Section 4.2.7, "Parameter Spoofing"
Quoted 8 lines
1. The attacker includes a Current Hop Limit of one or another small number which the attacker knows will cause legitimate packets to be dropped before they reach their destination.
As an example, one possible approach to mitigate this threat is to ignore very small hop limits. The nodes could implement a configurable minimum hop limit, and ignore attempts to set it below said limit.
--- net/ipv6/ndisc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
net/ipv6/ndisc.c +8 -1
@@ -1191,7 +1191,14 @@ static void ndisc_router_discovery(struct sk_buff *skb)if (rt)rt6_set_expires (rt, jiffies + (HZ * lifetime));if (ra_msg->icmph.icmp6_hop_limit) { - in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; +/* Only set hop_limit on the interface if it is higher than +* the current hop_limit. +*/ +if (in6_dev->cnf.hop_limit < ra_msg->icmph.icmp6_hop_limit) { + in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; + }else { +ND_PRINTK (2 , warn,"RA: Got route advertisement with lower hop_limit than current\n" ); + }if (rt)dst_metric_set (&rt->dst,RTAX_HOPLIMIT , ra_msg->icmph.icmp6_hop_limit);
Signature · 1 line
2.3.5
PATCH 54/83 tcp: fix FRTO undo on cumulative ACK of SACKed range
In reply to Jiri SlabyFrom: Neal Cardwell <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 666b805150efd62f05810ff0db08f44a2370c937 ]
On processing cumulative ACKs, the FRTO code was not checking the SACKed bit, meaning that there could be a spurious FRTO undo on a cumulative ACK of a previously SACKed skb.
The FRTO code should only consider a cumulative ACK to indicate that an original/unretransmitted skb is newly ACKed if the skb was not yet SACKed.
The effect of the spurious FRTO undo would typically be to make the connection think that all previously-sent packets were in flight when they really weren't, leading to a stall and an RTO.
--- net/ipv4/tcp_input.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/ipv4/tcp_input.c +4 -3
@@ -3014,10 +3014,11 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,if (seq_rtt <0 ) { seq_rtt = ca_seq_rtt; } -if (!(sacked &TCPCB_SACKED_ACKED )) +if (!(sacked &TCPCB_SACKED_ACKED )) { reord =min (pkts_acked, reord); -if (!after (scb->end_seq, tp->high_seq)) - flag |=FLAG_ORIG_SACK_ACKED ; +if (!after (scb->end_seq, tp->high_seq)) + flag |=FLAG_ORIG_SACK_ACKED ; + } }if (sacked &TCPCB_SACKED_ACKED )
Signature · 1 line
2.3.5
PATCH 55/83 tcp: tcp_make_synack() should clear skb->tstamp
In reply to Jiri SlabyFrom: Eric Dumazet <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit b50edd7812852d989f2ef09dcfc729690f54a42d ]
I noticed tcpdump was giving funky timestamps for locally generated SYNACK messages on loopback interface.
11:42:46.938990 IP 127.0.0.1.48245 > 127.0.0.2.23850: S 945476042:945476042(0) win 43690 <mss 65495,nop,nop,sackOK,nop,wscale 7>
20:28:58.502209 IP 127.0.0.2.23850 > 127.0.0.1.48245: S 3160535375:3160535375(0) ack 945476043 win 43690 <mss 65495,nop,nop,sackOK,nop,wscale 7>
This is because we need to clear skb->tstamp before entering lower stack, otherwise net_timestamp_check() does not set skb->tstamp.
--- net/ipv4/tcp_output.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv4/tcp_output.c +2 -0
@@ -2782,6 +2782,8 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, }#endif +/* Do not fool tcpdump (if any), clean our debris */ + skb->tstamp.tv64 =0 ;return skb; }EXPORT_SYMBOL (tcp_make_synack);
Signature · 1 line
2.3.5
PATCH 56/83 8139cp: Call dev_kfree_skby_any instead of kfree_skb.
In reply to Jiri SlabyFrom: "Eric W. Biederman" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 508f81d517ed1f3f0197df63ea7ab5cd91b6f3b3 upstream.
Replace kfree_skb with dev_kfree_skb_any in cp_start_xmit as it can be called in both hard irq and other contexts.
--- drivers/net/ethernet/realtek/8139cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/realtek/8139cp.c +1 -1
@@ -899,7 +899,7 @@ out_unlock:return NETDEV_TX_OK ; out_dma_error: -kfree_skb (skb); +dev_kfree_skb_any (skb); cp->dev->stats.tx_dropped++; goto out_unlock; }
Signature · 1 line
2.3.5
PATCH 57/83 8139too: Call dev_kfree_skby_any instead of dev_kfree_skb.
In reply to Jiri SlabyFrom: "Eric W. Biederman" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a2ccd2e4bd70122523a7bf21cec4dd6e34427089 upstream.
Replace dev_kfree_skb with dev_kfree_skb_any in functions that can be called in hard irq and other contexts.
--- drivers/net/ethernet/realtek/8139too.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/realtek/8139too.c +2 -2
@@ -1715,9 +1715,9 @@ static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,if (len <ETH_ZLEN )memset (tp->tx_buf[entry],0 ,ETH_ZLEN );skb_copy_and_csum_dev (skb, tp->tx_buf[entry]); -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); }else { -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); dev->stats.tx_dropped++;return NETDEV_TX_OK ; }
Signature · 1 line
2.3.5
PATCH 58/83 r8169: Call dev_kfree_skby_any instead of dev_kfree_skb.
In reply to Jiri SlabyFrom: "Eric W. Biederman" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 989c9ba104d9ce53c1ca918262f3fdfb33aca12a upstream.
Replace dev_kfree_skb with dev_kfree_skb_any in functions that can be called in hard irq and other contexts.
--- drivers/net/ethernet/realtek/r8169.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/realtek/r8169.c +3 -3
@@ -5835,7 +5835,7 @@ static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start, tp->TxDescArray + entry);if (skb) { tp->dev->stats.tx_dropped++; -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); tx_skb->skb =NULL ; } }
@@ -6060,7 +6060,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, err_dma_1:rtl8169_unmap_tx_skb (d, tp->tx_skb + entry, txd); err_dma_0: -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); err_update_stats: dev->stats.tx_dropped++;return NETDEV_TX_OK ;
@@ -6143,7 +6143,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp) tp->tx_stats.packets++; tp->tx_stats.bytes += tx_skb->skb->len;u64_stats_update_end (&tp->tx_stats.syncp); -dev_kfree_skb (tx_skb->skb); +dev_kfree_skb_any (tx_skb->skb); tx_skb->skb =NULL ; } dirty_tx++;
Signature · 1 line
2.3.5
PATCH 59/83 bonding: Call dev_kfree_skby_any instead of kfree_skb.
In reply to Jiri SlabyFrom: "Eric W. Biederman" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2bb77ab42a6a40162a367b80394b96bb756ad5f1 upstream.
Replace kfree_skb with dev_kfree_skb_any in functions that can be called in hard irq and other contexts.
--- drivers/net/bonding/bond_3ad.c | 2 +- drivers/net/bonding/bond_alb.c | 2 +- drivers/net/bonding/bond_main.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/bonding/bond_3ad.c +1 -1
@@ -2477,7 +2477,7 @@ out:read_unlock (&bond->lock);if (res) {/* no suitable interface, frame not sent */ -kfree_skb (skb); +dev_kfree_skb_any (skb); }return NETDEV_TX_OK ;
drivers/net/bonding/bond_alb.c +1 -1
@@ -1447,7 +1447,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)read_unlock (&bond->lock);if (res) {/* no suitable interface, frame not sent */ -kfree_skb (skb); +dev_kfree_skb_any (skb); }return NETDEV_TX_OK ;
drivers/net/bonding/bond_main.c +5 -5
@@ -3659,7 +3659,7 @@ void bond_xmit_slave_id(struct bonding *bond, struct sk_buff *skb, int slave_id) } }/* no slave that can tx has been found */ -kfree_skb (skb); +dev_kfree_skb_any (skb); }static int bond_xmit_roundrobin (struct sk_buff *skb,struct net_device *bond_dev)
@@ -3702,7 +3702,7 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dif (slave)bond_dev_queue_xmit (bond, skb, slave->dev);else -kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
@@ -3746,7 +3746,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)if (slave &&IS_UP (slave->dev) && slave->link ==BOND_LINK_UP )bond_dev_queue_xmit (bond, skb, slave->dev);else -kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
@@ -3851,7 +3851,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *devpr_err ("%s: Error: Unknown bonding mode %d\n" , dev->name, bond->params.mode);WARN_ON_ONCE (1 ); -kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; } }
@@ -3872,7 +3872,7 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)if (!list_empty (&bond->slave_list)) ret =__bond_start_xmit (skb, dev);else -kfree_skb (skb); +dev_kfree_skb_any (skb);rcu_read_unlock ();return ret;
Signature · 1 line
2.3.5
PATCH 60/83 bnx2: Call dev_kfree_skby_any instead of dev_kfree_skb.
In reply to Jiri SlabyFrom: "Eric W. Biederman" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f458b2ee93ee3606c83f76213fbe49e026bac754 upstream.
Replace dev_kfree_skb with dev_kfree_skb_any in functions that can be called in hard irq and other contexts.
--- drivers/net/ethernet/broadcom/bnx2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/bnx2.c +3 -3
@@ -2869,7 +2869,7 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) sw_cons =BNX2_NEXT_TX_BD (sw_cons); tx_bytes += skb->len; -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); tx_pkt++;if (tx_pkt == budget)break ;
@@ -6622,7 +6622,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) mapping =dma_map_single (&bp->pdev->dev, skb->data, len,PCI_DMA_TODEVICE );if (dma_mapping_error (&bp->pdev->dev, mapping)) { -dev_kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
@@ -6715,7 +6715,7 @@ dma_error: PCI_DMA_TODEVICE); } -dev_kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
Signature · 1 line
2.3.5
PATCH 61/83 tg3: Call dev_kfree_skby_any instead of dev_kfree_skb.
In reply to Jiri SlabyFrom: "Eric W. Biederman" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 497a27b9e1bcf6dbaea7a466cfcd866927e1b431 upstream.
Replace dev_kfree_skb with dev_kfree_skb_any in functions that can be called in hard irq and other contexts.
--- drivers/net/ethernet/broadcom/tg3.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +7 -7
@@ -6568,7 +6568,7 @@ static void tg3_tx(struct tg3_napi *tnapi) pkts_compl++; bytes_compl += skb->len; -dev_kfree_skb (skb); +dev_kfree_skb_any (skb);if (unlikely (tx_bug)) {tg3_tx_recover (tp);
@@ -6900,7 +6900,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)if (len > (tp->dev->mtu +ETH_HLEN ) && skb->protocol !=htons (ETH_P_8021Q ) && skb->protocol !=htons (ETH_P_8021AD )) { -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); goto drop_it_no_recycle; }
@@ -7783,7 +7783,7 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, PCI_DMA_TODEVICE);/* Make sure the mapping succeeded */ if (pci_dma_mapping_error (tp->pdev, new_addr)) { -dev_kfree_skb (new_skb); +dev_kfree_skb_any (new_skb); ret =-1 ; }else {u32 save_entry = *entry;
@@ -7798,13 +7798,13 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, new_skb->len, base_flags, mss, vlan)) {tg3_tx_skb_unmap (tnapi, save_entry,-1 ); -dev_kfree_skb (new_skb); +dev_kfree_skb_any (new_skb); ret =-1 ; } } } -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); *pskb = new_skb;return ret; }
@@ -7847,7 +7847,7 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb) }while (segs); tg3_tso_bug_end: -dev_kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
@@ -8085,7 +8085,7 @@ dma_error:tg3_tx_skb_unmap (tnapi, tnapi->tx_prod, --i); tnapi->tx_buffers[tnapi->tx_prod].skb =NULL ; drop: -dev_kfree_skb (skb); +dev_kfree_skb_any (skb); drop_nofree: tp->tx_dropped++;return NETDEV_TX_OK ;
Signature · 1 line
2.3.5
PATCH 62/83 ixgb: Call dev_kfree_skby_any instead of dev_kfree_skb.
In reply to Jiri SlabyFrom: "Eric W. Biederman" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f7e79913a1d6a6139211ead3b03579b317d25a1f upstream.
Replace dev_kfree_skb with dev_kfree_skb_any in functions that can be called in hard irq and other contexts.
--- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ixgb/ixgb_main.c +3 -3
@@ -1527,12 +1527,12 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)int tso;if (test_bit (__IXGB_DOWN, &adapter->flags)) { -dev_kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }if (skb->len <=0 ) { -dev_kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
@@ -1549,7 +1549,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) tso =ixgb_tso (adapter, skb);if (tso <0 ) { -dev_kfree_skb (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
Signature · 1 line
2.3.5
PATCH 63/83 benet: Call dev_kfree_skby_any instead of kfree_skb.
In reply to Jiri SlabyFrom: "Eric W. Biederman" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit d8ec2c02caa3515f35d6c33eedf529394c419298 upstream.
Replace free_skb with dev_kfree_skb_any in be_tx_compl_process as which can be called in hard irq by netpoll, softirq context by normal napi polling, and in normal sleepable context by the network device close method.
--- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/emulex/benet/be_main.c +1 -1
@@ -1777,7 +1777,7 @@ static u16 be_tx_compl_process(struct be_adapter *adapter,queue_tail_inc (txq); }while (cur_index != last_index); -kfree_skb (sent_skb); +dev_kfree_skb_any (sent_skb);return num_wrbs; }
Signature · 1 line
2.3.5
PATCH 64/83 crypto: testmgr - fix 3.12.40 regression
In reply to Jiri SlabyFrom: Lennart Sorensen <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ace3fc1e3f3a85ec705805146247231b11e1babe in 3.12.40 missed two lines while pulling in commit 8a45ac12ec5b6ee67f8559c78ae11d9af8b821ee from upstream. This causes the tests to fail in some cases.
With the two missing lines added in, the tests pass again.
Tested with omap-aes, omap-sham and talitos.
--- crypto/testmgr.c | 2 ++ 1 file changed, 2 insertions(+)
crypto/testmgr.c +2 -0
@@ -334,6 +334,7 @@ static int __test_hash(struct crypto_ahash *tfm, struct hash_testvec *template,case -EBUSY :wait_for_completion (&tresult.completion);INIT_COMPLETION (tresult.completion); + ret = tresult.err;if (!ret)break ;/* fall through */
@@ -1079,6 +1080,7 @@ static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc,case -EBUSY :wait_for_completion (&result.completion);INIT_COMPLETION (result.completion); + ret = result.err;if (!ret)break ;/* fall through */
Signature · 1 line
2.3.5
PATCH 65/83 sb_edac: Fix erroneous bytes->gigabytes conversion
In reply to Jiri SlabyFrom: Jim Snow <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8c009100295597f23978c224aec5751a365bc965 upstream.
--- drivers/edac/sb_edac.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-)
drivers/edac/sb_edac.c +20 -18
@@ -622,7 +622,7 @@ static void get_memory_layout(const struct mem_ctl_info *mci)u32 reg;u64 limit, prv =0 ;u64 tmp_mb; -u32 mb, kb; +u32 gb, mb;u32 rir_way;/*
@@ -635,8 +635,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci) pvt->tolm =GET_TOLM (reg); tmp_mb = (1 + pvt->tolm) >>20 ; - mb =div_u64_rem (tmp_mb,1000 , &kb); -edac_dbg (0 ,"TOLM: %u.%03u GB (0x%016Lx)\n" , mb, kb, (u64 )pvt->tolm); + gb =div_u64_rem (tmp_mb,1024 , &mb); +edac_dbg (0 ,"TOLM: %u.%03u GB (0x%016Lx)\n" , + gb, (mb*1000 )/1024 , (u64 )pvt->tolm);/* Address range is already 45:25 */ pci_read_config_dword(pvt->pci_sad1, TOHM,
@@ -644,8 +645,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci) pvt->tohm =GET_TOHM (reg); tmp_mb = (1 + pvt->tohm) >>20 ; - mb =div_u64_rem (tmp_mb,1000 , &kb); -edac_dbg (0 ,"TOHM: %u.%03u GB (0x%016Lx)\n" , mb, kb, (u64 )pvt->tohm); + gb =div_u64_rem (tmp_mb,1024 , &mb); +edac_dbg (0 ,"TOHM: %u.%03u GB (0x%016Lx)\n" , + gb, (mb*1000 )/1024 , (u64 )pvt->tohm);/* * Step 2) Get SAD range and SAD Interleave list
@@ -667,11 +669,11 @@ static void get_memory_layout(const struct mem_ctl_info *mci)break ; tmp_mb = (limit +1 ) >>20 ; - mb =div_u64_rem (tmp_mb,1000 , &kb); + gb =div_u64_rem (tmp_mb,1024 , &mb);edac_dbg (0 ,"SAD#%d %s up to %u.%03u GB (0x%016Lx) Interleave: %s reg=0x%08x\n" , n_sads,get_dram_attr (reg), - mb, kb, + gb, (mb*1000 )/1024 , ((u64 )tmp_mb) <<20L ,INTERLEAVE_MODE (reg) ?"8:6" :"[8:6]XOR[18:16]" , reg);
@@ -701,9 +703,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci)break ; tmp_mb = (limit +1 ) >>20 ; - mb =div_u64_rem (tmp_mb,1000 , &kb); + gb =div_u64_rem (tmp_mb,1024 , &mb); edac_dbg(0, "TAD#%d: up to %u.%03u GB (0x%016Lx), socket interleave %d, memory interleave %d, TGT: %d, %d, %d, %d, reg=0x%08x\n", - n_tads, mb, kb, + n_tads, gb, (mb*1000)/1024, ((u64)tmp_mb) << 20L, (u32)TAD_SOCK(reg), (u32)TAD_CH(reg),
@@ -726,10 +728,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) tad_ch_nilv_offset[j], ®); tmp_mb =TAD_OFFSET (reg) >>20 ; - mb =div_u64_rem (tmp_mb,1000 , &kb); + gb =div_u64_rem (tmp_mb,1024 , &mb);edac_dbg (0 ,"TAD CH#%d, offset #%d: %u.%03u GB (0x%016Lx), reg=0x%08x\n" , i, j, - mb, kb, + gb, (mb*1000 )/1024 , ((u64 )tmp_mb) <<20L , reg); }
@@ -751,10 +753,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) tmp_mb =RIR_LIMIT (reg) >>20 ; rir_way =1 <<RIR_WAY (reg); - mb =div_u64_rem (tmp_mb,1000 , &kb); + gb =div_u64_rem (tmp_mb,1024 , &mb);edac_dbg (0 ,"CH#%d RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d, reg=0x%08x\n" , i, j, - mb, kb, + gb, (mb*1000 )/1024 , ((u64 )tmp_mb) <<20L , rir_way, reg);
@@ -765,10 +767,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) ®); tmp_mb =RIR_OFFSET (reg) <<6 ; - mb =div_u64_rem (tmp_mb,1000 , &kb); + gb =div_u64_rem (tmp_mb,1024 , &mb);edac_dbg (0 ,"CH#%d RIR#%d INTL#%d, offset %u.%03u GB (0x%016Lx), tgt: %d, reg=0x%08x\n" , i, j, k, - mb, kb, + gb, (mb*1000 )/1024 , ((u64 )tmp_mb) <<20L , (u32 )RIR_RNK_TGT (reg), reg);
@@ -805,7 +807,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,u8 ch_way,sck_way;u32 tad_offset;u32 rir_way; -u32 mb, kb; +u32 mb, gb;u64 ch_addr, offset, limit, prv =0 ;
@@ -1021,10 +1023,10 @@ static int get_memory_error_data(struct mem_ctl_info *mci,continue ; limit =RIR_LIMIT (reg); - mb =div_u64_rem (limit >>20 ,1000 , &kb); + gb =div_u64_rem (limit >>20 ,1024 , &mb);edac_dbg (0 ,"RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d\n" , n_rir, - mb, kb, + gb, (mb*1000 )/1024 , limit,1 <<RIR_WAY (reg));if (ch_addr <= limit)
Signature · 1 line
2.3.5
PATCH 66/83 sb_edac: avoid INTERNAL ERROR message in EDAC with unspecified channel
In reply to Jiri SlabyFrom: Seth Jennings <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 351fc4a99d49fde63fe5ab7412beb35c40d27269 upstream.
Intel IA32 SDM Table 15-14 defines channel 0xf as 'not specified', but EDAC doesn't know about this and returns and INTERNAL ERROR when the channel is greater than NUM_CHANNELS:
kernel: [ 1538.886456] CPU 0: Machine Check Exception: 0 Bank 1: 940000000000009f
kernel: [ 1538.886669] TSC 2bc68b22e7e812 ADDR 46dae7000 MISC 0 PROCESSOR 0:306e4 TIME 1390414572 SOCKET 0 APIC 0
kernel: [ 1538.971948] EDAC MC1: INTERNAL ERROR: channel value is out of range (15 >= 4)
kernel: [ 1538.972203] EDAC MC1: 0 CE memory read error on unknown memory (slot:0 page:0x46dae7 offset:0x0 grain:0 syndrome:0x0 - area:DRAM err_code:0000:009f socket:1 channel_mask:1 rank:0)
This commit changes sb_edac to forward a channel of -1 to EDAC if the channel is not specified. edac_mc_handle_error() sets the channel to -1 internally after the error message anyway, so this commit should have no effect other than avoiding the INTERNAL ERROR message when the channel is not specified.
--- drivers/edac/sb_edac.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/edac/sb_edac.c +6 -2
@@ -270,8 +270,9 @@ static const u32 correrrthrsld[] = {* sbridge structs */ -#define NUM_CHANNELS 4 -#define MAX_DIMMS 3/* Max DIMMS per channel */ +#define NUM_CHANNELS 4 +#define MAX_DIMMS 3/* Max DIMMS per channel */ +#define CHANNEL_UNSPECIFIED 0xf/* Intel IA32 SDM 15-14 */ struct sbridge_info {u32 mcmtr;
@@ -1453,6 +1454,9 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,/* FIXME: need support for channel mask */ +if (channel ==CHANNEL_UNSPECIFIED ) + channel =-1 ; +/* Call the helper to output message */ edac_mc_handle_error(tp_event, mci, core_err_cnt, m->addr >> PAGE_SHIFT, m->addr & ~PAGE_MASK, 0,
Signature · 1 line
2.3.5
PATCH 67/83 cpufreq: fix a NULL pointer dereference in __cpufreq_governor()
In reply to Jiri SlabyFrom: Ethan Zhao <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit cb57720bf79688d64854a0a43565aa52303c1f3f upstream.
If ACPI _PPC changed notification happens before governor was initiated while kernel is booting, a NULL pointer dereference will be triggered:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000030 IP: [<ffffffff81470453>] __cpufreq_governor+0x23/0x1e0 PGD 0 Oops: 0000 [#1] SMP ... ... RIP: 0010:[<ffffffff81470453>] [<ffffffff81470453>] __cpufreq_governor+0x23/0x1e0 RSP: 0018:ffff881fcfbcfbb8 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff881fd11b3980 RCX: ffff88407fc20000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff881fd11b3980 RBP: ffff881fcfbcfbd8 R08: 0000000000000000 R09: 000000000000000f R10: ffffffff818068d0 R11: 0000000000000043 R12: 0000000000000004 R13: 0000000000000000 R14: ffffffff8196cae0 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff881fffc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000030 CR3: 00000000018ae000 CR4: 00000000000407f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process kworker/0:3 (pid: 750, threadinfo ffff881fcfbce000, task ffff881fcf556400) Stack: ffff881fffc17d00 ffff881fcfbcfc18 ffff881fd11b3980 0000000000000000 ffff881fcfbcfc08 ffffffff81470d08 ffff881fd11b3980 0000000000000007 ffff881fcfbcfc18 ffff881fffc17d00 ffff881fcfbcfd28 ffffffff81472e9a Call Trace: [<ffffffff81470d08>] __cpufreq_set_policy+0x1b8/0x2e0 [<ffffffff81472e9a>] cpufreq_update_policy+0xca/0x150 [<ffffffff81472f20>] ? cpufreq_update_policy+0x150/0x150 [<ffffffff81324a96>] acpi_processor_ppc_has_changed+0x71/0x7b [<ffffffff81320bcd>] acpi_processor_notify+0x55/0x115 [<ffffffff812f9c29>] acpi_device_notify+0x19/0x1b [<ffffffff813084ca>] acpi_ev_notify_dispatch+0x41/0x5f [<ffffffff812f64a4>] acpi_os_execute_deferred+0x27/0x34
The root cause is a race conditon -- cpufreq core and acpi-cpufreq driver were initiated, but cpufreq_governor wasn't and _PPC changed notification happened, __cpufreq_governor() was called within acpi_os_execute_deferred kernel thread context.
To fix this panic issue, add pointer checking code in __cpufreq_governor() before pointer policy->governor is to be dereferenced.
--- drivers/cpufreq/cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/cpufreq/cpufreq.c +7 -0
@@ -1739,6 +1739,13 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,struct cpufreq_governor *gov =NULL ;#endif +/* +* Governor might not be initiated here if ACPI _PPC changed +* notification happened, so check it. +*/ +if (!policy->governor) +return -EINVAL ; +if (policy->governor->max_transition_latency && policy->cpuinfo.transition_latency > policy->governor->max_transition_latency) {
Signature · 1 line
2.3.5
PATCH 68/83 libata: Blacklist queued TRIM on Samsung SSD 850 Pro
In reply to Jiri SlabyFrom: "Martin K. Petersen" <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6fc4d97a4987c5d247655a157a9377996626221a upstream.
Blacklist queued TRIM on this drive for now.
--- drivers/ata/libata-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/libata-core.c +1 -0
@@ -4228,6 +4228,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, { "Crucial_CT*M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, + { "Samsung SSD 850 PRO*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },/* * Some WD SATA-I drives spin up and down erratically when the link
Signature · 1 line
2.3.5
PATCH 69/83 nick kvfree() from apparmor
In reply to Jiri SlabyFrom: Al Viro <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 39f1f78d53b9bcbca91967380c5f0f2305a5c55f upstream.
too many places open-code it
--- include/linux/mm.h | 2 ++ mm/util.c | 10 ++++++++++ security/apparmor/include/apparmor.h | 1 - security/apparmor/lib.c | 14 -------------- 4 files changed, 12 insertions(+), 15 deletions(-)
include/linux/mm.h +2 -0
@@ -334,6 +334,8 @@ static inline int is_vmalloc_or_module_addr(const void *x) }#endif +extern void kvfree (const void *addr); +static inline void compound_lock (struct page *page) {#ifdef CONFIG_TRANSPARENT_HUGEPAGE
mm/util.c +10 -0
@@ -7,6 +7,7 @@#include <linux/security.h> #include <linux/swap.h> #include <linux/swapops.h> +#include <linux/vmalloc.h> #include <asm/uaccess.h> #include "internal.h"
@@ -380,6 +381,15 @@ unsigned long vm_mmap(struct file *file, unsigned long addr, }EXPORT_SYMBOL (vm_mmap); +void kvfree (const void *addr) +{ +if (is_vmalloc_addr (addr)) +vfree (addr); +else +kfree (addr); +} +EXPORT_SYMBOL (kvfree); +struct address_space *page_mapping (struct page *page) {struct address_space *mapping = page->mapping;
security/apparmor/include/apparmor.h +0 -1
@@ -66,7 +66,6 @@ extern int apparmor_initialized __initdata;char *aa_split_fqname (char *args,char **ns_name);void aa_info_message (const char *str);void *__aa_kvmalloc (size_t size,gfp_t flags); -void kvfree (void *buffer);static inline void *kvmalloc (size_t size) {
security/apparmor/lib.c +0 -14
@@ -104,17 +104,3 @@ void *__aa_kvmalloc(size_t size, gfp_t flags) }return buffer; } - -/** -* kvfree - free an allocation do by kvmalloc -* @buffer: buffer to free (MAYBE_NULL) -* -* Free a buffer allocated by kvmalloc -*/ -void kvfree (void *buffer) -{ -if (is_vmalloc_addr (buffer)) -vfree (buffer); -else -kfree (buffer); -}
Signature · 1 line
2.3.5
PATCH 70/83 KVM: remove redundant assignments in __kvm_set_memory_region
In reply to Jiri SlabyFrom: Christian Borntraeger <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f2a25160887e00434ce1361007009120e1fecbda upstream.
__kvm_set_memory_region sets r to EINVAL very early. Doing it again is not necessary. The same is true later on, where r is assigned -ENOMEM twice.
--- virt/kvm/kvm_main.c | 3 --- 1 file changed, 3 deletions(-)
virt/kvm/kvm_main.c +0 -3
@@ -774,7 +774,6 @@ int __kvm_set_memory_region(struct kvm *kvm, base_gfn = mem->guest_phys_addr >>PAGE_SHIFT ; npages = mem->memory_size >>PAGE_SHIFT ; - r = -EINVAL ;if (npages >KVM_MEM_MAX_NR_PAGES ) goto out;
@@ -788,7 +787,6 @@ int __kvm_set_memory_region(struct kvm *kvm, new.npages = npages; new.flags = mem->flags; - r = -EINVAL ;if (npages) {if (!old.npages) change =KVM_MR_CREATE ;
@@ -844,7 +842,6 @@ int __kvm_set_memory_region(struct kvm *kvm, }if ((change ==KVM_MR_DELETE ) || (change ==KVM_MR_MOVE )) { - r = -ENOMEM ; slots =kmemdup (kvm->memslots,sizeof (struct kvm_memslots ),GFP_KERNEL );if (!slots)
Signature · 1 line
2.3.5
PATCH 71/83 kvm: commonize allocation of the new memory slots
In reply to Jiri SlabyFrom: Paolo Bonzini <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f2a81036516e2b97c07c49dd6d51d36bfa43593d upstream.
The two kmemdup invocations can be unified. I find that the new placement of the comment makes it easier to see what happens.
--- virt/kvm/kvm_main.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-)
virt/kvm/kvm_main.c +11 -17
@@ -841,11 +841,12 @@ int __kvm_set_memory_region(struct kvm *kvm, goto out_free; } + slots =kmemdup (kvm->memslots,sizeof (struct kvm_memslots ), +GFP_KERNEL ); +if (!slots) + goto out_free; +if ((change ==KVM_MR_DELETE ) || (change ==KVM_MR_MOVE )) { - slots =kmemdup (kvm->memslots,sizeof (struct kvm_memslots ), -GFP_KERNEL ); -if (!slots) - goto out_free; slot =id_to_memslot (slots, mem->slot); slot->flags |=KVM_MEMSLOT_INVALID ;
@@ -861,6 +862,12 @@ int __kvm_set_memory_region(struct kvm *kvm,* - kvm_is_visible_gfn (mmu_check_roots) */ kvm_arch_flush_shadow_memslot (kvm, slot); + +/* +* We can re-use the old_memslots from above, the only difference +* from the currently installed memslots is the invalid flag. This +* will get overwritten by update_memslots anyway. +*/ slots = old_memslots; }
@@ -868,19 +875,6 @@ int __kvm_set_memory_region(struct kvm *kvm,if (r) goto out_slots; - r = -ENOMEM ; -/* -* We can re-use the old_memslots from above, the only difference -* from the currently installed memslots is the invalid flag. This -* will get overwritten by update_memslots anyway. -*/ -if (!slots) { - slots =kmemdup (kvm->memslots,sizeof (struct kvm_memslots ), -GFP_KERNEL ); -if (!slots) - goto out_free; - } -/* * IOMMU mapping: New slots need to be mapped. Old slots need to be * un-mapped and re-mapped if their base changes. Since base change
Signature · 1 line
2.3.5
PATCH 72/83 kvm: avoid page allocation failure in kvm_set_memory_region()
In reply to Jiri SlabyFrom: Igor Mammedov <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 744961341d472db6272ed9b42319a90f5a2aa7c4 upstream.
KVM guest can fail to startup with following trace on host:
qemu-system-x86: page allocation failure: order:4, mode:0x40d0
Call Trace: dump_stack+0x47/0x67 warn_alloc_failed+0xee/0x150 __alloc_pages_direct_compact+0x14a/0x150 __alloc_pages_nodemask+0x776/0xb80 alloc_kmem_pages+0x3a/0x110 kmalloc_order+0x13/0x50 kmemdup+0x1b/0x40 __kvm_set_memory_region+0x24a/0x9f0 [kvm] kvm_set_ioapic+0x130/0x130 [kvm] kvm_set_memory_region+0x21/0x40 [kvm] kvm_vm_ioctl+0x43f/0x750 [kvm]
Failure happens when attempting to allocate pages for 'struct kvm_memslots', however it doesn't have to be present in physically contiguous (kmalloc-ed) address space, change allocation to kvm_kvzalloc() so that it will be vmalloc-ed when its size is more then a page.
--- virt/kvm/kvm_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
virt/kvm/kvm_main.c +7 -7
@@ -464,7 +464,7 @@ static struct kvm *kvm_create_vm(unsigned long type)BUILD_BUG_ON (KVM_MEM_SLOTS_NUM >SHRT_MAX ); r = -ENOMEM ; - kvm->memslots =kzalloc (sizeof (struct kvm_memslots ),GFP_KERNEL ); + kvm->memslots =kvm_kvzalloc (sizeof (struct kvm_memslots ));if (!kvm->memslots) goto out_err_nosrcu;kvm_init_memslots_id (kvm);
@@ -504,7 +504,7 @@ out_err_nosrcu: out_err_nodisable:for (i =0 ; i <KVM_NR_BUSES ; i++)kfree (kvm->buses[i]); -kfree (kvm->memslots); +kvfree (kvm->memslots);kvm_arch_free_vm (kvm);return ERR_PTR (r); }
@@ -560,7 +560,7 @@ void kvm_free_physmem(struct kvm *kvm)kvm_for_each_memslot (memslot, slots)kvm_free_physmem_slot (memslot,NULL ); -kfree (kvm->memslots); +kvfree (kvm->memslots); }static void kvm_destroy_devices (struct kvm *kvm)
@@ -841,10 +841,10 @@ int __kvm_set_memory_region(struct kvm *kvm, goto out_free; } - slots =kmemdup (kvm->memslots,sizeof (struct kvm_memslots ), -GFP_KERNEL ); + slots =kvm_kvzalloc (sizeof (struct kvm_memslots ));if (!slots) goto out_free; +memcpy (slots, kvm->memslots,sizeof (struct kvm_memslots ));if ((change ==KVM_MR_DELETE ) || (change ==KVM_MR_MOVE )) { slot =id_to_memslot (slots, mem->slot);
@@ -901,12 +901,12 @@ int __kvm_set_memory_region(struct kvm *kvm,kvm_arch_commit_memory_region (kvm, mem, &old, change);kvm_free_physmem_slot (&old, &new); -kfree (old_memslots); +kvfree (old_memslots);return 0 ; out_slots: -kfree (slots); +kvfree (slots); out_free:kvm_free_physmem_slot (&new, &old); out:
Signature · 1 line
2.3.5
PATCH 73/83 Input: sirfsoc-onkey - fix GPL v2 license string typo
In reply to Jiri SlabyFrom: Bjorn Helgaas <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 67f4aef20055afec73e37e7752bc6cc74fa01dea upstream.
Per license_is_gpl_compatible(), the MODULE_LICENSE() string for GPL v2 is "GPL v2", not "GPLv2". Use "GPL v2" so this module doesn't taint the kernel.
--- drivers/input/misc/sirfsoc-onkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/sirfsoc-onkey.c +1 -1
@@ -159,7 +159,7 @@ static struct platform_driver sirfsoc_pwrc_driver = {module_platform_driver (sirfsoc_pwrc_driver); -MODULE_LICENSE ("GPLv2" ); +MODULE_LICENSE ("GPL v2" );MODULE_AUTHOR ("Binghua Duan <[email protected]>, Xianglong Du <[email protected]>" );MODULE_DESCRIPTION ("CSR Prima2 PWRC Driver" );MODULE_ALIAS ("platform:sirfsoc-pwrc" );
Signature · 1 line
2.3.5
PATCH 74/83 Input: twl4030-pwrbutton - ensure a wakeup event is recorded.
In reply to Jiri SlabyFrom: NeilBrown <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c42bfd7f6cd26e8f712fc184460e32845d928d17 upstream.
This button is treated as a wakeup source, so we need to initialise it correctly.
Without the device_init_wakeup() call, dev->power.wakeup will be NULL, and pm_wakeup_event() will do nothing.
--- drivers/input/misc/twl4030-pwrbutton.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/misc/twl4030-pwrbutton.c +1 -0
@@ -85,6 +85,7 @@ static int __init twl4030_pwrbutton_probe(struct platform_device *pdev) }platform_set_drvdata (pdev, pwr); +device_init_wakeup (&pdev->dev, true);return 0 ;
Signature · 1 line
2.3.5
PATCH 75/83 Bluetooth: ath3k: Add support of MCI 13d3:3408 bt device
In reply to Jiri SlabyFrom: Dmitry Tunin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3bb30a7cdf9242aca90d49aa41baebf9458f96f0 upstream.
Add support for Bluetooth MCI WB335 (AR9565) Wi-Fi+bt module. This Bluetooth module requires loading patch and sysconfig by ath3k driver.
T: Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 20 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=13d3 ProdID=3408 Rev= 0.02 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
--- drivers/bluetooth/ath3k.c | 2 ++ drivers/bluetooth/btusb.c | 1 + 2 files changed, 3 insertions(+)
drivers/bluetooth/ath3k.c +2 -0
@@ -106,6 +106,7 @@ static struct usb_device_id ath3k_table[] = { { USB_DEVICE(0x13d3, 0x3375) }, { USB_DEVICE(0x13d3, 0x3393) }, { USB_DEVICE(0x13d3, 0x3402) }, + { USB_DEVICE(0x13d3, 0x3408) }, { USB_DEVICE(0x13d3, 0x3432) },/* Atheros AR5BBU12 with sflash firmware */
@@ -158,6 +159,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },/* Atheros AR5BBU22 with sflash firmware */
drivers/bluetooth/btusb.c +1 -0
@@ -183,6 +183,7 @@ static struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },/* Atheros AR5BBU12 with sflash firmware */
Signature · 1 line
2.3.5
PATCH 76/83 Bluetooth: ath3k: Add support of AR3012 bluetooth 13d3:3423 device
In reply to Jiri SlabyFrom: Dmitry Tunin <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 033efa920a7f22a8caf7a38d851a2f451781bbf7 upstream.
Add support of 13d3:3423 device.
T: Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=13d3 ProdID=3423 Rev= 0.01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
--- drivers/bluetooth/ath3k.c | 2 ++ drivers/bluetooth/btusb.c | 1 + 2 files changed, 3 insertions(+)
drivers/bluetooth/ath3k.c +2 -0
@@ -107,6 +107,7 @@ static struct usb_device_id ath3k_table[] = { { USB_DEVICE(0x13d3, 0x3393) }, { USB_DEVICE(0x13d3, 0x3402) }, { USB_DEVICE(0x13d3, 0x3408) }, + { USB_DEVICE(0x13d3, 0x3423) }, { USB_DEVICE(0x13d3, 0x3432) },/* Atheros AR5BBU12 with sflash firmware */
@@ -160,6 +161,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3423), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },/* Atheros AR5BBU22 with sflash firmware */
drivers/bluetooth/btusb.c +1 -0
@@ -184,6 +184,7 @@ static struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x13d3, 0x3423), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },/* Atheros AR5BBU12 with sflash firmware */
Signature · 1 line
2.3.5
PATCH 77/83 Bluetooth: Add USB device 04ca:3010 as Atheros AR3012
In reply to Jiri SlabyFrom: Janne Heikkinen <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 134d3b3550f050b9bec37111824452064d1ed928 upstream.
Asus X553MA has USB device 04ca:3010 that is Atheros AR3012 or compatible.
Device from /sys/kernel/debug/usb/devices:
T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#= 27 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=04ca ProdID=3010 Rev= 0.02 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
--- drivers/bluetooth/ath3k.c | 2 ++ drivers/bluetooth/btusb.c | 1 + 2 files changed, 3 insertions(+)
drivers/bluetooth/ath3k.c +2 -0
@@ -87,6 +87,7 @@ static struct usb_device_id ath3k_table[] = { { USB_DEVICE(0x04CA, 0x3007) }, { USB_DEVICE(0x04CA, 0x3008) }, { USB_DEVICE(0x04CA, 0x300b) }, + { USB_DEVICE(0x04CA, 0x3010) }, { USB_DEVICE(0x0930, 0x0219) }, { USB_DEVICE(0x0930, 0x0220) }, { USB_DEVICE(0x0930, 0x0227) },
@@ -140,6 +141,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
drivers/bluetooth/btusb.c +1 -0
@@ -164,6 +164,7 @@ static struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
Signature · 1 line
2.3.5
PATCH 78/83 netfilter: conntrack: disable generic tracking for known protocols
In reply to Jiri SlabyFrom: Florian Westphal <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit db29a9508a9246e77087c5531e45b2c88ec6988b upstream.
Given following iptables ruleset:
-P FORWARD DROP
-A FORWARD -m sctp --dport 9 -j ACCEPT
-A FORWARD -p tcp --dport 80 -j ACCEPT
-A FORWARD -p tcp -m conntrack -m state ESTABLISHED,RELATED -j ACCEPT
One would assume that this allows SCTP on port 9 and TCP on port 80. Unfortunately, if the SCTP conntrack module is not loaded, this allows *all* SCTP communication, to pass though, i.e. -p sctp -j ACCEPT, which we think is a security issue.
This is because on the first SCTP packet on port 9, we create a dummy "generic l4" conntrack entry without any port information (since conntrack doesn't know how to extract this information).
All subsequent packets that are unknown will then be in established state since they will fallback to proto_generic and will match the 'generic' entry.
Our originally proposed version [1] completely disabled generic protocol tracking, but Jozsef suggests to not track protocols for which a more suitable helper is available, hence we now mitigate the issue for in tree known ct protocol helpers only, so that at least NAT and direction information will still be preserved for others.
[1] http://www.spinics.net/lists/netfilter-devel/msg33430.html
Joint work with Daniel Borkmann.
Fixes CVE-2014-8160.
--- net/netfilter/nf_conntrack_proto_generic.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_proto_generic.c +25 -1
@@ -14,6 +14,30 @@static unsigned int nf_ct_generic_timeout__read_mostly =600 *HZ ; +static bool nf_generic_should_process (u8 proto) +{ +switch (proto) { +#ifdef CONFIG_NF_CT_PROTO_SCTP_MODULE +case IPPROTO_SCTP : +return false; +#endif +#ifdef CONFIG_NF_CT_PROTO_DCCP_MODULE +case IPPROTO_DCCP : +return false; +#endif +#ifdef CONFIG_NF_CT_PROTO_GRE_MODULE +case IPPROTO_GRE : +return false; +#endif +#ifdef CONFIG_NF_CT_PROTO_UDPLITE_MODULE +case IPPROTO_UDPLITE : +return false; +#endif +default : +return true; + } +} +static inline struct nf_generic_net *generic_pernet (struct net *net) {return &net->ct.nf_ct_proto.generic;
@@ -67,7 +91,7 @@ static int generic_packet(struct nf_conn *ct,static bool generic_new (struct nf_conn *ct,const struct sk_buff *skb,unsigned int dataoff,unsigned int *timeouts) { -return true; +return nf_generic_should_process (nf_ct_protonum (ct)); }#if IS_ENABLED (CONFIG_NF_CT_NETLINK_TIMEOUT )
Signature · 1 line
2.3.5
PATCH 79/83 KVM: x86: SYSENTER emulation is broken
In reply to Jiri SlabyFrom: Nadav Amit <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f3747379accba8e95d70cec0eae0582c8c182050 upstream.
SYSENTER emulation is broken in several ways:
1. It misses the case of 16-bit code segments completely (CVE-2015-0239).
2. MSR_IA32_SYSENTER_CS is checked in 64-bit mode incorrectly (bits 0 and 1 can still be set without causing #GP).
3. MSR_IA32_SYSENTER_EIP and MSR_IA32_SYSENTER_ESP are not masked in legacy-mode.
4. There is some unneeded code.
Fix it.
[zhangzhiqiang: backport to 3.10:
- adjust context
- in 3.10 context "ctxt->eflags &= ~(EFLG_VM | EFLG_IF | EFLG_RF)" is replaced by "ctxt->eflags &= ~(EFLG_VM | EFLG_IF)" in upstream, which was changed by another commit.
- After the above adjustments, becomes same to the original patch:
https://github.com/torvalds/linux/commit/f3747379accba8e95d70cec0eae0582c8c182050
]
--- arch/x86/kvm/emulate.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-)
arch/x86/kvm/emulate.c +8 -19
@@ -2292,7 +2292,7 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt)* Not recognized on AMD in compat mode (but is recognized in legacy * mode). */ -if ((ctxt->mode ==X86EMUL_MODE_PROT32 ) && (efer &EFER_LMA ) +if ((ctxt->mode !=X86EMUL_MODE_PROT64 ) && (efer &EFER_LMA ) && !vendor_intel (ctxt))return emulate_ud (ctxt);
@@ -2305,25 +2305,13 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt)setup_syscalls_segments (ctxt, &cs, &ss); ops->get_msr (ctxt,MSR_IA32_SYSENTER_CS , &msr_data); -switch (ctxt->mode) { -case X86EMUL_MODE_PROT32 : -if ((msr_data &0xfffc ) ==0x0 ) -return emulate_gp (ctxt,0 ); -break ; -case X86EMUL_MODE_PROT64 : -if (msr_data ==0x0 ) -return emulate_gp (ctxt,0 ); -break ; -default : -break ; - } +if ((msr_data &0xfffc ) ==0x0 ) +return emulate_gp (ctxt,0 ); ctxt->eflags &= ~(EFLG_VM |EFLG_IF |EFLG_RF ); - cs_sel = (u16 )msr_data; - cs_sel &= ~SELECTOR_RPL_MASK ; + cs_sel = (u16 )msr_data & ~SELECTOR_RPL_MASK ; ss_sel = cs_sel +8 ; - ss_sel &= ~SELECTOR_RPL_MASK ; -if (ctxt->mode ==X86EMUL_MODE_PROT64 || (efer &EFER_LMA )) { +if (efer &EFER_LMA ) { cs.d =0 ; cs.l =1 ; }
@@ -2332,10 +2320,11 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt) ops->set_segment (ctxt, ss_sel, &ss,0 ,VCPU_SREG_SS ); ops->get_msr (ctxt,MSR_IA32_SYSENTER_EIP , &msr_data); - ctxt->_eip = msr_data; + ctxt->_eip = (efer &EFER_LMA ) ? msr_data : (u32 )msr_data; ops->get_msr (ctxt,MSR_IA32_SYSENTER_ESP , &msr_data); - *reg_write (ctxt,VCPU_REGS_RSP ) = msr_data; + *reg_write (ctxt,VCPU_REGS_RSP ) = (efer &EFER_LMA ) ? msr_data : + (u32 )msr_data;return X86EMUL_CONTINUE ; }
Signature · 1 line
2.3.5
PATCH 80/83 mm: softdirty: unmapped addresses between VMAs are clean
In reply to Jiri SlabyFrom: Peter Feiner <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 81d0fa623c5b8dbd5279d9713094b0f9b0a00fb4 upstream.
If a /proc/pid/pagemap read spans a [VMA, an unmapped region, then a VM_SOFTDIRTY VMA], the virtual pages in the unmapped region are reported as softdirty. Here's a program to demonstrate the bug:
int main() {
const uint64_t PAGEMAP_SOFTDIRTY = 1ul << 55;
uint64_t pme[3];
int fd = open("/proc/self/pagemap", O_RDONLY);;
char *m = mmap(NULL, 3 * getpagesize(), PROT_READ,
MAP_ANONYMOUS | MAP_SHARED, -1, 0);
munmap(m + getpagesize(), getpagesize());
pread(fd, pme, 24, (unsigned long) m / getpagesize() * 8);
assert(pme[0] & PAGEMAP_SOFTDIRTY); /* passes */
assert(!(pme[1] & PAGEMAP_SOFTDIRTY)); /* fails */
assert(pme[2] & PAGEMAP_SOFTDIRTY); /* passes */
return 0;
}(Note that all pages in new VMAs are softdirty until cleared).
Tested:
Used the program given above. I'm going to include this code in a selftest in the future.
--- fs/proc/task_mmu.c | 61 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 21 deletions(-)
fs/proc/task_mmu.c +40 -21
@@ -998,7 +998,6 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,struct pagemapread *pm = walk->private;pte_t *pte;int err =0 ; -pagemap_entry_t pme =make_pme (PM_NOT_PRESENT (pm->v2));/* find the first VMA at or above 'addr' */ vma =find_vma (walk->mm, addr);
@@ -1012,6 +1011,7 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,for (; addr != end; addr +=PAGE_SIZE ) {unsigned long offset; +pagemap_entry_t pme; offset = (addr & ~PAGEMAP_WALK_MASK ) >>PAGE_SHIFT ;
@@ -1026,32 +1026,51 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,if (pmd_trans_unstable (pmd))return 0 ; -for (; addr != end; addr +=PAGE_SIZE ) { -int flags2; - -/* check to see if we've left 'vma' behind -* and need a new, higher one */ -if (vma && (addr >= vma->vm_end)) { - vma =find_vma (walk->mm, addr); -if (vma && (vma->vm_flags &VM_SOFTDIRTY )) - flags2 = __PM_SOFT_DIRTY; -else - flags2 =0 ; - pme =make_pme (PM_NOT_PRESENT (pm->v2) |PM_STATUS2 (pm->v2, flags2)); + +while (1 ) { +/* End of address space hole, which we mark as non-present. */ +unsigned long hole_end; + +if (vma) + hole_end =min (end, vma->vm_start); +else + hole_end = end; + +for (; addr < hole_end; addr +=PAGE_SIZE ) { +pagemap_entry_t pme =make_pme (PM_NOT_PRESENT (pm->v2)); + + err =add_to_pagemap (addr, &pme, pm); +if (err) +return err; } -/* check that 'vma' actually covers this address, -* and that it isn't a huge page vma */ -if (vma && (vma->vm_start <= addr) && - !is_vm_hugetlb_page (vma)) { +if (!vma || vma->vm_start >= end) +break ; +/* +* We can't possibly be in a hugetlb VMA. In general, +* for a mm_walk with a pmd_entry and a hugetlb_entry, +* the pmd_entry can only be called on addresses in a +* hugetlb if the walk starts in a non-hugetlb VMA and +* spans a hugepage VMA. Since pagemap_read walks are +* PMD-sized and PMD-aligned, this will never be true. +*/ +BUG_ON (is_vm_hugetlb_page (vma)); + +/* Addresses in the VMA. */ +for (; addr <min (end, vma->vm_end); addr +=PAGE_SIZE ) { +pagemap_entry_t pme; pte =pte_offset_map (pmd, addr);pte_to_pagemap_entry (&pme, pm, vma, addr, *pte); -/* unmap before userspace copy */ pte_unmap (pte); + err =add_to_pagemap (addr, &pme, pm); +if (err) +return err; } - err =add_to_pagemap (addr, &pme, pm); -if (err) -return err; + +if (addr == end) +break ; + + vma =find_vma (walk->mm, addr); }cond_resched ();
Signature · 1 line
2.3.5
PATCH 81/83 proc/pagemap: walk page tables under pte lock
In reply to Jiri SlabyFrom: Konstantin Khlebnikov <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 05fbf357d94152171bc50f8a369390f1f16efd89 upstream.
Lockless access to pte in pagemap_pte_range() might race with page migration and trigger BUG_ON(!PageLocked()) in migration_entry_to_page():
CPU A (pagemap) CPU B (migration)
lock_page()
try_to_unmap(page, TTU_MIGRATION...)
make_migration_entry()
set_pte_at()<read *pte>pte_to_pagemap_entry()
remove_migration_ptes() unlock_page()
if(is_migration_entry())
migration_entry_to_page()
BUG_ON(!PageLocked(page))
Also lockless read might be non-atomic if pte is larger than wordsize. Other pte walkers (smaps, numa_maps, clear_refs) already lock ptes.
--- fs/proc/task_mmu.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
fs/proc/task_mmu.c +10 -5
@@ -996,7 +996,8 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, {struct vm_area_struct *vma;struct pagemapread *pm = walk->private; -pte_t *pte; +spinlock_t *ptl; +pte_t *pte, *orig_pte;int err =0 ;/* find the first VMA at or above 'addr' */
@@ -1057,15 +1058,19 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,BUG_ON (is_vm_hugetlb_page (vma));/* Addresses in the VMA. */ -for (; addr <min (end, vma->vm_end); addr +=PAGE_SIZE ) { + orig_pte = pte =pte_offset_map_lock (walk->mm, pmd, addr, &ptl); +for (; addr <min (end, vma->vm_end); pte++, addr +=PAGE_SIZE ) {pagemap_entry_t pme; - pte =pte_offset_map (pmd, addr); +pte_to_pagemap_entry (&pme, pm, vma, addr, *pte); -pte_unmap (pte); err =add_to_pagemap (addr, &pme, pm);if (err) -return err; +break ; } +pte_unmap_unlock (orig_pte, ptl); + +if (err) +return err;if (addr == end)break ;
Signature · 1 line
2.3.5
PATCH 82/83 Input: elantech - fix crc_enabled for Fujitsu H730
In reply to Jiri SlabyFrom: Ulrik De Bie <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 0dc1587905a50f8f61bbc29e850aa592821e4bea upstream.
The Fujitsu H730 does not work with crc_enabled = 0, even though the crc_enabled bit in the firmware version indicated it would. When switching this value to crc_enabled to 1, the touchpad works. This patch uses DMI to detect H730.
--- drivers/input/mouse/elantech.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/input/mouse/elantech.c +18 -1
@@ -1357,6 +1357,22 @@ static int elantech_reconnect(struct psmouse *psmouse) }/* +* Some hw_version 4 models do not work with crc_disabled +*/ +static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = { +#if defined(CONFIG_DMI) && defined(CONFIG_X86) + { +/* Fujitsu H730 does not work with crc_enabled == 0 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"FUJITSU" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"CELSIUS H730" ), + }, + }, +#endif + { } +}; + +/* * Some hw_version 3 models go into error state when we try to set * bit 3 and/or bit 1 of r10. */
@@ -1430,7 +1446,8 @@ static int elantech_set_properties(struct elantech_data *etd)* The signatures of v3 and v4 packets change depending on the * value of this hardware flag. */ - etd->crc_enabled = ((etd->fw_version &0x4000 ) ==0x4000 ); + etd->crc_enabled = (etd->fw_version &0x4000 ) ==0x4000 || +dmi_check_system (elantech_dmi_force_crc_enabled);/* Enable real hardware resolution on hw_version 3 ? */ etd->set_hw_resolution = !dmi_check_system (no_hw_res_dmi_table);
Signature · 1 line
2.3.5
PATCH 83/83 Input: elantech - add more Fujtisu notebooks to force crc_enabled
In reply to Jiri SlabyFrom: Rainer Koenig <[email protected]>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 47c1ffb2b6b630894e9a16442611c056ab21c057 upstream.
Add two more Fujitsu LIFEBOOK models that also ship with the Elantech touchpad and don't work with crc_disabled to the quirk list.
--- drivers/input/mouse/elantech.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/input/mouse/elantech.c +16 -0
@@ -1018,6 +1018,8 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,* Asus UX31 0x361f00 20, 15, 0e clickpad * Asus UX32VD 0x361f02 00, 15, 0e clickpad * Avatar AVIU-145A2 0x361f00 ? clickpad +* Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons +* Fujitsu LIFEBOOK E554 0x570f01 40, 14, 0c 2 hw buttons * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons * Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*) * Samsung NF210 0x150b00 78, 14, 0a 2 hw buttons
@@ -1368,6 +1370,20 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = { DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), }, }, + { +/* Fujitsu LIFEBOOK E554 does not work with crc_enabled == 0 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"FUJITSU" ), + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E554"), + }, + }, + { +/* Fujitsu LIFEBOOK E544 does not work with crc_enabled == 0 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"FUJITSU" ), + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E544"), + }, + }, #endif { } };
Signature · 1 line
2.3.5
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.41 release. There are 83 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 Apr 29 20:39:50 CEST 2015. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.41-rc1.xzand the diffstat can be found below.
thanks,
js
Compiled and booted on my test system. No dmesg regressions.
-- Shuah
Signature · 5 lines
Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Quoted 1 line · Shuah Khan
Compiled and booted on my test system. No dmesg regressions.
Quoted 10 lines · Guenter Roeck
Build results:
total: 125 pass: 124 fail: 1Failed builds:
arm64:allmodconfigQemu test results:
total: 27 pass: 27 fail: 0Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Thank you both!
Signature · 2 lines
js suse labs
Quoted 8 lines · Jiri Slaby
This is the start of the stable review cycle for the 3.12.41 release. There are 83 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 Apr 29 20:39:50 CEST 2015. Anything received after that time might be too late.
Build results:
total: 125 pass: 124 fail: 1
Failed builds:
arm64:allmodconfig
Qemu test results:
total: 27 pass: 27 fail: 0
Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Guenter