3.6.11.3-stable review
Subsystems (90)
Steven Rostedt
maintainercover 3.6.11.3-stable review
This is the start of the stable review cycle for 3.6.11.3 release. There are 126 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu May 9 23:54:01. Anything received after that time might be too late.
Aaro Koskinen (1):
ARM: 7692/1: iop3xx: move IOP3XX_PERIPHERAL_VIRT_BASE
[f5d6a1441a5045824f36ff7c6b6bbae0373472a6]Alban Bedel (1):
ASoC: wm8903: Fix the bypass to HP/LINEOUT when no DAC or ADC is running
[f1ca493b0b5e8f42d3b2dc8877860db2983f47b6]
Alex Williamson (1):
vfio-pci: Fix possible integer overflow
[904c680c7bf016a8619a045850937427f8d7368c]
Anatolij Gustschin (1):
spi/mpc512x-psc: optionally keep PSC SS asserted across xfer segmensts
[1ad849aee5f53353ed88d9cd3d68a51b03a7d44f]
Andrew Honig (1):
KVM: Allow cross page reads and writes from cached translations.
[8f964525a121f2ff2df948dac908dcc65be21b5b]
Andy Honig (3):
KVM: Fix bounds checking in ioapic indirect register reads (CVE-2013-1798)
[a2c118bfab8bc6b8bb213abfc35201e441693d55]
KVM: x86: Convert MSR_KVM_SYSTEM_TIME to use gfn_to_hva_cache functions (CVE-2013-1797)
[0b79459b482e85cb7426aa7da683a9f2c97aeae1]
KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796)
[c300aa64ddf57d9c5d9c898a64b36877345dd4a9]Arnd Bergmann (1):
block: avoid using uninitialized value in from queue_var_store
[c678ef5286ddb5cf70384ad5af286b0afc9b73e1]
Artem Bityutskiy (1):
UBIFS: make space fixup work in the remount case
[67e753ca41782913d805ff4a8a2b0f60b26b7915]
Balakumaran Kannan (1):
net IPv6 : Fix broken IPv6 routing table after loopback down-up
[25fb6ca4ed9cad72f14f61629b68dc03c0d9713f]
Ben Greear (1):
net: rate-limit warn-bad-offload splats.
[c846ad9b880ece01bb4d8d07ba917734edf0324f]
Boris Ostrovsky (1):
x86, mm: Patch out arch_flush_lazy_mmu_mode() when running on bare metal
[511ba86e1d386f671084b5d0e6f110bb30b8eeb2]
Christoph Fritz (1):
can: sja1000: fix handling on dt properties on little endian systems
[0443de5fbf224abf41f688d8487b0c307dc5a4b4]
Christoph Paasch (1):
ipv6/tcp: Stop processing ICMPv6 redirect messages
[50a75a8914539c5dcd441c5f54d237a666a426fd]
Christopher Harvey (1):
drm/mgag200: Index 24 in extended CRTC registers is 24 in hex, not decimal.
[1812a3db0874be1d1524086da9e84397b800f546]
Dave Airlie (1):
udl: handle EDID failure properly.
[1baee58638fc58248625255f5c5fcdb987f11b1f]
Dave Hansen (1):
x86-32: Fix possible incomplete TLB invalidate with PAE pagetables
[1de14c3c5cbc9bb17e9dcc648cda51c0c85d54b9]
David Henningsson (1):
ALSA: hda - fix typo in proc output
[aeb3a97222832e5457c4b72d72235098ce4bfe8d]
David Woodhouse (1):
mtd: Disable mtdchar mmap on MMU systems
[f5cf8f07423b2677cebebcebc863af77223a4972]
Dmitry Popov (1):
tcp: incoming connections might use wrong route under synflood
[d66954a066158781ccf9c13c91d0316970fe57b6]
Eldad Zack (1):
ALSA: usb-audio: fix endianness bug in snd_nativeinstruments_*
[889d66848b12d891248b03abcb2a42047f8e172a]
Emese Revfy (1):
kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
[b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f]
Eric Dumazet (2):
net: drop dst before queueing fragments
[97599dc792b45b1669c3cdb9a4b365aad0232f65]
tcp: call tcp_replace_ts_recent() from tcp_ack()
[12fb3dd9dc3c64ba7d64cec977cca9b5fb7b1d4e]
Eric W. Biederman (1):
af_unix: If we don't care about credentials coallesce all messages
[0e82e7f6dfeec1013339612f74abc2cdd29d43d2]
Felix Fietkau (2):
ath9k_hw: change AR9580 initvals to fix a stability issue
[f09a878511997c25a76bf111a32f6b8345a701a5]
ath9k_htc: accept 1.x firmware newer than 1.3
[319e7bd96aca64a478f3aad40711c928405b8b77]
Girish K S (1):
spi/s3c64xx: modified error interrupt handling and init
[375981f2e14868be16cafbffd34a4f16a6ee01c6]
Hannes Frederic Sowa (1):
atl1e: limit gso segment size to prevent generation of wrong ip length fields
[31d1670e73f4911fe401273a8f576edc9c2b5fea]
Huacai Chen (1):
PM / reboot: call syscore_shutdown() after disable_nonboot_cpus()
[6f389a8f1dd22a24f3d9afc2812b30d639e94625]
Illia Ragozin (1):
ARM: 7696/1: Fix kexec by setting outer_cache.inv_all for Feroceon
[cd272d1ea71583170e95dde02c76166c7f9017e6]
Jan Beulich (1):
x86: Fix rebuild with EFI_STUB enabled
[918708245e92941df16a634dc201b407d12bcd91]
Jan Kiszka (1):
ftrace: Consistently restore trace function on sysctl enabling
[5000c418840b309251c5887f0b56503aae30f84c]
Jan Stancek (1):
mm: prevent mmap_cache race in find_vma()
[b6a9b7f6b1f21735a7456d534dc0e68e61359d2c]
Jani Nikula (3):
drm/i915: add quirk to invert brightness on Packard Bell NCL20
[5559ecadad5a73b27f863e92f4b4f369501dce6f]
drm/i915: add quirk to invert brightness on eMachines e725
[01e3a8feb40e54b962a20fa7eb595c5efef5e109]
drm/i915: add quirk to invert brightness on eMachines G725
[1ffff60320879830e469e26062c18f75236822ba]
Jay Estabrook (1):
alpha: Add irongate_io to PCI bus resources
[aa8b4be3ac049c8b1df2a87e4d1d902ccfc1f7a9]
Jiri Slaby (2):
TTY: fix atime/mtime regression
[37b7f3c76595e23257f61bd80b223de8658617ee]
TTY: do not update atime/mtime on read/write
[b0de59b5733d18b0d1974a060860a8b5c1b36a2e]
Johannes Berg (2):
mac80211: fix cfg80211 interaction on auth/assoc request
[7b119dc06d871405fc7c3e9a73a6c987409ba639]
mac80211: fix remain-on-channel cancel crash
[3fbd45ca8d1c98f3c2582ef8bc70ade42f70947b]
Jonghwan Choi (1):
cpufreq: exynos: Get booting freq value in exynos_cpufreq_init
[6e45eb12fd1c741d556bf264ee98853b5f3104e5]
Josef Bacik (1):
Btrfs: make sure nbytes are right after log replay
[4bc4bee4595662d8bff92180d5c32e3313a704b0]
Jussi Kivilinna (1):
crypto: gcm - fix assumption that assoc has one segment
[d3dde52209ab571e4e2ec26c66f85ad1355f7475]
Lars-Peter Clausen (3):
regmap: cache Fix regcache-rbtree sync
[8abac3ba51b5525354e9b2ec0eed1c9e95c905d9]
ASoC: spear_pcm: Update to new pcm_new() API
[59d9cc2a5073ab4b8c8f8bdbacf230a538abc55d]
ASoC: dma-sh7760: Fix compile error
[417a1178f1bf3cdc606376b3ded3a22489fbb3eb]
Li Fei (1):
hwspinlock: fix __hwspin_lock_request error path
[c10b90d85a5126d25c89cbaa50dc9fdd1c4d001a]
Linus Torvalds (9):
net: fix incorrect credentials passing
[83f1b4ba917db5dc5a061a44b3403ddb6e783494]
Add file_ns_capable() helper function for open-time capability checking
[935d8aabd4331f47a89c3e1daa5779d23cf244ee]
vm: convert mtdchar mmap to vm_iomap_memory() helper
[8558e4a26b00225efeb085725bc319f91201b239]
vm: convert HPET mmap to vm_iomap_memory() helper
[2323036dfec8ce3ce6e1c86a49a31b039f3300d1]
vm: convert fb_mmap to vm_iomap_memory() helper
[fc9bbca8f650e5f738af8806317c0a041a48ae4a]
vm: convert snd_pcm_lib_mmap_iomem() to vm_iomap_memory() helper
[0fe09a45c4848b5b5607b968d959fdc1821c161d]
vm: add vm_iomap_memory() helper function
[b4cbb197c7e7a68dbad0d491242e3ca67420c13e]
kobject: fix kset_find_obj() race with concurrent last kobject_put()
[a49b7e82cab0f9b41f483359be83f44fbb6b4979]
spinlocks and preemption points need to be at least compiler barriers
[386afc91144b36b42117b0092893f15bc8798a80]
Linus Walleij (1):
crypto: ux500 - add missing comma
[d47cbd5bcee7c7a08fc0283dda465375fa1b1fda]
Lukasz Dorau (1):
libsas: fix handling vacant phy in sas_set_ex_phy()
[d4a2618fa77b5e58ec15342972bd3505a1c3f551]
Marc Kleine-Budde (1):
can: mcp251x: add missing IRQF_ONESHOT to request_threaded_irq
[db388d6460ffa53b3b38429da6f70a913f89b048]
Markus Pargmann (1):
ARM: clk-imx35: Bugfix iomux clock
[cab1e0a36c9dd0b0671fb84197ed294513f5adc1]
Mathias Krause (14):
tipc: fix info leaks via msg_name in recv_msg/recv_stream
[60085c3d009b0df252547adb336d1ccca5ce52ec]
rose: fix info leak via msg_name in rose_recvmsg()
[4a184233f21645cf0b719366210ed445d1024d72]
NFC: llcp: fix info leaks via msg_name in llcp_sock_recvmsg()
[d26d6504f23e803824e8ebd14e52d4fc0a0b09cb]
netrom: fix info leak via msg_name in nr_recvmsg()
[3ce5efad47b62c57a4f5c54248347085a750ce0e]
llc: Fix missing msg_namelen update in llc_ui_recvmsg()
[c77a4b9cffb6215a15196ec499490d116dfad181]
l2tp: fix info leak in l2tp_ip6_recvmsg()
[b860d3cc62877fad02863e2a08efff69a19382d2]
iucv: Fix missing msg_namelen update in iucv_sock_recvmsg()
[a5598bd9c087dc0efc250a5221e5d0e6f584ee88]
irda: Fix missing msg_namelen update in irda_recvmsg_dgram()
[5ae94c0d2f0bed41d6718be743985d61b7f5c47d]
caif: Fix missing msg_namelen update in caif_seqpkt_recvmsg()
[2d6fbfe733f35c6b355c216644e08e149c61b271]
Bluetooth: RFCOMM - Fix missing msg_namelen update in rfcomm_sock_recvmsg()
[e11e0455c0d7d3d62276a0c55d9dfbc16779d691]
Bluetooth: fix possible info leak in bt_sock_recvmsg()
[4683f42fde3977bdb4e8a09622788cc8b5313778]
ax25: fix info leak via msg_name in ax25_recvmsg()
[ef3313e84acbf349caecae942ab3ab731471f1a1]
atm: update msg_namelen in vcc_recvmsg()
[9b3e617f3df53822345a8573b6d358f6b9e5ed87]
crypto: algif - suppress sending source address information in recvmsg
[72a763d805a48ac8c0bf48fdb510e84c12de51fe]
Matt Carlson (1):
tg3: Add 57766 device support.
[d3f677afb8076d09d090ff0a5d1229c9dd9f136e]Maxim Mikityanskiy (1):
msi-wmi: Fix memory leak
[51c94491c82c3d9029f6e87a1a153db321d88e35]
Michael Bohan (1):
hrtimer: Don't reinitialize a cpu_base lock on CPU_UP
[84cc8fd2fe65866e49d70b38b3fdf7219dd92fe0]
Michael Riesch (1):
rtnetlink: Call nlmsg_parse() with correct header length
[88c5b5ce5cb57af6ca2a7cf4d5715fa320448ff9]
Michael Wolf (1):
powerpc: pSeries_lpar_hpte_remove fails from Adjunct partition being performed before the ANDCOND test
[9fb2640159f9d4f5a2a9d60e490482d4cbecafdb]
Namhyung Kim (2):
tracing: Fix possible NULL pointer dereferences
[6a76f8c0ab19f215af2a3442870eeb5f0e81998d]
tracing: Fix double free when function profile init failed
[83e03b3fe4daffdebbb42151d5410d730ae50bd1]
Naoya Horiguchi (1):
hugetlbfs: add swap entry check in follow_hugetlb_page()
[9cc3a5bd40067b9a0fbd49199d0780463fc2140f]
Nicholas Bellinger (1):
target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs
[30f359a6f9da65a66de8cadf959f0f4a0d498bba]
Paul Moore (1):
x86: remove the x32 syscall bitmask from syscall_get_nr()
[8b4b9f27e57584f3d90e0bb84cf800ad81cfe3a1]
Rafael J. Wysocki (1):
PCI/PM: Disable runtime PM of PCIe ports
[de7d5f729c72638f41d7c17487bccb1c570ff144]
Rafał Miłecki (1):
ssb: implement spurious tone avoidance
[46fc4c909339f5a84d1679045297d9d2fb596987]
Rainer Koenig (1):
ALSA: hda - Enabling Realtek ALC 671 codec
[1d87caa69c04008e09f5ff47b5e6acb6116febc7]
Richard Guy Briggs (1):
thermal: return an error on failure to register thermal class
[da28d966f6aa942ae836d09729f76a1647932309]
Robert Tivy (1):
remoteproc: fix FW_CONFIG typo
[c7426bce5933d16b492a34e42ae77e26fceddff6]
Russell King (1):
ARM: Do 15e0d9e37c (ARM: pm: let platforms select cpu_suspend support) properly
[b6c7aabd923a17af993c5a5d5d7995f0b27c000a]
Sachin Prabhu (1):
cifs: Allow passwords which begin with a delimitor
[c369c9a4a7c82d33329d869cbaf93304cc7a0c40]
Samu Kallio (1):
x86, mm, paravirt: Fix vmalloc_fault oops during lazy MMU updates
[1160c2779b826c6f5c08e5cc542de58fd1f667d5]
Sascha Hauer (2):
ARM: i.MX35: enable MAX clock
[5dc2eb7da1e387e31ce54f54af580c6a6f512ca6]
ASoC: imx-ssi: Fix occasional AC97 reset failure
[b6e51600f4e983e757b1b6942becaa1ae7d82e67]
Shan Hai (2):
libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive
[a32450e127fc6e5ca6d958ceb3cfea4d30a00846]
libata: Use integer return value for atapi_command_packet_set
[d8668fcb0b257d9fdcfbe5c172a99b8d85e1cd82]
Sjur Brændeland (1):
remoteproc: fix error path of handle_vdev
[cde42e076c1cdd69a1f955d66ff6596bad3d2105]
Stephane Eranian (1):
perf/x86: Fix offcore_rsp valid mask for SNB/IVB
[f1923820c447e986a9da0fc6bf60c1dccdf0408e]
Stephen Boyd (1):
ARM: 7699/1: sched_clock: Add more notrace to prevent recursion
[cea15092f098b7018e89f64a5a14bb71955965d5]
Steven Rostedt (Red Hat) (1):
ftrace: Move ftrace_filter_lseek out of CONFIG_DYNAMIC_FTRACE section
[7f49ef69db6bbf756c0abca7e9b65b32e999eec8]
Steven Whitehouse (1):
GFS2: Fix unlock of fcntl locks during withdrawn state
[c2952d202f710d326ac36a8ea6bd216b20615ec8]
Stone Piao (1):
mwifiex: limit channel number not to overflow memory
[901ceba4e81e9dd6b4a3c4c37ee22000a6c5c65f]
Suleiman Souhlal (1):
vfs: Revert spurious fix to spinning prevention in prune_icache_sb
[5b55d708335a9e3e4f61f2dadf7511502205ccd1]
Tejun Heo (1):
sched: Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s
[383efcd00053ec40023010ce5034bd702e7ab373]
Thomas Gleixner (1):
sched_clock: Prevent 64bit inatomicity on 32bit systems
[a1cbcaa9ea87b87a96b9fc465951dcf36e459ca2]
Thomas Graf (1):
tcp: Reallocate headroom if it would overflow csum_start
[50bceae9bd3569d56744882f3012734d48a1d413]
Thomas Hellstrom (1):
kref: Implement kref_get_unless_zero v3
[4b20db3de8dab005b07c74161cb041db8c5ff3a7]
Tim Gardner (1):
rt2x00: rt2x00pci_regbusy_read() - only print register access failure once
[83589b30f1e1dc9898986293c9336b8ce1705dec]
Tommi Rantala (1):
perf: Treat attr.config as u64 in perf_swevent_init()
[8176cced706b5e5d15887584150764894e94e02f]
Vasily Averin (1):
cbq: incorrect processing of high limits
[f0f6ee1f70c4eaab9d52cf7d255df4bd89f8d1c2]
Vlad Yasevich (1):
net: count hw_addr syncs so that unsync works properly.
[4543fbefe6e06a9e40d9f2b28d688393a299f079]
Vyacheslav Dubeyko (1):
hfsplus: fix potential overflow in hfsplus_file_truncate()
[12f267a20aecf8b84a2a9069b9011f1661c779b4]
Wei Yongjun (3):
esp4: fix error return code in esp_output()
[06848c10f720cbc20e3b784c0df24930b7304b93]
netrom: fix invalid use of sizeof in nr_recvmsg()
[c802d759623acbd6e1ee9fbdabae89159a513913]
can: gw: use kmem_cache_free() instead of kfree()
[3480a2125923e4b7a56d79efc76743089bf273fc]
Will Deacon (1):
ARM: 7698/1: perf: fix group validation when using enable_on_exec
[cb2d8b342aa084d1f3ac29966245dec9163677fb]
Yinghai Lu (2):
EISA/PCI: Fix bus res reference
[2cfda637e29ce9e3df31b59f64516b2e571cc985]
EISA/PCI: Init EISA early, before PNP
[c5fb301ae83bec6892e54984e6ec765c47df8e10]
Youquan Song (1):
ata_piix: Fix DVD not dectected at some Haswell platforms
[b55f84e2d527182e7c611d466cd0bb6ddce201de]
Zhao Hongjiang (1):
aio: fix possible invalid memory access when DEBUG is enabled
[91d80a84bbc8f28375cca7e65ec666577b4209ad]
hayeswang (1):
r8169: fix auto speed down issue
[e2409d83434d77874b461b78af6a19cd6e6a1280]
[email protected] (2):
bonding: IFF_BONDING is not stripped on enslave failure
[b6a5a7b9a528a8b4c8bec940b607c5dd9102b8cc]
bonding: fix bonding_masters race condition in bond unloading
[69b0216ac255f523556fa3d4ff030d857eaaa37f]
----
arch/alpha/kernel/sys_nautilus.c | 5 ++ arch/arm/include/asm/hardware/iop3xx.h | 2 +- arch/arm/kernel/perf_event.c | 5 +- arch/arm/kernel/sched_clock.c | 4 +- arch/arm/mach-imx/clk-imx35.c | 2 + arch/arm/mm/cache-feroceon-l2.c | 1 + arch/arm/mm/proc-arm920.S | 2 +- arch/arm/mm/proc-arm926.S | 2 +- arch/arm/mm/proc-mohawk.S | 2 +- arch/arm/mm/proc-sa1100.S | 2 +- arch/arm/mm/proc-v6.S | 2 +- arch/arm/mm/proc-xsc3.S | 2 +- arch/arm/mm/proc-xscale.S | 2 +- arch/powerpc/platforms/pseries/lpar.c | 8 ++- arch/x86/boot/compressed/Makefile | 5 +- arch/x86/include/asm/kvm_host.h | 4 +- arch/x86/include/asm/paravirt.h | 5 +- arch/x86/include/asm/paravirt_types.h | 2 + arch/x86/include/asm/syscall.h | 4 +- arch/x86/include/asm/tlb.h | 2 +- arch/x86/kernel/cpu/perf_event_intel.c | 20 ++++-- arch/x86/kernel/paravirt.c | 25 ++++---- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/x86.c | 45 ++++++------- arch/x86/lguest/boot.c | 1 + arch/x86/mm/fault.c | 6 +- arch/x86/mm/pgtable.c | 7 ++ arch/x86/xen/mmu.c | 1 + block/blk-sysfs.c | 2 + crypto/algif_hash.c | 2 + crypto/algif_skcipher.c | 1 + crypto/gcm.c | 17 ++++- drivers/ata/ata_piix.c | 11 ++++ drivers/ata/libata-core.c | 4 ++ drivers/base/regmap/regcache-rbtree.c | 2 +- drivers/char/hpet.c | 14 +--- drivers/cpufreq/exynos-cpufreq.c | 4 +- drivers/crypto/ux500/cryp/cryp_core.c | 2 +- drivers/eisa/pci_eisa.c | 67 ++++++++++++++------ drivers/gpu/drm/i915/intel_display.c | 9 +++ drivers/gpu/drm/mgag200/mgag200_mode.c | 13 +--- drivers/gpu/drm/udl/udl_connector.c | 4 ++ drivers/hwspinlock/hwspinlock_core.c | 2 + drivers/mtd/mtdchar.c | 38 ++--------- drivers/net/bonding/bond_main.c | 10 +++ drivers/net/can/mcp251x.c | 10 ++- drivers/net/can/sja1000/sja1000_of_platform.c | 31 +++++---- drivers/net/ethernet/atheros/atl1e/atl1e.h | 2 +- drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 1 + drivers/net/ethernet/broadcom/tg3.c | 18 +++++- drivers/net/ethernet/broadcom/tg3.h | 2 + drivers/net/ethernet/realtek/r8169.c | 28 +++++++- .../net/wireless/ath/ath9k/ar9580_1p0_initvals.h | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- drivers/net/wireless/b43/phy_n.c | 3 +- drivers/net/wireless/mwifiex/cfg80211.c | 3 +- drivers/net/wireless/rt2x00/rt2x00pci.c | 4 +- drivers/pci/pcie/portdrv_pci.c | 13 ---- drivers/platform/x86/msi-wmi.c | 4 +- drivers/remoteproc/Kconfig | 2 +- drivers/remoteproc/remoteproc_core.c | 4 +- drivers/scsi/libsas/sas_expander.c | 12 ++++ drivers/spi/spi-mpc512x-psc.c | 2 +- drivers/spi/spi-s3c64xx.c | 41 +++++++----- drivers/ssb/driver_chipcommon_pmu.c | 29 +++++++++ drivers/target/target_core_alua.c | 3 + drivers/thermal/thermal_sys.c | 1 + drivers/tty/tty_io.c | 14 +++- drivers/vfio/pci/vfio_pci.c | 3 +- drivers/video/fbmem.c | 40 ++++-------- fs/aio.c | 2 +- fs/btrfs/tree-log.c | 48 ++++++++++++-- fs/cifs/connect.c | 16 ++++- fs/gfs2/file.c | 5 +- fs/hfsplus/extents.c | 2 +- fs/inode.c | 2 +- fs/ubifs/super.c | 12 ++-- include/asm-generic/tlb.h | 7 +- include/linux/ata.h | 2 +- include/linux/capability.h | 2 + include/linux/ftrace.h | 3 +- include/linux/kref.h | 21 ++++++ include/linux/kvm_host.h | 2 +- include/linux/kvm_types.h | 1 + include/linux/libata.h | 1 + include/linux/mm.h | 2 + include/linux/netdevice.h | 2 +- include/linux/preempt.h | 22 ++++--- include/linux/socket.h | 3 +- include/linux/spinlock_up.h | 29 +++++---- include/linux/ssb/ssb_driver_chipcommon.h | 2 + include/net/scm.h | 2 +- kernel/capability.c | 24 +++++++ kernel/events/core.c | 2 +- kernel/hrtimer.c | 3 +- kernel/sched/clock.c | 26 ++++++++ kernel/sched/core.c | 6 +- kernel/signal.c | 2 +- kernel/sys.c | 3 +- kernel/trace/ftrace.c | 21 +++--- kernel/trace/trace_stack.c | 2 +- lib/kobject.c | 9 ++- mm/hugetlb.c | 12 +++- mm/memory.c | 48 ++++++++++++++ mm/mmap.c | 2 +- mm/nommu.c | 2 +- net/atm/common.c | 2 + net/ax25/af_ax25.c | 1 + net/bluetooth/af_bluetooth.c | 4 +- net/bluetooth/rfcomm/sock.c | 1 + net/caif/caif_socket.c | 2 + net/can/gw.c | 6 +- net/core/dev.c | 3 + net/core/dev_addr_lists.c | 6 +- net/core/rtnetlink.c | 4 +- net/core/sock.c | 14 ++-- net/ipv4/esp4.c | 6 +- net/ipv4/ip_fragment.c | 15 +++-- net/ipv4/syncookies.c | 4 +- net/ipv4/tcp_input.c | 65 ++++++++++--------- net/ipv4/tcp_output.c | 8 ++- net/ipv6/addrconf.c | 27 ++++++++ net/ipv6/reassembly.c | 13 +++- net/ipv6/tcp_ipv6.c | 1 + net/irda/af_irda.c | 2 + net/iucv/af_iucv.c | 2 + net/l2tp/l2tp_ip6.c | 1 + net/llc/af_llc.c | 2 + net/mac80211/cfg.c | 6 +- net/mac80211/ieee80211_i.h | 3 +- net/mac80211/mlme.c | 24 +++++-- net/mac80211/offchannel.c | 23 +++++-- net/netrom/af_netrom.c | 1 + net/nfc/llcp/sock.c | 2 + net/rose/af_rose.c | 1 + net/sched/sch_cbq.c | 5 +- net/tipc/socket.c | 7 ++ net/unix/af_unix.c | 2 +- sound/core/pcm_native.c | 12 +--- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/patch_realtek.c | 4 +- sound/soc/codecs/wm8903.c | 2 + sound/soc/fsl/imx-ssi.c | 5 ++ sound/soc/sh/dma-sh7760.c | 4 +- sound/soc/spear/spear_pcm.c | 12 ++-- sound/usb/mixer_quirks.c | 4 +- sound/usb/quirks.c | 2 +- virt/kvm/ioapic.c | 7 +- virt/kvm/kvm_main.c | 47 +++++++++++--- 149 files changed, 941 insertions(+), 419 deletions(-)
Steven Rostedt
maintainerPATCH 1/126 ASoC: imx-ssi: Fix occasional AC97 reset failure
3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sascha Hauer <[email protected]>
[ Upstream commit b6e51600f4e983e757b1b6942becaa1ae7d82e67 ]
--- sound/soc/fsl/imx-ssi.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/soc/fsl/imx-ssi.c +5 -0
@@ -498,6 +498,8 @@ static void imx_ssi_ac97_reset(struct snd_ac97 *ac97)if (imx_ssi->ac97_reset) imx_ssi->ac97_reset (ac97); +/* First read sometimes fails, do a dummy read */ +imx_ssi_ac97_read (ac97,0 ); }static void imx_ssi_ac97_warm_reset (struct snd_ac97 *ac97)
@@ -506,6 +508,9 @@ static void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97)if (imx_ssi->ac97_warm_reset) imx_ssi->ac97_warm_reset (ac97); + +/* First read sometimes fails, do a dummy read */ +imx_ssi_ac97_read (ac97,0 ); }struct snd_ac97_bus_ops soc_ac97_ops = {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 2/126 ASoC: dma-sh7760: Fix compile error
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
[ Upstream commit 417a1178f1bf3cdc606376b3ded3a22489fbb3eb ]
The dma-sh7760 currently fails with the following compile error:
sound/soc/sh/dma-sh7760.c:346:2: error: unknown field 'pcm_ops' specified in initializer sound/soc/sh/dma-sh7760.c:346:2: warning: initialization from incompatible pointer type sound/soc/sh/dma-sh7760.c:347:2: error: unknown field 'pcm_new' specified in initializer sound/soc/sh/dma-sh7760.c:347:2: warning: initialization makes integer from pointer without a cast sound/soc/sh/dma-sh7760.c:348:2: error: unknown field 'pcm_free' specified in initializer sound/soc/sh/dma-sh7760.c:348:2: warning: initialization from incompatible pointer type sound/soc/sh/dma-sh7760.c: In function 'sh7760_soc_platform_probe':
sound/soc/sh/dma-sh7760.c:353:2: warning: passing argument 2 of 'snd_soc_register_platform' from incompatible pointer type include/sound/soc.h:368:5: note: expected 'struct snd_soc_platform_driver *' but argument is of type 'struct snd_soc_platform *'
This is due the misnaming of the snd_soc_platform_driver type name and 'ops' field. The issue was introduced in commit f0fba2a("ASoC: multi-component - ASoC Multi-Component Support").
--- sound/soc/sh/dma-sh7760.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/sh/dma-sh7760.c +2 -2
@@ -342,8 +342,8 @@ static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd)return 0 ; } -static struct snd_soc_platform sh7760_soc_platform = { - .pcm_ops = &camelot_pcm_ops, +static struct snd_soc_platform_driver sh7760_soc_platform = { + .ops = &camelot_pcm_ops, .pcm_new = camelot_pcm_new, .pcm_free = camelot_pcm_free, };
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 3/126 ASoC: spear_pcm: Update to new pcm_new() API
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
[ Upstream commit 59d9cc2a5073ab4b8c8f8bdbacf230a538abc55d ]
Commit 552d1ef6 ("ASoC: core - Optimise and refactor pcm_new() to pass only rtd") updated the pcm_new() callback to take the rtd as the only parameter. The spear PCM driver (which was merged much later) still uses the old API. This patch updates the driver to the new API.
--- sound/soc/spear/spear_pcm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/soc/spear/spear_pcm.c +6 -6
@@ -149,9 +149,9 @@ static void spear_pcm_free(struct snd_pcm *pcm)static u64 spear_pcm_dmamask =DMA_BIT_MASK (32 ); -static int spear_pcm_new (struct snd_card *card, -struct snd_soc_dai *dai,struct snd_pcm *pcm) +static int spear_pcm_new (struct snd_soc_pcm_runtime *rtd) { +struct snd_card *card = rtd->card->snd_card;int ret;if (!card->dev->dma_mask)
@@ -159,16 +159,16 @@ static int spear_pcm_new(struct snd_card *card,if (!card->dev->coherent_dma_mask) card->dev->coherent_dma_mask =DMA_BIT_MASK (32 ); -if (dai->driver->playback.channels_min) { - ret =spear_pcm_preallocate_dma_buffer (pcm, +if (rtd->cpu_dai->driver->playback.channels_min) { + ret =spear_pcm_preallocate_dma_buffer (rtd->pcm,SNDRV_PCM_STREAM_PLAYBACK , spear_pcm_hardware.buffer_bytes_max);if (ret)return ret; } -if (dai->driver->capture.channels_min) { - ret =spear_pcm_preallocate_dma_buffer (pcm, +if (rtd->cpu_dai->driver->capture.channels_min) { + ret =spear_pcm_preallocate_dma_buffer (rtd->pcm,SNDRV_PCM_STREAM_CAPTURE , spear_pcm_hardware.buffer_bytes_max);if (ret)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 4/126 regmap: cache Fix regcache-rbtree sync
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Lars-Peter Clausen <[email protected]>
[ Upstream commit 8abac3ba51b5525354e9b2ec0eed1c9e95c905d9 ]
The last register block, which falls into the specified range, is not handled correctly. The formula which calculates the number of register which should be synced is inverse (and off by one). E.g. if all registers in that block should be synced only one is synced, and if only one should be synced all (but one) are synced. To calculate the number of registers that need to be synced we need to subtract the number of the first register in the block from the max register number and add one. This patch updates the code accordingly.
The issue was introduced in commit ac8d91c ("regmap: Supply ranges to the sync operations").
--- drivers/base/regmap/regcache-rbtree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regcache-rbtree.c +1 -1
@@ -398,7 +398,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min, base =0 ;if (max < rbnode->base_reg + rbnode->blklen) - end = rbnode->base_reg + rbnode->blklen - max; + end = max - rbnode->base_reg +1 ;else end = rbnode->blklen;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 5/126 spi/s3c64xx: modified error interrupt handling and init
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Girish K S <[email protected]>
[ Upstream commit 375981f2e14868be16cafbffd34a4f16a6ee01c6 ]
The status of the interrupt is available in the status register, so reading the clear pending register and writing back the same value will not actually clear the pending interrupts. This patch modifies the interrupt handler to read the status register and clear the corresponding pending bit in the clear pending register.
Modified the hwInit function to clear all the pending interrupts.
--- drivers/spi/spi-s3c64xx.c | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-)
drivers/spi/spi-s3c64xx.c +25 -16
@@ -997,25 +997,30 @@ static irqreturn_t s3c64xx_spi_irq(int irq, void *data) {struct s3c64xx_spi_driver_data *sdd = data;struct spi_master *spi = sdd->master; -unsigned int val; +unsigned int val, clr =0 ; - val =readl (sdd->regs +S3C64XX_SPI_PENDING_CLR ); + val =readl (sdd->regs +S3C64XX_SPI_STATUS ); - val &=S3C64XX_SPI_PND_RX_OVERRUN_CLR | -S3C64XX_SPI_PND_RX_UNDERRUN_CLR | -S3C64XX_SPI_PND_TX_OVERRUN_CLR | -S3C64XX_SPI_PND_TX_UNDERRUN_CLR ; - -writel (val, sdd->regs +S3C64XX_SPI_PENDING_CLR ); - -if (val &S3C64XX_SPI_PND_RX_OVERRUN_CLR ) +if (val &S3C64XX_SPI_ST_RX_OVERRUN_ERR ) { + clr =S3C64XX_SPI_PND_RX_OVERRUN_CLR ;dev_err (&spi->dev,"RX overrun\n" ); -if (val &S3C64XX_SPI_PND_RX_UNDERRUN_CLR ) + } +if (val &S3C64XX_SPI_ST_RX_UNDERRUN_ERR ) { + clr |=S3C64XX_SPI_PND_RX_UNDERRUN_CLR ;dev_err (&spi->dev,"RX underrun\n" ); -if (val &S3C64XX_SPI_PND_TX_OVERRUN_CLR ) + } +if (val &S3C64XX_SPI_ST_TX_OVERRUN_ERR ) { + clr |=S3C64XX_SPI_PND_TX_OVERRUN_CLR ;dev_err (&spi->dev,"TX overrun\n" ); -if (val &S3C64XX_SPI_PND_TX_UNDERRUN_CLR ) + } +if (val &S3C64XX_SPI_ST_TX_UNDERRUN_ERR ) { + clr |=S3C64XX_SPI_PND_TX_UNDERRUN_CLR ;dev_err (&spi->dev,"TX underrun\n" ); + } + +/* Clear the pending irq by setting and then clearing it */ +writel (clr, sdd->regs +S3C64XX_SPI_PENDING_CLR ); +writel (0 , sdd->regs +S3C64XX_SPI_PENDING_CLR );return IRQ_HANDLED ; }
@@ -1039,9 +1044,13 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd, int channel)writel (0 , regs +S3C64XX_SPI_MODE_CFG );writel (0 , regs +S3C64XX_SPI_PACKET_CNT ); -/* Clear any irq pending bits */ -writel (readl (regs +S3C64XX_SPI_PENDING_CLR ), - regs +S3C64XX_SPI_PENDING_CLR ); +/* Clear any irq pending bits, should set and clear the bits */ + val =S3C64XX_SPI_PND_RX_OVERRUN_CLR | +S3C64XX_SPI_PND_RX_UNDERRUN_CLR | +S3C64XX_SPI_PND_TX_OVERRUN_CLR | +S3C64XX_SPI_PND_TX_UNDERRUN_CLR ; +writel (val, regs +S3C64XX_SPI_PENDING_CLR ); +writel (0 , regs +S3C64XX_SPI_PENDING_CLR );writel (0 , regs +S3C64XX_SPI_SWAP_CFG );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 6/126 spi/mpc512x-psc: optionally keep PSC SS asserted across xfer segmensts
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Anatolij Gustschin <[email protected]>
[ Upstream commit 1ad849aee5f53353ed88d9cd3d68a51b03a7d44f ]
Some SPI slave devices require asserted chip select signal across multiple transfer segments of an SPI message. Currently the driver always de-asserts the internal SS signal for every single transfer segment of the message and ignores the 'cs_change' flag of the transfer description. Disable the internal chip select (SS) only if this is needed and indicated by the 'cs_change' flag.
Without this change, each partial transfer of a surrounding multi-part SPI transaction might erroneously change the SS signal, which might prevent slaves from answering the request that was sent in a previous transfer segment because the transaction could be considered aborted (SS was de-asserted before reading the response).
--- drivers/spi/spi-mpc512x-psc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-mpc512x-psc.c +1 -1
@@ -164,7 +164,7 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,for (i = count; i >0 ; i--) { data = tx_buf ? *tx_buf++ :0 ; -if (len ==EOFBYTE ) +if (len ==EOFBYTE && t->cs_change)setbits32 (&fifo->txcmd, MPC512x_PSC_FIFO_EOF);out_8 (&fifo->txdata_8, data); len--;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 7/126 UBIFS: make space fixup work in the remount case
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Artem Bityutskiy <[email protected]>
[ Upstream commit 67e753ca41782913d805ff4a8a2b0f60b26b7915 ]
The UBIFS space fixup is a useful feature which allows to fixup the "broken" flash space at the time of the first mount. The "broken" space is usually the result of using a "dumb" industrial flasher which is not able to skip empty NAND pages and just writes all 0xFFs to the empty space, which has grave side-effects for UBIFS when UBIFS trise to write useful data to those empty pages.
The fix-up feature works roughly like this:
1. mkfs.ubifs sets the fixup flag in UBIFS superblock when creating the image (see -F option)
2. when the file-system is mounted for the first time, UBIFS notices the fixup flag and re-writes the entire media atomically, which may take really a lot of time.
3. UBIFS clears the fixup flag in the superblock.
This works fine when the file system is mounted R/W for the very first time. But it did not really work in the case when we first mount the file-system R/O, and then re-mount R/W. The reason was that we started the fixup procedure too late, which we cannot really do because we have to fixup the space before it starts being used.
--- fs/ubifs/super.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
fs/ubifs/super.c +6 -6
@@ -1576,6 +1576,12 @@ static int ubifs_remount_rw(struct ubifs_info *c) c->remounting_rw =1 ; c->ro_mount =0 ; +if (c->space_fixup) { + err =ubifs_fixup_free_space (c); +if (err) +return err; + } + err =check_free_space (c);if (err) goto out;
@@ -1692,12 +1698,6 @@ static int ubifs_remount_rw(struct ubifs_info *c) err =dbg_check_space_info (c); } -if (c->space_fixup) { - err =ubifs_fixup_free_space (c); -if (err) - goto out; - } -mutex_unlock (&c->umount_mutex);return err;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 8/126 ALSA: hda - Enabling Realtek ALC 671 codec
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Rainer Koenig <[email protected]>
[ Upstream commit 1d87caa69c04008e09f5ff47b5e6acb6116febc7 ]
* Added the device ID to the modalias list and assinged ALC662 patches for it
* Added 4 port support for the device ID 0671 in alc662_parse_auto_config
--- sound/pci/hda/patch_realtek.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +3 -1
@@ -6656,7 +6656,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec)const hda_nid_t *ssids;if (codec->vendor_id ==0x10ec0272 || codec->vendor_id ==0x10ec0663 || - codec->vendor_id ==0x10ec0665 || codec->vendor_id ==0x10ec0670 ) + codec->vendor_id ==0x10ec0665 || codec->vendor_id ==0x10ec0670 || + codec->vendor_id ==0x10ec0671 ) ssids = alc663_ssids;else ssids = alc662_ssids;
@@ -7108,6 +7109,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = { { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, { .id = 0x10ec0668, .name = "ALC668", .patch = patch_alc662 }, { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, + { .id = 0x10ec0671, .name = "ALC671", .patch = patch_alc662 }, { .id = 0x10ec0680, .name = "ALC680", .patch = patch_alc680 }, { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 },
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 9/126 ALSA: hda - fix typo in proc output
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: David Henningsson <[email protected]>
[ Upstream commit aeb3a97222832e5457c4b72d72235098ce4bfe8d ]
Rename "Digitial In" to "Digital In". This function is only used for proc output, so should not cause any problems to change.
--- sound/pci/hda/hda_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_codec.c +1 -1
@@ -165,7 +165,7 @@ const char *snd_hda_get_jack_type(u32 cfg)"Line Out" ,"Speaker" ,"HP Out" ,"CD" ,"SPDIF Out" ,"Digital Out" ,"Modem Line" ,"Modem Hand" ,"Line In" ,"Aux" ,"Mic" ,"Telephony" , -"SPDIF In" ,"Digitial In" ,"Reserved" ,"Other" +"SPDIF In" ,"Digital In" ,"Reserved" ,"Other" }; return jack_types[(cfg & AC_DEFCFG_DEVICE)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 10/126 mm: prevent mmap_cache race in find_vma()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jan Stancek <[email protected]>
[ Upstream commit b6a9b7f6b1f21735a7456d534dc0e68e61359d2c ]
find_vma() can be called by multiple threads with read lock held on mm->mmap_sem and any of them can update mm->mmap_cache. Prevent compiler from re-fetching mm->mmap_cache, because other readers could update it in the meantime:
thread 1 thread 2
|
find_vma() | find_vma()
struct vm_area_struct *vma = NULL; |
vma = mm->mmap_cache; |
if (!(vma && vma->vm_end > addr |
&& vma->vm_start <= addr)) { |
| mm->mmap_cache = vma;
return vma; |
^^ compiler may optimize this |
local variable out and re-read |
mm->mmap_cache |This issue can be reproduced with gcc-4.8.0-1 on s390x by running mallocstress testcase from LTP, which triggers:
kernel BUG at mm/rmap.c:1088!
Call Trace:
([<000003d100c57000>] 0x3d100c57000)
[<000000000023a1c0>] do_wp_page+0x2fc/0xa88
[<000000000023baae>] handle_pte_fault+0x41a/0xac8
[<000000000023d832>] handle_mm_fault+0x17a/0x268
[<000000000060507a>] do_protection_exception+0x1e2/0x394
[<0000000000603a04>] pgm_check_handler+0x138/0x13c
[<000003fffcf1f07a>] 0x3fffcf1f07a
Last Breaking-Event-Address:
[<000000000024755e>] page_add_new_anon_rmap+0xc2/0x168Thanks to Jakub Jelinek for his insight on gcc and helping to track this down.
--- mm/mmap.c | 2 +- mm/nommu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
mm/mmap.c +1 -1
@@ -1611,7 +1611,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)/* Check the cache first. */ /* (Cache hit rate is typically around 35%.) */ - vma = mm->mmap_cache; + vma =ACCESS_ONCE (mm->mmap_cache);if (!(vma && vma->vm_end > addr && vma->vm_start <= addr)) {struct rb_node *rb_node;
mm/nommu.c +1 -1
@@ -807,7 +807,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)struct vm_area_struct *vma;/* check the cache first */ - vma = mm->mmap_cache; + vma =ACCESS_ONCE (mm->mmap_cache);if (vma && vma->vm_start <= addr && vma->vm_end > addr)return vma;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 11/126 EISA/PCI: Init EISA early, before PNP
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Yinghai Lu <[email protected]>
[ Upstream commit c5fb301ae83bec6892e54984e6ec765c47df8e10 ]
Matthew reported kernels fail the pci_eisa probe and are later successful with the virtual_eisa_root_init force probe without slot0.
The reason for that is: PNP probing is before pci_eisa_init gets called as pci_eisa_init is called via pci_driver.
pnp 00:0f has 0xc80 - 0xc84 reserved.
[ 9.700409] pnp 00:0f: [io 0x0c80-0x0c84]
so eisa_probe will fail from pci_eisa_init
==>eisa_root_register ==>eisa_probe path.
as force_probe is not set in pci_eisa_root, it will bail early when slot0 is not probed and initialized.
Try to use subsys_initcall_sync instead, and will keep following sequence:
pci_subsys_init
pci_eisa_init_early
pnpacpi_init/isapnp_init
After this patch EISA can be initialized properly, and PNP overlapping resource will not be reserved.
[ 10.104434] system 00:0f: [io 0x0c80-0x0c84] could not be reserved
--- drivers/eisa/pci_eisa.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-)
drivers/eisa/pci_eisa.c +21 -18
@@ -19,8 +19,7 @@/* There is only *one* pci_eisa device per machine, right ? */ static struct eisa_root_device pci_eisa_root; -static int __init pci_eisa_init (struct pci_dev *pdev, -const struct pci_device_id *ent) +static int __init pci_eisa_init (struct pci_dev *pdev) {int rc;
@@ -45,22 +44,26 @@ static int __init pci_eisa_init(struct pci_dev *pdev,return 0 ; } -static struct pci_device_id pci_eisa_pci_tbl[] = { - {PCI_ANY_ID ,PCI_ANY_ID ,PCI_ANY_ID ,PCI_ANY_ID , -PCI_CLASS_BRIDGE_EISA <<8 ,0xffff00 ,0 }, - {0 , } -}; +/* +* We have to call pci_eisa_init_early() before pnpacpi_init()/isapnp_init(). +* Otherwise pnp resource will get enabled early and could prevent eisa +* to be initialized. +* Also need to make sure pci_eisa_init_early() is called after +* x86/pci_subsys_init(). +* So need to use subsys_initcall_sync with it. +*/ +static int __init pci_eisa_init_early (void ) +{ +struct pci_dev *dev =NULL ; +int ret; -static struct pci_driver __refdata pci_eisa_driver = { - .name ="pci_eisa" , - .id_table = pci_eisa_pci_tbl, - .probe = pci_eisa_init, -}; +for_each_pci_dev (dev) +if ((dev->class >>8 ) ==PCI_CLASS_BRIDGE_EISA ) { + ret =pci_eisa_init (dev); +if (ret) +return ret; + } -static int __init pci_eisa_init_module (void ) -{ -return pci_register_driver (&pci_eisa_driver); +return 0 ; } - -device_initcall (pci_eisa_init_module); -MODULE_DEVICE_TABLE (pci, pci_eisa_pci_tbl); +subsys_initcall_sync (pci_eisa_init_early);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 12/126 EISA/PCI: Fix bus res reference
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Yinghai Lu <[email protected]>
[ Upstream commit 2cfda637e29ce9e3df31b59f64516b2e571cc985 ]
Matthew found that 3.8.3 is having problems with an old (ancient) PCI-to-EISA bridge, the Intel 82375. It worked with the 3.2 kernel. He identified the 82375, but doesn't assign the struct resource *res pointer inside the struct eisa_root_device, and panics.
pci_eisa_init() was using bus->resource[] directly instead of pci_bus_resource_n(). The bus->resource[] array is a PCI-internal implementation detail, and after commit 45ca9e97 (PCI: add helpers for building PCI bus resource lists) and commit 0efd5aab (PCI: add struct pci_host_bridge_window with CPU/bus address offset), bus->resource[] is not used for PCI root buses any more.
The 82375 is a subtractive-decode PCI device, so handle it the same way we handle PCI-PCI bridges in subtractive-decode mode in pci_read_bridge_bases().
--- drivers/eisa/pci_eisa.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-)
drivers/eisa/pci_eisa.c +25 -3
@@ -21,7 +21,8 @@ static struct eisa_root_device pci_eisa_root;static int __init pci_eisa_init (struct pci_dev *pdev) { -int rc; +int rc, i; +struct resource *res, *bus_res =NULL ;if ((rc =pci_enable_device (pdev))) { printk (KERN_ERR "pci_eisa : Could not enable device %s\n",
@@ -29,9 +30,30 @@ static int __init pci_eisa_init(struct pci_dev *pdev)return rc; } +/* +* The Intel 82375 PCI-EISA bridge is a subtractive-decode PCI +* device, so the resources available on EISA are the same as those +* available on the 82375 bus. This works the same as a PCI-PCI +* bridge in subtractive-decode mode (see pci_read_bridge_bases()). +* We assume other PCI-EISA bridges are similar. +* +* eisa_root_register() can only deal with a single io port resource, +* so we use the first valid io port resource. +*/ +pci_bus_for_each_resource (pdev->bus, res, i) +if (res && (res->flags &IORESOURCE_IO )) { + bus_res = res; +break ; + } + +if (!bus_res) { +dev_err (&pdev->dev,"No resources available\n" ); +return -1 ; + } + pci_eisa_root.dev = &pdev->dev; - pci_eisa_root.res = pdev->bus->resource[0 ]; - pci_eisa_root.bus_base_addr = pdev->bus->resource[0 ]->start; + pci_eisa_root.res = bus_res; + pci_eisa_root.bus_base_addr = bus_res->start; pci_eisa_root.slots =EISA_MAX_SLOTS ; pci_eisa_root.dma_mask = pdev->dma_mask;dev_set_drvdata (pci_eisa_root.dev, &pci_eisa_root);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 13/126 libata: Use integer return value for atapi_command_packet_set
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Shan Hai <[email protected]>
[ Upstream commit d8668fcb0b257d9fdcfbe5c172a99b8d85e1cd82 ]
The function returns type of ATAPI drives so it should return integer value. The commit 4dce8ba94c7 (libata: Use 'bool' return value for ata_id_XXX) since v2.6.39 changed the type of return value from int to bool, the change would cause all of the ATAPI class drives to be treated as TYPE_TAPE and the max_sectors of the drives to be set to 65535 because of the commit f8d8e5799b7(libata: increase 128 KB / cmd limit for ATAPI tape drives), for the function would return true for all ATAPI class drives and the TYPE_TAPE is defined as 0x01.
--- include/linux/ata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/ata.h +1 -1
@@ -938,7 +938,7 @@ static inline int atapi_cdb_len(const u16 *dev_id) } } -static inline bool atapi_command_packet_set (const u16 *dev_id) +static inline int atapi_command_packet_set (const u16 *dev_id) {return (dev_id[ATA_ID_CONFIG ] >>8 ) &0x1f ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 14/126 libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Shan Hai <[email protected]>
[ Upstream commit a32450e127fc6e5ca6d958ceb3cfea4d30a00846 ]
The Slimtype DVD A DS8A8SH drive locks up when max sector is smaller than 65535, and the blow backtrace is observed on locking up:
INFO: task flush-8:32:1130 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
flush-8:32 D ffffffff8180cf60 0 1130 2 0x00000000
ffff880273aef618 0000000000000046 0000000000000005 ffff880273aee000 ffff880273aee000 ffff880273aeffd8 ffff880273aee010 ffff880273aee000 ffff880273aeffd8 ffff880273aee000 ffff88026e842ea0 ffff880274a10000
Call Trace: [<ffffffff8168fc2d>] schedule+0x5d/0x70 [<ffffffff8168fccc>] io_schedule+0x8c/0xd0 [<ffffffff81324461>] get_request+0x731/0x7d0 [<ffffffff8133dc60>] ? cfq_allow_merge+0x50/0x90 [<ffffffff81083aa0>] ? wake_up_bit+0x40/0x40 [<ffffffff81320443>] ? bio_attempt_back_merge+0x33/0x110 [<ffffffff813248ea>] blk_queue_bio+0x23a/0x3f0 [<ffffffff81322176>] generic_make_request+0xc6/0x120 [<ffffffff81322308>] submit_bio+0x138/0x160 [<ffffffff811d7596>] ? bio_alloc_bioset+0x96/0x120 [<ffffffff811d1f61>] submit_bh+0x1f1/0x220 [<ffffffff811d48b8>] __block_write_full_page+0x228/0x340 [<ffffffff811d3650>] ? attach_nobh_buffers+0xc0/0xc0 [<ffffffff811d8960>] ? I_BDEV+0x10/0x10 [<ffffffff811d8960>] ? I_BDEV+0x10/0x10 [<ffffffff811d4ab6>] block_write_full_page_endio+0xe6/0x100 [<ffffffff811d4ae5>] block_write_full_page+0x15/0x20 [<ffffffff811d9268>] blkdev_writepage+0x18/0x20 [<ffffffff81142527>] __writepage+0x17/0x40 [<ffffffff811438ba>] write_cache_pages+0x34a/0x4a0 [<ffffffff81142510>] ? set_page_dirty+0x70/0x70 [<ffffffff81143a61>] generic_writepages+0x51/0x80 [<ffffffff81143ab0>] do_writepages+0x20/0x50 [<ffffffff811c9ed6>] __writeback_single_inode+0xa6/0x2b0 [<ffffffff811ca861>] writeback_sb_inodes+0x311/0x4d0 [<ffffffff811caaa6>] __writeback_inodes_wb+0x86/0xd0 [<ffffffff811cad43>] wb_writeback+0x1a3/0x330 [<ffffffff816916cf>] ? _raw_spin_lock_irqsave+0x3f/0x50 [<ffffffff811b8362>] ? get_nr_inodes+0x52/0x70 [<ffffffff811cb0ac>] wb_do_writeback+0x1dc/0x260 [<ffffffff8168dd34>] ? schedule_timeout+0x204/0x240 [<ffffffff811cb232>] bdi_writeback_thread+0x102/0x2b0 [<ffffffff811cb130>] ? wb_do_writeback+0x260/0x260 [<ffffffff81083550>] kthread+0xc0/0xd0 [<ffffffff81083490>] ? kthread_worker_fn+0x1b0/0x1b0 [<ffffffff8169a3ec>] ret_from_fork+0x7c/0xb0 [<ffffffff81083490>] ? kthread_worker_fn+0x1b0/0x1b0
The above trace was triggered by
"dd if=/dev/zero of=/dev/sr0 bs=2048 count=32768"
It was previously working by accident, since another bug introduced by 4dce8ba94c7 (libata: Use 'bool' return value for ata_id_XXX) caused all drives to use maxsect=65535.
--- drivers/ata/libata-core.c | 4 ++++ include/linux/libata.h | 1 + 2 files changed, 5 insertions(+)
drivers/ata/libata-core.c +4 -0
@@ -2413,6 +2413,9 @@ int ata_dev_configure(struct ata_device *dev) dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, dev->max_sectors); +if (dev->horkage &ATA_HORKAGE_MAX_SEC_LBA48 ) + dev->max_sectors =ATA_MAX_SECTORS_LBA48 ; +if (ap->ops->dev_config) ap->ops->dev_config (dev);
@@ -4069,6 +4072,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {/* Weird ATAPI devices */ { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA }, + { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, /* Devices we expect to fail diagnostics */
include/linux/libata.h +1 -0
@@ -395,6 +395,7 @@ enum {ATA_HORKAGE_NOSETXFER = (1 <<14 ),/* skip SETXFER, SATA only */ ATA_HORKAGE_BROKEN_FPDMA_AA = (1 <<15 ),/* skip AA */ ATA_HORKAGE_DUMP_ID = (1 <<16 ),/* dump IDENTIFY data */ + ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 *//* DMA mask for user DMA control: User visible values; DO NOT renumber */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 15/126 alpha: Add irongate_io to PCI bus resources
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jay Estabrook <[email protected]>
[ Upstream commit aa8b4be3ac049c8b1df2a87e4d1d902ccfc1f7a9 ]
Fixes a NULL pointer dereference at boot on UP1500.
--- arch/alpha/kernel/sys_nautilus.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/alpha/kernel/sys_nautilus.c +5 -0
@@ -188,6 +188,10 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr)extern void free_reserved_mem (void *,void *);extern void pcibios_claim_one_bus (struct pci_bus *); +static struct resource irongate_io = { + .name ="Irongate PCI IO" , + .flags =IORESOURCE_IO , +};static struct resource irongate_mem = { .name ="Irongate PCI MEM" , .flags =IORESOURCE_MEM ,
@@ -209,6 +213,7 @@ nautilus_init_pci(void) irongate =pci_get_bus_and_slot (0 ,0 ); bus->self = irongate; + bus->resource[0 ] = &irongate_io; bus->resource[1 ] = &irongate_mem;pci_bus_size_bridges (bus);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 16/126 PCI/PM: Disable runtime PM of PCIe ports
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit de7d5f729c72638f41d7c17487bccb1c570ff144 ]
The runtime PM of PCIe ports turns out to be quite fragile, as in some cases things work while in some other cases they don't and we don't seem to have a good way to determine whether or not they are going to work in advance.
For this reason, avoid enabling runtime PM for PCIe ports by keeping their runtime PM reference counters always above 0 for the time being.
When a PCIe port is suspended, it can no longer report events like hotplug, so hotplug below the port may not work, as in the bug report below.
[bhelgaas: changelog, stable]
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=53811
--- drivers/pci/pcie/portdrv_pci.c | 13 ------------- 1 file changed, 13 deletions(-)
drivers/pci/pcie/portdrv_pci.c +0 -13
@@ -174,14 +174,6 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = {#endif /* !PM */ /* -* PCIe port runtime suspend is broken for some chipsets, so use a -* black list to disable runtime PM for these chipsets. -*/ -static const struct pci_device_id port_runtime_pm_black_list[] = { - {/* end: all zeroes */ } -}; - -/* * pcie_portdrv_probe - Probe PCI-Express port devices * @dev: PCI-Express port device being probed *
@@ -214,16 +206,11 @@ static int __devinit pcie_portdrv_probe(struct pci_dev *dev,* it by default. */ dev->d3cold_allowed = false; -if (!pci_match_id (port_runtime_pm_black_list, dev)) -pm_runtime_put_noidle (&dev->dev); -return 0 ; }static void pcie_portdrv_remove (struct pci_dev *dev) { -if (!pci_match_id (port_runtime_pm_black_list, dev)) -pm_runtime_get_noresume (&dev->dev);pcie_port_device_remove (dev);pci_disable_device (dev); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 17/126 ata_piix: Fix DVD not dectected at some Haswell platforms
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Youquan Song <[email protected]>
[ Upstream commit b55f84e2d527182e7c611d466cd0bb6ddce201de ]
There is a quirk patch 5e5a4f5d5a08c9c504fe956391ac3dae2c66556d "ata_piix: make DVD Drive recognisable on systems with Intel Sandybridge
chipsets(v2)" fixing the 4 ports IDE controller 32bit PIO mode.
We've hit a problem with DVD not recognized on Haswell Desktop platform which includes Lynx Point 2-port SATA controller.
This quirk patch disables 32bit PIO on this controller in IDE mode.
v2: Change spelling error in statememnt pointed by Sergei Shtylyov.
v3: Change comment statememnt and spliting line over 80 characters pointed by
Libor Pechacek and also rebase the patch against 3.8-rc7 kernel.
--- drivers/ata/ata_piix.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/ata/ata_piix.c +11 -0
@@ -150,6 +150,7 @@ enum piix_controller_ids { tolapai_sata, piix_pata_vmw,/* PIIX4 for VMware, spurious DMA_ERR */ ich8_sata_snb, + ich8_2port_sata_snb, }; struct piix_map_db {
@@ -502,6 +503,7 @@ static const struct piix_map_db *piix_map_db_table[] = { [ich8m_apple_sata] = &ich8m_apple_map_db, [tolapai_sata] = &tolapai_map_db, [ich8_sata_snb] = &ich8_map_db, + [ich8_2port_sata_snb] = &ich8_2port_map_db, };static struct ata_port_info piix_port_info[] = {
@@ -643,6 +645,15 @@ static struct ata_port_info piix_port_info[] = { .port_ops = &piix_sata_ops, }, + [ich8_2port_sata_snb] = + { + .flags =PIIX_SATA_FLAGS |PIIX_FLAG_SIDPR + | PIIX_FLAG_PIO16, + .pio_mask = ATA_PIO4, + .mwdma_mask = ATA_MWDMA2, + .udma_mask = ATA_UDMA6, + .port_ops = &piix_sata_ops, + }, };static struct pci_bits piix_enable_bits[] = {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 18/126 ftrace: Consistently restore trace function on sysctl enabling
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jan Kiszka <[email protected]>
[ Upstream commit 5000c418840b309251c5887f0b56503aae30f84c ]
If we reenable ftrace via syctl, we currently set ftrace_trace_function based on the previous simplistic algorithm. This is inconsistent with what update_ftrace_function does. So better call that helper instead.
--- kernel/trace/ftrace.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
kernel/trace/ftrace.c +2 -6
@@ -4353,12 +4353,8 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,ftrace_startup_sysctl ();/* we are starting ftrace again */ -if (ftrace_ops_list != &ftrace_list_end) { -if (ftrace_ops_list->next == &ftrace_list_end) - ftrace_trace_function = ftrace_ops_list->func; -else - ftrace_trace_function = ftrace_ops_list_func; - } +if (ftrace_ops_list != &ftrace_list_end) +update_ftrace_function (); }else {/* stopping ftrace calls (just send to ftrace_stub) */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 19/126 powerpc: pSeries_lpar_hpte_remove fails from Adjunct partition being performed before the ANDCOND test
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Michael Wolf <[email protected]>
[ Upstream commit 9fb2640159f9d4f5a2a9d60e490482d4cbecafdb ]
Some versions of pHyp will perform the adjunct partition test before the ANDCOND test. The result of this is that H_RESOURCE can be returned and cause the BUG_ON condition to occur. The HPTE is not removed. So add a check for H_RESOURCE, it is ok if this HPTE is not removed as pSeries_lpar_hpte_remove is looking for an HPTE to remove and not a specific HPTE to remove. So it is ok to just move on to the next slot and try again.
--- arch/powerpc/platforms/pseries/lpar.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/powerpc/platforms/pseries/lpar.c +7 -1
@@ -187,7 +187,13 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) (0x1UL << 4), &dummy1, &dummy2);if (lpar_rc ==H_SUCCESS )return i; -BUG_ON (lpar_rc !=H_NOT_FOUND ); + +/* +* The test for adjunct partition is performed before the +* ANDCOND test. H_RESOURCE may be returned, so we need to +* check for that as well. +*/ +BUG_ON (lpar_rc !=H_NOT_FOUND && lpar_rc !=H_RESOURCE ); slot_offset++; slot_offset &=0x7 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 20/126 mwifiex: limit channel number not to overflow memory
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Stone Piao <[email protected]>
[ Upstream commit 901ceba4e81e9dd6b4a3c4c37ee22000a6c5c65f ]
Limit the channel number in scan request, or the driver scan config structure memory will be overflowed.
--- drivers/net/wireless/mwifiex/cfg80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mwifiex/cfg80211.c +2 -1
@@ -1487,7 +1487,8 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, } } -for (i =0 ; i < request->n_channels; i++) { +for (i =0 ; i <min_t (u32, request->n_channels, +MWIFIEX_USER_SCAN_CHAN_MAX ); i++) { chan = request->channels[i]; priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value; priv->user_scan_cfg->chan_list[i].radio_type = chan->band;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 21/126 mac80211: fix remain-on-channel cancel crash
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 3fbd45ca8d1c98f3c2582ef8bc70ade42f70947b ]
If a ROC item is canceled just as it expires, the work struct may be scheduled while it is running (and waiting for the mutex). This results in it being run after being freed, which obviously crashes.
To fix this don't free it when aborting is requested but instead mark it as "to be freed", which makes the work a no-op and allows freeing it outside.
--- net/mac80211/cfg.c | 6 ++++-- net/mac80211/ieee80211_i.h | 3 ++- net/mac80211/offchannel.c | 23 +++++++++++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-)
net/mac80211/cfg.c +4 -2
@@ -2337,7 +2337,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,list_del (&dep->list);mutex_unlock (&local->mtx); -ieee80211_roc_notify_destroy (dep); +ieee80211_roc_notify_destroy (dep, true);return 0 ; }
@@ -2377,7 +2377,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,ieee80211_start_next_roc (local);mutex_unlock (&local->mtx); -ieee80211_roc_notify_destroy (found); +ieee80211_roc_notify_destroy (found, true); }else {/* work may be pending so use it all the time */ found->abort = true;
@@ -2387,6 +2387,8 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,/* work will clean up etc */ flush_delayed_work (&found->work); +WARN_ON (!found->to_be_freed); +kfree (found); }return 0 ;
net/mac80211/ieee80211_i.h +2 -1
@@ -339,6 +339,7 @@ struct ieee80211_roc_work {enum nl80211_channel_type chan_type;bool started, abort, hw_begun, notified; +bool to_be_freed;unsigned long hw_start_time;
@@ -1274,7 +1275,7 @@ void ieee80211_offchannel_return(struct ieee80211_local *local,void ieee80211_roc_setup (struct ieee80211_local *local);void ieee80211_start_next_roc (struct ieee80211_local *local);void ieee80211_roc_purge (struct ieee80211_sub_if_data *sdata); -void ieee80211_roc_notify_destroy (struct ieee80211_roc_work *roc); +void ieee80211_roc_notify_destroy (struct ieee80211_roc_work *roc,bool free);void ieee80211_sw_roc_work (struct work_struct *work);void ieee80211_handle_roc_started (struct ieee80211_roc_work *roc);
net/mac80211/offchannel.c +17 -6
@@ -293,10 +293,13 @@ void ieee80211_start_next_roc(struct ieee80211_local *local) } } -void ieee80211_roc_notify_destroy (struct ieee80211_roc_work *roc) +void ieee80211_roc_notify_destroy (struct ieee80211_roc_work *roc,bool free) {struct ieee80211_roc_work *dep, *tmp; +if (WARN_ON (roc->to_be_freed)) +return ; +/* was never transmitted */ if (roc->frame) { cfg80211_mgmt_tx_status(&roc->sdata->wdev,
@@ -313,9 +316,12 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc) GFP_KERNEL);list_for_each_entry_safe (dep, tmp, &roc->dependents, list) -ieee80211_roc_notify_destroy (dep); +ieee80211_roc_notify_destroy (dep, true); -kfree (roc); +if (free) +kfree (roc); +else + roc->to_be_freed = true; }void ieee80211_sw_roc_work (struct work_struct *work)
@@ -328,6 +334,9 @@ void ieee80211_sw_roc_work(struct work_struct *work)mutex_lock (&local->mtx); +if (roc->to_be_freed) + goto out_unlock; +if (roc->abort) goto finish;
@@ -368,7 +377,7 @@ void ieee80211_sw_roc_work(struct work_struct *work) finish:list_del (&roc->list); started = roc->started; -ieee80211_roc_notify_destroy (roc); +ieee80211_roc_notify_destroy (roc, !roc->abort);if (started) {drv_flush (local, false);
@@ -408,7 +417,7 @@ static void ieee80211_hw_roc_done(struct work_struct *work)list_del (&roc->list); -ieee80211_roc_notify_destroy (roc); +ieee80211_roc_notify_destroy (roc, true);/* if there's another roc, start it now */ ieee80211_start_next_roc (local);
@@ -458,12 +467,14 @@ void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata)list_for_each_entry_safe (roc, tmp, &tmp_list, list) {if (local->ops->remain_on_channel) {list_del (&roc->list); -ieee80211_roc_notify_destroy (roc); +ieee80211_roc_notify_destroy (roc, true); }else {ieee80211_queue_delayed_work (&local->hw, &roc->work,0 );/* work will clean up etc */ flush_delayed_work (&roc->work); +WARN_ON (!roc->to_be_freed); +kfree (roc); } }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 22/126 x86: remove the x32 syscall bitmask from syscall_get_nr()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Paul Moore <[email protected]>
[ Upstream commit 8b4b9f27e57584f3d90e0bb84cf800ad81cfe3a1 ]
Commit fca460f95e928bae373daa8295877b6905bc62b8 simplified the x32 implementation by creating a syscall bitmask, equal to 0x40000000, that could be applied to x32 syscalls such that the masked syscall number would be the same as a x86_64 syscall. While that patch was a nice way to simplify the code, it went a bit too far by adding the mask to syscall_get_nr(); returning the masked syscall numbers can cause confusion with callers that expect syscall numbers matching the x32 ABI, e.g. unmasked syscall numbers.
This patch fixes this by simply removing the mask from syscall_get_nr() while preserving the other changes from the original commit. While there are several syscall_get_nr() callers in the kernel, most simply check that the syscall number is greater than zero, in this case this patch will have no effect. Of those remaining callers, they appear to be few, seccomp and ftrace, and from my testing of seccomp without this patch the original commit definitely breaks things; the seccomp filter does not correctly filter the syscalls due to the difference in syscall numbers in the BPF filter and the value from syscall_get_nr(). Applying this patch restores the seccomp BPF filter functionality on x32.
I've tested this patch with the seccomp BPF filters as well as ftrace and everything looks reasonable to me; needless to say general usage seemed fine as well.
--- arch/x86/include/asm/syscall.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/syscall.h +2 -2
@@ -29,13 +29,13 @@ extern const unsigned long sys_call_table[];*/ static inline int syscall_get_nr (struct task_struct *task,struct pt_regs *regs) { -return regs->orig_ax & __SYSCALL_MASK; +return regs->orig_ax; }static inline void syscall_rollback (struct task_struct *task,struct pt_regs *regs) { - regs->ax = regs->orig_ax & __SYSCALL_MASK; + regs->ax = regs->orig_ax; } static inline long syscall_get_error(struct task_struct *task,
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 23/126 hwspinlock: fix __hwspin_lock_request error path
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Li Fei <[email protected]>
[ Upstream commit c10b90d85a5126d25c89cbaa50dc9fdd1c4d001a ]
Even in failed case of pm_runtime_get_sync, the usage_count is incremented. In order to keep the usage_count with correct value and runtime power management to behave correctly, call pm_runtime_put_noidle in such case.
In __hwspin_lock_request, module_put is also called before return in pm_runtime_get_sync failed case.
Cc: [email protected]
Signed-off-by Liu Chuansheng <[email protected]>
--- drivers/hwspinlock/hwspinlock_core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hwspinlock/hwspinlock_core.c +2 -0
@@ -416,6 +416,8 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock) ret =pm_runtime_get_sync (dev);if (ret <0 ) {dev_err (dev,"%s: can't power on device\n" , __func__); +pm_runtime_put_noidle (dev); +module_put (dev->driver->owner);return ret; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 24/126 remoteproc: fix error path of handle_vdev
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Sjur=20Br=C3=A6ndeland?= <[email protected]>
[ Upstream commit cde42e076c1cdd69a1f955d66ff6596bad3d2105 ]
Remove the vdev entry from the list before freeing it, otherwise rproc->vdevs will explode.
--- drivers/remoteproc/remoteproc_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/remoteproc/remoteproc_core.c +3 -1
@@ -342,10 +342,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,/* it is now safe to add the virtio device */ ret =rproc_add_virtio_dev (rvdev, rsc->id);if (ret) - goto free_rvdev; + goto remove_rvdev;return 0 ; +remove_rvdev: +list_del (&rvdev->node); free_rvdev:kfree (rvdev);return ret;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 25/126 remoteproc: fix FW_CONFIG typo
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Robert Tivy <[email protected]>
[ Upstream commit c7426bce5933d16b492a34e42ae77e26fceddff6 ]
Fix obvious typo introduced in commit e121aefa7d9f10eee5cf26ed47129237a05d940b ("remoteproc: fix missing CONFIG_FW_LOADER configurations").
--- drivers/remoteproc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/Kconfig +1 -1
@@ -4,7 +4,7 @@ menu "Remoteproc drivers (EXPERIMENTAL)" config REMOTEPROC tristate depends on EXPERIMENTAL - select FW_CONFIG + select FW_LOADER select VIRTIO config OMAP_REMOTEPROC
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 26/126 spinlocks and preemption points need to be at least compiler barriers
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 386afc91144b36b42117b0092893f15bc8798a80 ]
In UP and non-preempt respectively, the spinlocks and preemption disable/enable points are stubbed out entirely, because there is no regular code that can ever hit the kind of concurrency they are meant to protect against.
However, while there is no regular code that can cause scheduling, we _do_ end up having some exceptional (literally!) code that can do so, and that we need to make sure does not ever get moved into the critical region by the compiler.
In particular, get_user() and put_user() is generally implemented as inline asm statements (even if the inline asm may then make a call instruction to call out-of-line), and can obviously cause a page fault and IO as a result. If that inline asm has been scheduled into the middle of a preemption-safe (or spinlock-protected) code region, we obviously lose.
Now, admittedly this is *very* unlikely to actually ever happen, and we've not seen examples of actual bugs related to this. But partly exactly because it's so hard to trigger and the resulting bug is so subtle, we should be extra careful to get this right.
So make sure that even when preemption is disabled, and we don't have to generate any actual *code* to explicitly tell the system that we are in a preemption-disabled region, we need to at least tell the compiler not to move things around the critical region.
This patch grew out of the same discussion that caused commits 79e5f05edcbf ("ARC: Add implicit compiler barrier to raw_local_irq* functions") and 3e2e0d2c222b ("tile: comment assumption about __insn_mtspr for <asm/irqflags.h>") to come about.
Note for stable: use discretion when/if applying this. As mentioned, this bug may never have actually bitten anybody, and gcc may never have done the required code motion for it to possibly ever trigger in practice.
--- include/linux/preempt.h | 22 ++++++++++++++-------- include/linux/spinlock_up.h | 29 ++++++++++++++++++----------- 2 files changed, 32 insertions(+), 19 deletions(-)
include/linux/preempt.h +14 -8
@@ -93,14 +93,20 @@ do { \#else /* !CONFIG_PREEMPT_COUNT */ -#define preempt_disable () do { } while (0) -#define sched_preempt_enable_no_resched () do { } while (0) -#define preempt_enable_no_resched () do { } while (0) -#define preempt_enable () do { } while (0) - -#define preempt_disable_notrace () do { } while (0) -#define preempt_enable_no_resched_notrace () do { } while (0) -#define preempt_enable_notrace () do { } while (0) +/* +* Even if we don't have any preemption, we need preempt disable/enable +* to be barriers, so that we don't have things like get_user/put_user +* that can cause faults and scheduling migrate into our preempt-protected +* region. +*/ +#define preempt_disable () barrier() +#define sched_preempt_enable_no_resched () barrier() +#define preempt_enable_no_resched () barrier() +#define preempt_enable () barrier() + +#define preempt_disable_notrace () barrier() +#define preempt_enable_no_resched_notrace () barrier() +#define preempt_enable_notrace () barrier()#endif /* CONFIG_PREEMPT_COUNT */
include/linux/spinlock_up.h +18 -11
@@ -16,7 +16,10 @@* In the debug case, 1 means unlocked, 0 means locked. (the values * are inverted, to catch initialization bugs) * -* No atomicity anywhere, we are on UP. +* No atomicity anywhere, we are on UP. However, we still need +* the compiler barriers, because we do not want the compiler to +* move potentially faulting instructions (notably user accesses) +* into the locked sequence, resulting in non-atomic execution. */ #ifdef CONFIG_DEBUG_SPINLOCK
@@ -25,6 +28,7 @@static inline void arch_spin_lock (arch_spinlock_t *lock) { lock->slock =0 ; +barrier (); } static inline void
@@ -32,6 +36,7 @@ arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags) {local_irq_save (flags); lock->slock =0 ; +barrier (); }static inline int arch_spin_trylock (arch_spinlock_t *lock)
@@ -39,32 +44,34 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)char oldval = lock->slock; lock->slock =0 ; +barrier (); return oldval > 0; }static inline void arch_spin_unlock (arch_spinlock_t *lock) { +barrier (); lock->slock =1 ; }/* * Read-write spinlocks. No debug version. */ -#define arch_read_lock (lock) do { (void)(lock); } while (0) -#define arch_write_lock (lock) do { (void)(lock); } while (0) -#define arch_read_trylock (lock) ({ (void)(lock); 1; }) -#define arch_write_trylock (lock) ({ (void)(lock); 1; }) -#define arch_read_unlock (lock) do { (void)(lock); } while (0) -#define arch_write_unlock (lock) do { (void)(lock); } while (0) +#define arch_read_lock (lock) do { barrier(); (void)(lock); } while (0) +#define arch_write_lock (lock) do { barrier(); (void)(lock); } while (0) +#define arch_read_trylock (lock) ({ barrier(); (void)(lock); 1; }) +#define arch_write_trylock (lock) ({ barrier(); (void)(lock); 1; }) +#define arch_read_unlock (lock) do { barrier(); (void)(lock); } while (0) +#define arch_write_unlock (lock) do { barrier(); (void)(lock); } while (0)#else /* DEBUG_SPINLOCK */ #define arch_spin_is_locked (lock) ((void)(lock), 0)/* for sched.c and kernel_lock.c: */ -# define arch_spin_lock (lock) do { (void)(lock); } while (0) -# define arch_spin_lock_flags (lock, flags) do { (void)(lock); } while (0) -# define arch_spin_unlock (lock) do { (void)(lock); } while (0) -# define arch_spin_trylock (lock) ({ (void)(lock); 1; }) +# define arch_spin_lock (lock) do { barrier(); (void)(lock); } while (0) +# define arch_spin_lock_flags (lock, flags) do { barrier(); (void)(lock); } while (0) +# define arch_spin_unlock (lock) do { barrier(); (void)(lock); } while (0) +# define arch_spin_trylock (lock) ({ barrier(); (void)(lock); 1; })#endif /* DEBUG_SPINLOCK */ #define arch_spin_is_contended (lock) (((void)(lock), 0))
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 27/126 crypto: ux500 - add missing comma
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit d47cbd5bcee7c7a08fc0283dda465375fa1b1fda ]
Commit 4f31f5b19eb0418a847b989abc9ac22af1991fe2
"PM / crypto / ux500: Use struct dev_pm_ops for power management" add a new line to the driver struct but missed to add a trailing comma, causing build errors when crypto is selected. This adds the missing comma.
This was not noticed until now because the crypto block is not in the ux500 defconfig. A separate patch will be submitted to fix this.
--- drivers/crypto/ux500/cryp/cryp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/ux500/cryp/cryp_core.c +1 -1
@@ -1750,7 +1750,7 @@ static struct platform_driver cryp_driver = { .shutdown = ux500_cryp_shutdown, .driver = { .owner = THIS_MODULE, - .name = "cryp1" + .name = "cryp1", .pm = &ux500_cryp_pm, } };
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 28/126 crypto: gcm - fix assumption that assoc has one segment
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jussi Kivilinna <[email protected]>
[ Upstream commit d3dde52209ab571e4e2ec26c66f85ad1355f7475 ]
rfc4543(gcm(*)) code for GMAC assumes that assoc scatterlist always contains only one segment and only makes use of this first segment. However ipsec passes assoc with three segments when using 'extended sequence number' thus in this case rfc4543(gcm(*)) fails to function correctly. Patch fixes this issue.
--- crypto/gcm.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
crypto/gcm.c +14 -3
@@ -44,6 +44,7 @@ struct crypto_rfc4543_ctx {struct crypto_rfc4543_req_ctx {u8 auth_tag[16 ]; +u8 assocbuf[32 ];struct scatterlist cipher[1 ];struct scatterlist payload[2 ];struct scatterlist assoc[2 ];
@@ -1142,9 +1143,19 @@ static struct aead_request *crypto_rfc4543_crypt(struct aead_request *req,scatterwalk_crypto_chain (payload, dst, vdst == req->iv +8 ,2 ); assoclen +=8 + req->cryptlen - (enc ?0 : authsize); -sg_init_table (assoc,2 ); -sg_set_page (assoc,sg_page (req->assoc), req->assoc->length, - req->assoc->offset); +if (req->assoc->length == req->assoclen) { +sg_init_table (assoc,2 ); +sg_set_page (assoc,sg_page (req->assoc), req->assoc->length, + req->assoc->offset); + }else { +BUG_ON (req->assoclen >sizeof (rctx->assocbuf)); + +scatterwalk_map_and_copy (rctx->assocbuf, req->assoc,0 , + req->assoclen,0 ); + +sg_init_table (assoc,2 ); +sg_set_buf (assoc, rctx->assocbuf, req->assoclen); + }scatterwalk_crypto_chain (assoc, payload,0 ,2 );aead_request_set_tfm (subreq, ctx->child);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 29/126 drm/mgag200: Index 24 in extended CRTC registers is 24 in hex, not decimal.
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Christopher Harvey <[email protected]>
[ Upstream commit 1812a3db0874be1d1524086da9e84397b800f546 ]
This change properly enables the "requester" in G200ER cards that is responsible for getting pixels out of memory and clocking them out to the screen.
--- drivers/gpu/drm/mgag200/mgag200_mode.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +3 -10
@@ -752,8 +752,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,int i;unsigned char misc =0 ;unsigned char ext_vga[6 ]; -unsigned char ext_vga_index24; -unsigned char dac_index90 =0 ;u8 bppshift;static unsigned char dacvalue[] = {
@@ -804,7 +802,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, option2 =0x0000b000 ;break ;case G200_ER : - dac_index90 =0 ;break ; }
@@ -853,10 +850,8 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,WREG_DAC (i, dacvalue[i]); } -if (mdev->type ==G200_ER ) { -WREG_DAC (0x90 , dac_index90); - } - +if (mdev->type ==G200_ER ) +WREG_DAC (0x90 ,0 );if (option)pci_write_config_dword (dev->pdev,PCI_MGA_OPTION , option);
@@ -953,8 +948,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,if (mdev->type ==G200_WB ) ext_vga[1 ] |=0x88 ; - ext_vga_index24 =0x05 ; -/* Set pixel clocks */ misc =0x2d ;WREG8 (MGA_MISC_OUT , misc);
@@ -966,7 +959,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, }if (mdev->type ==G200_ER ) -WREG_ECRT (24 , ext_vga_index24); +WREG_ECRT (0x24 ,0x5 );if (mdev->type ==G200_EV ) {WREG_ECRT (6 ,0 );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 30/126 block: avoid using uninitialized value in from queue_var_store
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit c678ef5286ddb5cf70384ad5af286b0afc9b73e1 ]
As found by gcc-4.8, the QUEUE_SYSFS_BIT_FNS macro creates functions that use a value generated by queue_var_store independent of whether that value was set or not.
block/blk-sysfs.c: In function 'queue_store_nonrot':block/blk-sysfs.c:244:385: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
Unlike most other such warnings, this one is not a false positive, writing any non-number string into the sysfs files indeed has an undefined result, rather than returning an error.
--- block/blk-sysfs.c | 2 ++ 1 file changed, 2 insertions(+)
block/blk-sysfs.c +2 -0
@@ -207,6 +207,8 @@ queue_store_##name(struct request_queue *q, const char *page, size_t count) \unsigned long val; \ssize_t ret; \ ret =queue_var_store (&val, page, count); \ +if (ret <0 ) \ +return ret; \if (neg) \ val = !val; \ \
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 31/126 x86: Fix rebuild with EFI_STUB enabled
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jan Beulich <[email protected]>
[ Upstream commit 918708245e92941df16a634dc201b407d12bcd91 ]
eboot.o and efi_stub_$(BITS).o didn't get added to "targets", and hence their .cmd files don't get included by the build machinery, leading to the files always getting rebuilt.
Rather than adding the two files individually, take the opportunity and add $(VMLINUX_OBJS) to "targets" instead, thus allowing the assignment at the top of the file to be shrunk quite a bit.
At the same time, remove a pointless flags override line - the variable assigned to was misspelled anyway, and the options added are meaningless for assembly sources.
[ hpa: the patch is not minimal, but I am taking it for -urgent anyway
since the excess impact of the patch seems to be small enough. ]
--- arch/x86/boot/compressed/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/boot/compressed/Makefile +2 -3
@@ -4,7 +4,7 @@ # create a compressed vmlinux image from the original vmlinux # -targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o +targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
@@ -29,7 +29,6 @@ VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ $(obj)/piggy.o $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone -$(obj)/efi_stub_$(BITS).o: KBUILD_CLFAGS += -fshort-wchar -mno-red-zone ifeq ($(CONFIG_EFI_STUB), y) VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
@@ -43,7 +42,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment -S $(obj)/vmlinux.bin: vmlinux FORCE $(call if_changed,objcopy) -targets += vmlinux.bin.all vmlinux.relocs +targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs CMD_RELOCS = arch/x86/tools/relocs quiet_cmd_relocs = RELOCS $@
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 32/126 thermal: return an error on failure to register thermal class
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Richard Guy Briggs <[email protected]>
[ Upstream commit da28d966f6aa942ae836d09729f76a1647932309 ]
The return code from the registration of the thermal class is used to unallocate resources, but this failure isn't passed back to the caller of thermal_init. Return this failure back to the caller.
This bug was introduced in changeset 4cb18728 which overwrote the return code when the variable was re-used to catch the return code of the registration of the genetlink thermal socket family.
--- drivers/thermal/thermal_sys.c | 1 + 1 file changed, 1 insertion(+)
drivers/thermal/thermal_sys.c +1 -0
@@ -1518,6 +1518,7 @@ static int __init thermal_init(void)idr_destroy (&thermal_cdev_idr);mutex_destroy (&thermal_idr_lock);mutex_destroy (&thermal_list_lock); +return result; } result =genetlink_init ();return result;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 33/126 msi-wmi: Fix memory leak
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Maxim Mikityanskiy <[email protected]>
[ Upstream commit 51c94491c82c3d9029f6e87a1a153db321d88e35 ]
Fix memory leak - don't forget to kfree ACPI object when returning from msi_wmi_notify() after suppressing key event.
--- drivers/platform/x86/msi-wmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/msi-wmi.c +3 -1
@@ -176,7 +176,7 @@ static void msi_wmi_notify(u32 value, void *context)pr_debug ("Suppressed key event 0x%X - " "Last press was %lld us ago\n" , key->code,ktime_to_us (diff)); -return ; + goto msi_wmi_notify_exit; } last_pressed[key->code -SCANCODE_BASE ] = cur;
@@ -195,6 +195,8 @@ static void msi_wmi_notify(u32 value, void *context)pr_info ("Unknown key pressed - %x\n" , eventcode); }else pr_info ("Unknown event received\n" ); + +msi_wmi_notify_exit:kfree (response.pointer); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 34/126 cpufreq: exynos: Get booting freq value in exynos_cpufreq_init
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jonghwan Choi <[email protected]>
[ Upstream commit 6e45eb12fd1c741d556bf264ee98853b5f3104e5 ]
Boot_freq is for saving booting freq. But exynos_cpufreq_cpu_init is called in hotplug. If boot_freq is existed in exynos_cpufreq_cpu_init, boot_freq could be changed.
--- drivers/cpufreq/exynos-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/exynos-cpufreq.c +2 -2
@@ -220,8 +220,6 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)cpufreq_frequency_table_get_attr (exynos_info->freq_table, policy->cpu); - locking_frequency =exynos_getspeed (0 ); -/* set the transition latency value */ policy->cpuinfo.transition_latency =100000 ;
@@ -285,6 +283,8 @@ static int __init exynos_cpufreq_init(void) goto err_vdd_arm; } + locking_frequency =exynos_getspeed (0 ); +register_pm_notifier (&exynos_cpufreq_nb);if (cpufreq_register_driver (&exynos_driver)) {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 35/126 drm/i915: add quirk to invert brightness on eMachines G725
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
[ Upstream commit 1ffff60320879830e469e26062c18f75236822ba ]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59628
--- drivers/gpu/drm/i915/intel_display.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -7153,6 +7153,9 @@ static struct intel_quirk intel_quirks[] = {/* Acer Aspire 5734Z must invert backlight brightness */ { 0x2a42, 0x1025, 0x0459, quirk_invert_brightness }, + +/* Acer/eMachines G725 */ + { 0x2a42, 0x1025, 0x0210, quirk_invert_brightness }, };static void intel_init_quirks (struct drm_device *dev)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 36/126 drm/i915: add quirk to invert brightness on eMachines e725
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
[ Upstream commit 01e3a8feb40e54b962a20fa7eb595c5efef5e109 ]
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=31522#c35
--- drivers/gpu/drm/i915/intel_display.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -7156,6 +7156,9 @@ static struct intel_quirk intel_quirks[] = {/* Acer/eMachines G725 */ { 0x2a42, 0x1025, 0x0210, quirk_invert_brightness }, + +/* Acer/eMachines e725 */ + { 0x2a42, 0x1025, 0x0212, quirk_invert_brightness }, };static void intel_init_quirks (struct drm_device *dev)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 37/126 drm/i915: add quirk to invert brightness on Packard Bell NCL20
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jani Nikula <[email protected]>
[ Upstream commit 5559ecadad5a73b27f863e92f4b4f369501dce6f ]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44156
--- drivers/gpu/drm/i915/intel_display.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -7159,6 +7159,9 @@ static struct intel_quirk intel_quirks[] = {/* Acer/eMachines e725 */ { 0x2a42, 0x1025, 0x0212, quirk_invert_brightness }, + +/* Acer/Packard Bell NCL20 */ + { 0x2a42, 0x1025, 0x034b, quirk_invert_brightness }, };static void intel_init_quirks (struct drm_device *dev)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 38/126 r8169: fix auto speed down issue
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: hayeswang <[email protected]>
[ Upstream commit e2409d83434d77874b461b78af6a19cd6e6a1280 ]
It would cause no link after suspending or shutdowning when the nic changes the speed to 10M and connects to a link partner which forces the speed to 100M.
Check the link partner ability to determine which speed to set.
--- drivers/net/ethernet/realtek/r8169.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-)
drivers/net/ethernet/realtek/r8169.c +25 -3
@@ -3827,6 +3827,30 @@ static void __devinit rtl_init_mdio_ops(struct rtl8169_private *tp) } } +static void rtl_speed_down (struct rtl8169_private *tp) +{ +u32 adv; +int lpa; + +rtl_writephy (tp,0x1f ,0x0000 ); + lpa =rtl_readphy (tp,MII_LPA ); + +if (lpa & (LPA_10HALF |LPA_10FULL )) + adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full; +else if (lpa & (LPA_100HALF |LPA_100FULL )) + adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full; +else + adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | + (tp->mii.supports_gmii ? + ADVERTISED_1000baseT_Half | + ADVERTISED_1000baseT_Full :0 ); + +rtl8169_set_speed (tp->dev,AUTONEG_ENABLE ,SPEED_1000 ,DUPLEX_FULL , + adv); +} +static void rtl_wol_suspend_quirk (struct rtl8169_private *tp) {void __iomem *ioaddr = tp->mmio_addr;
@@ -3857,9 +3881,7 @@ static bool rtl_wol_pll_power_down(struct rtl8169_private *tp)if (!(__rtl8169_get_wol (tp) &WAKE_ANY ))return false; -rtl_writephy (tp,0x1f ,0x0000 ); -rtl_writephy (tp,MII_BMCR ,0x0000 ); - +rtl_speed_down (tp);rtl_wol_suspend_quirk (tp);return true;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 39/126 vfio-pci: Fix possible integer overflow
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alex Williamson <[email protected]>
[ Upstream commit 904c680c7bf016a8619a045850937427f8d7368c ]
The VFIO_DEVICE_SET_IRQS ioctl takes a start and count parameter, both of which are unsigned. We attempt to bounds check these, but fail to account for the case where start is a very large number, allowing start + count to wrap back into the valid range. Bounds check both start and start + count.
--- drivers/vfio/pci/vfio_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/vfio/pci/vfio_pci.c +2 -1
@@ -315,6 +315,7 @@ static long vfio_pci_ioctl(void *device_data,if (!(hdr.flags &VFIO_IRQ_SET_DATA_NONE )) {size_t size; +int max =vfio_pci_get_irq_count (vdev, hdr.index);if (hdr.flags &VFIO_IRQ_SET_DATA_BOOL ) size =sizeof (uint8_t );
@@ -324,7 +325,7 @@ static long vfio_pci_ioctl(void *device_data,return -EINVAL ;if (hdr.argsz - minsz < hdr.count * size || - hdr.count >vfio_pci_get_irq_count (vdev, hdr.index)) + hdr.start >= max || hdr.start + hdr.count > max)return -EINVAL ; data =kmalloc (hdr.count * size,GFP_KERNEL );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 40/126 can: gw: use kmem_cache_free() instead of kfree()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
[ Upstream commit 3480a2125923e4b7a56d79efc76743089bf273fc ]
Memory allocated by kmem_cache_alloc() should be freed using kmem_cache_free(), not kfree().
--- net/can/gw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/can/gw.c +3 -3
@@ -436,7 +436,7 @@ static int cgw_notifier(struct notifier_block *nb,if (gwj->src.dev == dev || gwj->dst.dev == dev) {hlist_del (&gwj->list);cgw_unregister_filter (gwj); -kfree (gwj); +kmem_cache_free (cgw_cache, gwj); } } }
@@ -826,7 +826,7 @@ static void cgw_remove_all_jobs(void)hlist_for_each_entry_safe (gwj, n, nx, &cgw_list, list) {hlist_del (&gwj->list);cgw_unregister_filter (gwj); -kfree (gwj); +kmem_cache_free (cgw_cache, gwj); } }
@@ -879,7 +879,7 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)hlist_del (&gwj->list);cgw_unregister_filter (gwj); -kfree (gwj); +kmem_cache_free (cgw_cache, gwj); err =0 ;break ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 41/126 rt2x00: rt2x00pci_regbusy_read() - only print register access failure once
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Tim Gardner <[email protected]>
[ Upstream commit 83589b30f1e1dc9898986293c9336b8ce1705dec ]
It appears that when this register read fails it never recovers, so I think there is no need to repeat the same error message ad infinitum.
--- drivers/net/wireless/rt2x00/rt2x00pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2x00pci.c +2 -2
@@ -52,8 +52,8 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev,udelay (REGISTER_BUSY_DELAY ); } -ERROR (rt2x00dev,"Indirect register access failed: " -"offset=0x%.08x, value=0x%.08x\n" , offset, *reg); +printk_once (KERN_ERR "%s() Indirect register access failed: " +"offset=0x%.08x, value=0x%.08x\n" , __func__, offset, *reg); *reg = ~0 ;return 0 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 42/126 ALSA: usb-audio: fix endianness bug in snd_nativeinstruments_*
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Eldad Zack <[email protected]>
[ Upstream commit 889d66848b12d891248b03abcb2a42047f8e172a ]
The usb_control_msg() function expects __u16 types and performs the endianness conversions by itself.
However, in three places, a conversion is performed before it is handed over to usb_control_msg(), which leads to a double conversion (= no conversion):
* snd_usb_nativeinstruments_boot_quirk()
* snd_nativeinstruments_control_get()
* snd_nativeinstruments_control_put()
Caught by sparse:
sound/usb/mixer_quirks.c:512:38: warning: incorrect type in argument 6 (different base types)sound/usb/mixer_quirks.c:512:38: expected unsigned short [unsigned] [usertype] indexsound/usb/mixer_quirks.c:512:38: got restricted __le16 [usertype] <noident>sound/usb/mixer_quirks.c:543:35: warning: incorrect type in argument 5 (different base types)sound/usb/mixer_quirks.c:543:35: expected unsigned short [unsigned] [usertype] valuesound/usb/mixer_quirks.c:543:35: got restricted __le16 [usertype] <noident>sound/usb/mixer_quirks.c:543:56: warning: incorrect type in argument 6 (different base types)sound/usb/mixer_quirks.c:543:56: expected unsigned short [unsigned] [usertype] indexsound/usb/mixer_quirks.c:543:56: got restricted __le16 [usertype] <noident>sound/usb/quirks.c:502:35: warning: incorrect type in argument 5 (different base types)sound/usb/quirks.c:502:35: expected unsigned short [unsigned] [usertype] valuesound/usb/quirks.c:502:35: got restricted __le16 [usertype] <noident>
--- sound/usb/mixer_quirks.c | 4 ++-- sound/usb/quirks.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
sound/usb/mixer_quirks.c +2 -2
@@ -493,7 +493,7 @@ static int snd_nativeinstruments_control_get(struct snd_kcontrol *kcontrol,else ret =usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ), bRequest,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_IN , -0 ,cpu_to_le16 (wIndex), +0 , wIndex, &tmp,sizeof (tmp),1000 );up_read (&mixer->chip->shutdown_rwsem);
@@ -524,7 +524,7 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,else ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), bRequest,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_OUT , -cpu_to_le16 (wValue),cpu_to_le16 (wIndex), + wValue, wIndex,NULL ,0 ,1000 );up_read (&mixer->chip->shutdown_rwsem);
sound/usb/quirks.c +1 -1
@@ -484,7 +484,7 @@ static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev) {int ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ),0xaf ,USB_TYPE_VENDOR |USB_RECIP_DEVICE , -cpu_to_le16 (1 ),0 ,NULL ,0 ,1000 ); +1 ,0 ,NULL ,0 ,1000 );if (ret <0 )return ret;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 43/126 ASoC: wm8903: Fix the bypass to HP/LINEOUT when no DAC or ADC is running
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Alban Bedel <[email protected]>
[ Upstream commit f1ca493b0b5e8f42d3b2dc8877860db2983f47b6 ]
The Charge Pump needs the DSP clock to work properly, without it the bypass to HP/LINEOUT is not working properly. This requirement is not mentioned in the datasheet but has been confirmed by Mark Brown from Wolfson.
--- sound/soc/codecs/wm8903.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/codecs/wm8903.c +2 -0
@@ -1083,6 +1083,8 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = { { "ROP", NULL, "Right Speaker PGA" }, { "RON", NULL, "Right Speaker PGA" }, + { "Charge Pump", NULL, "CLK_DSP" }, + { "Left Headphone Output PGA", NULL, "Charge Pump" }, { "Right Headphone Output PGA", NULL, "Charge Pump" }, { "Left Line Output PGA", NULL, "Charge Pump" },
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 44/126 tracing: Fix double free when function profile init failed
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
[ Upstream commit 83e03b3fe4daffdebbb42151d5410d730ae50bd1 ]
On the failure path, stat->start and stat->pages will refer same page. So it'll attempt to free the same page again and get kernel panic.
--- kernel/trace/ftrace.c | 1 - 1 file changed, 1 deletion(-)
kernel/trace/ftrace.c +0 -1
@@ -642,7 +642,6 @@ int ftrace_profile_pages_init(struct ftrace_profile_stat *stat)free_page (tmp); } -free_page ((unsigned long )stat->pages); stat->pages =NULL ; stat->start =NULL ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 45/126 PM / reboot: call syscore_shutdown() after disable_nonboot_cpus()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
[ Upstream commit 6f389a8f1dd22a24f3d9afc2812b30d639e94625 ]
As commit 40dc166c (PM / Core: Introduce struct syscore_ops for core subsystems PM) say, syscore_ops operations should be carried with one CPU on-line and interrupts disabled. However, after commit f96972f2d (kernel/sys.c: call disable_nonboot_cpus() in kernel_restart()), syscore_shutdown() is called before disable_nonboot_cpus(), so break the rules. We have a MIPS machine with a 8259A PIC, and there is an external timer (HPET) linked at 8259A. Since 8259A has been shutdown too early (by syscore_shutdown()), disable_nonboot_cpus() runs without timer interrupt, so it hangs and reboot fails. This patch call syscore_shutdown() a little later (after disable_nonboot_cpus()) to avoid reboot failure, this is the same way as poweroff does.
For consistency, add disable_nonboot_cpus() to kernel_halt().
--- kernel/sys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sys.c +2 -1
@@ -323,7 +323,6 @@ void kernel_restart_prepare(char *cmd) system_state =SYSTEM_RESTART ;usermodehelper_disable ();device_shutdown (); -syscore_shutdown (); }/**
@@ -369,6 +368,7 @@ void kernel_restart(char *cmd) {kernel_restart_prepare (cmd);disable_nonboot_cpus (); +syscore_shutdown ();if (!cmd)printk (KERN_EMERG "Restarting system.\n" );else
@@ -394,6 +394,7 @@ static void kernel_shutdown_prepare(enum system_states state)void kernel_halt (void ) {kernel_shutdown_prepare (SYSTEM_HALT ); +disable_nonboot_cpus ();syscore_shutdown ();printk (KERN_EMERG "System halted.\n" );kmsg_dump (KMSG_DUMP_HALT );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 46/126 GFS2: Fix unlock of fcntl locks during withdrawn state
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Steven Whitehouse <[email protected]>
[ Upstream commit c2952d202f710d326ac36a8ea6bd216b20615ec8 ]
When withdraw occurs, we need to continue to allow unlocks of fcntl locks to occur, however these will only be local, since the node has withdrawn from the cluster. This prevents triggering a VFS level bug trap due to locks remaining when a file is closed.
--- fs/gfs2/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/gfs2/file.c +4 -1
@@ -926,8 +926,11 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) cmd =F_SETLK ; fl->fl_type =F_UNLCK ; } -if (unlikely (test_bit (SDF_SHUTDOWN , &sdp->sd_flags))) +if (unlikely (test_bit (SDF_SHUTDOWN , &sdp->sd_flags))) { +if (fl->fl_type ==F_UNLCK ) +posix_lock_file_wait (file, fl);return -EIO ; + }if (IS_GETLK (cmd))return dlm_posix_get (ls->ls_dlm, ip->i_no_addr, file, fl);else if (fl->fl_type ==F_UNLCK )
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 47/126 libsas: fix handling vacant phy in sas_set_ex_phy()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Lukasz Dorau <[email protected]>
[ Upstream commit d4a2618fa77b5e58ec15342972bd3505a1c3f551 ]
If a result of the SMP discover function is PHY VACANT, the content of discover response structure (dr) is not valid. It sometimes happens that dr->attached_sas_addr can contain even SAS address of other phy. In such case an invalid phy is created, what causes NULL pointer dereference during destruction of expander's phys.
So if a result of SMP function is PHY VACANT, the content of discover response structure (dr) must not be copied to phy structure.
This patch fixes the following bug:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000030 IP: [<ffffffff811c9002>] sysfs_find_dirent+0x12/0x90 Call Trace: [<ffffffff811c95f5>] sysfs_get_dirent+0x35/0x80 [<ffffffff811cb55e>] sysfs_unmerge_group+0x1e/0xb0 [<ffffffff813329f4>] dpm_sysfs_remove+0x24/0x90 [<ffffffff8132b0f4>] device_del+0x44/0x1d0 [<ffffffffa016fc59>] sas_rphy_delete+0x9/0x20 [scsi_transport_sas] [<ffffffffa01a16f6>] sas_destruct_devices+0xe6/0x110 [libsas] [<ffffffff8107ac7c>] process_one_work+0x16c/0x350 [<ffffffff8107d84a>] worker_thread+0x17a/0x410 [<ffffffff81081b76>] kthread+0x96/0xa0 [<ffffffff81464944>] kernel_thread_helper+0x4/0x10
--- drivers/scsi/libsas/sas_expander.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/scsi/libsas/sas_expander.c +12 -0
@@ -235,6 +235,17 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) linkrate = phy->linkrate;memcpy (sas_addr, phy->attached_sas_addr,SAS_ADDR_SIZE ); +/* Handle vacant phy - rest of dr data is not valid so skip it */ +if (phy->phy_state ==PHY_VACANT ) { +memset (phy->attached_sas_addr,0 ,SAS_ADDR_SIZE ); + phy->attached_dev_type =NO_DEVICE ; +if (!test_bit (SAS_HA_ATA_EH_ACTIVE , &ha->state)) { + phy->phy_id = phy_id; + goto skip; + }else + goto out; + } + phy->attached_dev_type =to_dev_type (dr);if (test_bit (SAS_HA_ATA_EH_ACTIVE , &ha->state)) goto out;
@@ -272,6 +283,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) phy->phy->maximum_linkrate = dr->pmax_linkrate; phy->phy->negotiated_linkrate = phy->linkrate; + skip:if (new_phy)if (sas_phy_add (phy->phy)) {sas_phy_free (phy->phy);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 48/126 cifs: Allow passwords which begin with a delimitor
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sachin Prabhu <[email protected]>
[ Upstream commit c369c9a4a7c82d33329d869cbaf93304cc7a0c40 ]
Fixes a regression in cifs_parse_mount_options where a password which begins with a delimitor is parsed incorrectly as being a blank password.
--- fs/cifs/connect.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
fs/cifs/connect.c +13 -3
@@ -1489,14 +1489,24 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, }break ;case Opt_blank_pass: - vol->password =NULL ; -break ; -case Opt_pass:/* passwords have to be handled differently * to allow the character used for deliminator * to be passed within them */ +/* +* Check if this is a case where the password +* starts with a delimiter +*/ + tmp_end =strchr (data,'=' ); + tmp_end++; +if (!(tmp_end < end && tmp_end[1 ] == delim)) { +/* No it is not. Set the password to NULL */ + vol->password =NULL ; +break ; + } +/* Yes it is. Drop down to Opt_pass below.*/ +case Opt_pass:/* Obtain the value string */ value =strchr (data,'=' ); value++;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 49/126 target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
[ Upstream commit 30f359a6f9da65a66de8cadf959f0f4a0d498bba ]
This patch fixes a bug where a handful of informational / control CDBs that should be allowed during ALUA access state Standby/Offline/Transition where incorrectly returning CHECK_CONDITION + ASCQ_04H_ALUA_TG_PT_*.
This includes INQUIRY + REPORT_LUNS, which would end up preventing LUN registration when LUN scanning occured during these ALUA access states.
--- drivers/target/target_core_alua.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/target/target_core_alua.c +3 -0
@@ -420,6 +420,7 @@ static inline int core_alua_state_standby(case REPORT_LUNS :case RECEIVE_DIAGNOSTIC :case SEND_DIAGNOSTIC : +return 0 ;case MAINTENANCE_IN :switch (cdb[1 ] &0x1f ) {case MI_REPORT_TARGET_PGS :
@@ -462,6 +463,7 @@ static inline int core_alua_state_unavailable(switch (cdb[0 ]) {case INQUIRY :case REPORT_LUNS : +return 0 ;case MAINTENANCE_IN :switch (cdb[1 ] &0x1f ) {case MI_REPORT_TARGET_PGS :
@@ -502,6 +504,7 @@ static inline int core_alua_state_transition(switch (cdb[0 ]) {case INQUIRY :case REPORT_LUNS : +return 0 ;case MAINTENANCE_IN :switch (cdb[1 ] &0x1f ) {case MI_REPORT_TARGET_PGS :
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 50/126 vfs: Revert spurious fix to spinning prevention in prune_icache_sb
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Suleiman Souhlal <[email protected]>
[ Upstream commit 5b55d708335a9e3e4f61f2dadf7511502205ccd1 ]
Revert commit 62a3ddef6181 ("vfs: fix spinning prevention in prune_icache_sb").
This commit doesn't look right: since we are looking at the tail of the list (sb->s_inode_lru.prev) if we want to skip an inode, we should put it back at the head of the list instead of the tail, otherwise we will keep spinning on it.
Discovered when investigating why prune_icache_sb came top in perf reports of a swapping load.
--- fs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/inode.c +1 -1
@@ -725,7 +725,7 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)* inode to the back of the list so we don't spin on it. */ if (!spin_trylock (&inode->i_lock)) { -list_move_tail (&inode->i_lru, &sb->s_inode_lru); +list_move (&inode->i_lru, &sb->s_inode_lru);continue ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 51/126 kref: Implement kref_get_unless_zero v3
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Thomas Hellstrom <[email protected]>
[ Upstream commit 4b20db3de8dab005b07c74161cb041db8c5ff3a7 ]
This function is intended to simplify locking around refcounting for objects that can be looked up from a lookup structure, and which are removed from that lookup structure in the object destructor. Operations on such objects require at least a read lock around lookup + kref_get, and a write lock around kref_put + remove from lookup structure. Furthermore, RCU implementations become extremely tricky. With a lookup followed by a kref_get_unless_zero *with return value check* locking in the kref_put path can be deferred to the actual removal from the lookup structure and RCU lookups become trivial.
v2: Formatting fixes.
v3: Invert the return value.
--- include/linux/kref.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
include/linux/kref.h +21 -0
@@ -111,4 +111,25 @@ static inline int kref_put_mutex(struct kref *kref, }return 0 ; } + +/** +* kref_get_unless_zero - Increment refcount for object unless it is zero. +* @kref: object. +* +* Return non-zero if the increment succeeded. Otherwise return 0. +* +* This function is intended to simplify locking around refcounting for +* objects that can be looked up from a lookup structure, and which are +* removed from that lookup structure in the object destructor. +* Operations on such objects require at least a read lock around +* lookup + kref_get, and a write lock around kref_put + remove from lookup +* structure. Furthermore, RCU implementations become extremely tricky. +* With a lookup followed by a kref_get_unless_zero *with return value check* +* locking in the kref_put path can be deferred to the actual removal from +* the lookup structure and RCU lookups become trivial. +*/ +static inline int __must_check kref_get_unless_zero (struct kref *kref) +{ +return atomic_add_unless (&kref->refcount,1 ,0 ); +}#endif /* _KREF_H_ */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 52/126 kobject: fix kset_find_obj() race with concurrent last kobject_put()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit a49b7e82cab0f9b41f483359be83f44fbb6b4979 ]
Anatol Pomozov identified a race condition that hits module unloading and re-loading. To quote Anatol:
"This is a race codition that exists between kset_find_obj() and
kobject_put(). kset_find_obj() might return kobject that has refcount equal to 0 if this kobject is freeing by kobject_put() in other thread.
Here is timeline for the crash in case if kset_find_obj() searches for an object tht nobody holds and other thread is doing kobject_put() on the same kobject:
THREAD A (calls kset_find_obj()) THREAD B (calls kobject_put())
splin_lock()
atomic_dec_return(kobj->kref), counter gets zero here ... starts kobject cleanup .... spin_lock() // WAIT thread A in kobj_kset_leave()
iterate over kset->list
atomic_inc(kobj->kref) (counter becomes 1)
spin_unlock()
spin_lock() // taken
// it does not know that thread A increased counter so it remove obj from list
spin_unlock()
vfree(module) // frees module object with containing kobj
// kobj points to freed memory area!!
kobject_put(kobj) // OOPS!!!!
The race above happens because module.c tries to use kset_find_obj() when somebody unloads module. The module.c code was introduced in commit 6494a93d55fa"
Anatol supplied a patch specific for module.c that worked around the problem by simply not using kset_find_obj() at all, but rather than make a local band-aid, this just fixes kset_find_obj() to be thread-safe using the proper model of refusing the get a new reference if the refcount has already dropped to zero.
See examples of this proper refcount handling not only in the kref documentation, but in various other equivalent uses of this pattern by grepping for atomic_inc_not_zero().
[ Side note: the module race does indicate that module loading and
unloading is not properly serialized wrt sysfs information using the module mutex. That may require further thought, but this is the correct fix at the kobject layer regardless. ]
--- lib/kobject.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
lib/kobject.c +8 -1
@@ -529,6 +529,13 @@ struct kobject *kobject_get(struct kobject *kobj)return kobj; } +static struct kobject *kobject_get_unless_zero (struct kobject *kobj) +{ +if (!kref_get_unless_zero (&kobj->kref)) + kobj =NULL ; +return kobj; +} +/* * kobject_cleanup - free kobject resources. * @kobj: object to cleanup
@@ -751,7 +758,7 @@ struct kobject *kset_find_obj(struct kset *kset, const char *name)list_for_each_entry (k, &kset->list, entry) {if (kobject_name (k) && !strcmp (kobject_name (k), name)) { - ret =kobject_get (k); + ret =kobject_get_unless_zero (k);break ; } }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 53/126 x86-32: Fix possible incomplete TLB invalidate with PAE pagetables
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dave Hansen <[email protected]>
[ Upstream commit 1de14c3c5cbc9bb17e9dcc648cda51c0c85d54b9 ]
This patch attempts to fix:
https://bugzilla.kernel.org/show_bug.cgi?id=56461
The symptom is a crash and messages like this:
chrome: Corrupted page table at address 34a03000 *pdpt = 0000000000000000 *pde = 0000000000000000 Bad pagetable: 000f [#1] PREEMPT SMP
Ingo guesses this got introduced by commit 611ae8e3f520 ("x86/tlb:
enable tlb flush range support for x86") since that code started to free unused pagetables.
On x86-32 PAE kernels, that new code has the potential to free an entire PMD page and will clear one of the four page-directory-pointer-table (aka pgd_t entries).
The hardware aggressively "caches" these top-level entries and invlpg does not actually affect the CPU's copy. If we clear one we *HAVE* to do a full TLB flush, otherwise we might continue using a freed pmd page. (note, we do this properly on the population side in pud_populate()).
This patch tracks whenever we clear one of these entries in the 'struct mmu_gather', and ensures that we follow up with a full tlb flush.
BTW, I disassembled and checked that:
if (tlb->fullmm == 0) and if (!tlb->fullmm && !tlb->need_flush_all)
generate essentially the same code, so there should be zero impact there to the !PAE case.
--- arch/x86/include/asm/tlb.h | 2 +- arch/x86/mm/pgtable.c | 7 +++++++ include/asm-generic/tlb.h | 7 ++++++- mm/memory.c | 1 + 4 files changed, 15 insertions(+), 2 deletions(-)
arch/x86/include/asm/tlb.h +1 -1
@@ -7,7 +7,7 @@#define tlb_flush (tlb) \ { \ - if (tlb->fullmm == 0) \ + if (!tlb->fullmm && !tlb->need_flush_all) \ flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end, 0UL); \ else \ flush_tlb_mm_range(tlb->mm, 0UL, TLB_FLUSH_ALL, 0UL); \
arch/x86/mm/pgtable.c +7 -0
@@ -58,6 +58,13 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)void ___pmd_free_tlb (struct mmu_gather *tlb,pmd_t *pmd) {paravirt_release_pmd (__pa (pmd) >>PAGE_SHIFT ); +/* +* NOTE! For PAE, any changes to the top page-directory-pointer-table +* entries need a full cr3 reload to flush. +*/ +#ifdef CONFIG_X86_PAE + tlb->need_flush_all =1 ; +#endif tlb_remove_page (tlb,virt_to_page (pmd)); }
include/asm-generic/tlb.h +6 -1
@@ -91,7 +91,12 @@ struct mmu_gather { unsigned int need_flush : 1, /* Did free PTEs */ fast_mode : 1; /* No batching */ -unsigned int fullmm; +/* we are in the middle of an operation to clear +* a full mm and can make some optimizations */ + unsigned int fullmm : 1, +/* we have performed an operation which +* requires a complete flush of the tlb */ + need_flush_all : 1;struct mmu_gather_batch *active;struct mmu_gather_batch local;
mm/memory.c +1 -0
@@ -206,6 +206,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm) tlb->mm = mm; tlb->fullmm = fullmm; + tlb->need_flush_all =0 ; tlb->start =-1UL ; tlb->end =0 ; tlb->need_flush =0 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 54/126 tracing: Fix possible NULL pointer dereferences
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
[ Upstream commit 6a76f8c0ab19f215af2a3442870eeb5f0e81998d ]
Currently set_ftrace_pid and set_graph_function files use seq_lseek for their fops. However seq_open() is called only for FMODE_READ in the fops->open() so that if an user tries to seek one of those file when she open it for writing, it sees NULL seq_file and then panic.
It can be easily reproduced with following command:
$ cd /sys/kernel/debug/tracing $ echo 1234 | sudo tee -a set_ftrace_pid
In this example, GNU coreutils' tee opens the file with fopen(, "a") and then the fopen() internally calls lseek().
--- include/linux/ftrace.h | 2 +- kernel/trace/ftrace.c | 10 +++++----- kernel/trace/trace_stack.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
include/linux/ftrace.h +1 -1
@@ -305,7 +305,7 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, size_t cnt, loff_t *ppos);ssize_t ftrace_notrace_write (struct file *file,const char __user *ubuf,size_t cnt,loff_t *ppos); -loff_t ftrace_regex_lseek (struct file *file,loff_t offset,int origin); +loff_t ftrace_filter_lseek (struct file *file,loff_t offset,int origin);int ftrace_regex_release (struct inode *inode,struct file *file);void __init
kernel/trace/ftrace.c +5 -5
@@ -2594,7 +2594,7 @@ ftrace_notrace_open(struct inode *inode, struct file *file) }loff_t -ftrace_regex_lseek (struct file *file,loff_t offset,int origin) +ftrace_filter_lseek (struct file *file,loff_t offset,int origin) {loff_t ret;
@@ -3413,7 +3413,7 @@ static const struct file_operations ftrace_filter_fops = { .open = ftrace_filter_open, .read = seq_read, .write = ftrace_filter_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, };
@@ -3421,7 +3421,7 @@ static const struct file_operations ftrace_notrace_fops = { .open = ftrace_notrace_open, .read = seq_read, .write = ftrace_notrace_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, };
@@ -3626,8 +3626,8 @@ static const struct file_operations ftrace_graph_fops = { .open = ftrace_graph_open, .read = seq_read, .write = ftrace_graph_write, + .llseek = ftrace_filter_lseek, .release = ftrace_graph_release, - .llseek = seq_lseek, };#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
@@ -4236,7 +4236,7 @@ static const struct file_operations ftrace_pid_fops = { .open = ftrace_pid_open, .write = ftrace_pid_write, .read = seq_read, - .llseek = seq_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_pid_release, };
kernel/trace/trace_stack.c +1 -1
@@ -324,7 +324,7 @@ static const struct file_operations stack_trace_filter_fops = { .open = stack_trace_filter_open, .read = seq_read, .write = ftrace_filter_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, };
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 55/126 udl: handle EDID failure properly.
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
[ Upstream commit 1baee58638fc58248625255f5c5fcdb987f11b1f ]
Don't oops seems proper.
--- drivers/gpu/drm/udl/udl_connector.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/udl/udl_connector.c +4 -0
@@ -56,6 +56,10 @@ static int udl_get_modes(struct drm_connector *connector)int ret; edid = (struct edid *)udl_get_edid (udl); +if (!edid) { +drm_mode_connector_update_edid_property (connector,NULL ); +return 0 ; + } connector->display_info.raw_edid = (char *)edid;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 56/126 ftrace: Move ftrace_filter_lseek out of CONFIG_DYNAMIC_FTRACE section
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
[ Upstream commit 7f49ef69db6bbf756c0abca7e9b65b32e999eec8 ]
As ftrace_filter_lseek is now used with ftrace_pid_fops, it needs to be moved out of the #ifdef CONFIG_DYNAMIC_FTRACE section as the ftrace_pid_fops is defined when DYNAMIC_FTRACE is not.
--- include/linux/ftrace.h | 3 ++- kernel/trace/ftrace.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
include/linux/ftrace.h +2 -1
@@ -305,7 +305,6 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, size_t cnt, loff_t *ppos);ssize_t ftrace_notrace_write (struct file *file,const char __user *ubuf,size_t cnt,loff_t *ppos); -loff_t ftrace_filter_lseek (struct file *file,loff_t offset,int origin);int ftrace_regex_release (struct inode *inode,struct file *file);void __init
@@ -429,6 +428,8 @@ static inline int ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }#endif /* CONFIG_DYNAMIC_FTRACE */ +loff_t ftrace_filter_lseek (struct file *file,loff_t offset,int whence); +/* totally disable ftrace - can not re-enable after this */ void ftrace_kill (void );
kernel/trace/ftrace.c +1 -1
@@ -2509,7 +2509,7 @@ static void ftrace_filter_reset(struct ftrace_hash *hash)* routine, you can use ftrace_filter_write() for the write * routine if @flag has FTRACE_ITER_FILTER set, or * ftrace_notrace_write() if @flag has FTRACE_ITER_NOTRACE set. -* ftrace_regex_lseek() should be used as the lseek routine, and +* ftrace_filter_lseek() should be used as the lseek routine, and * release must call ftrace_regex_release(). */ int
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 57/126 sched_clock: Prevent 64bit inatomicity on 32bit systems
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit a1cbcaa9ea87b87a96b9fc465951dcf36e459ca2 ]
The sched_clock_remote() implementation has the following inatomicity problem on 32bit systems when accessing the remote scd->clock, which is a 64bit value.
CPU0 CPU1
sched_clock_local() sched_clock_remote(CPU0)
...
remote_clock = scd[CPU0]->clock read_low32bit(scd[CPU0]->clock) cmpxchg64(scd->clock,...) read_high32bit(scd[CPU0]->clock)
While the update of scd->clock is using an atomic64 mechanism, the readout on the remote cpu is not, which can cause completely bogus readouts.
It is a quite rare problem, because it requires the update to hit the narrow race window between the low/high readout and the update must go across the 32bit boundary.
The resulting misbehaviour is, that CPU1 will see the sched_clock on CPU1 ~4 seconds ahead of it's own and update CPU1s sched_clock value to this bogus timestamp. This stays that way due to the clamping implementation for about 4 seconds until the synchronization with CLOCK_MONOTONIC undoes the problem.
The issue is hard to observe, because it might only result in a less accurate SCHED_OTHER timeslicing behaviour. To create observable damage on realtime scheduling classes, it is necessary that the bogus update of CPU1 sched_clock happens in the context of an realtime thread, which then gets charged 4 seconds of RT runtime, which results in the RT throttler mechanism to trigger and prevent scheduling of RT tasks for a little less than 4 seconds. So this is quite unlikely as well.
The issue was quite hard to decode as the reproduction time is between 2 days and 3 weeks and intrusive tracing makes it less likely, but the following trace recorded with trace_clock=global, which uses sched_clock_local(), gave the final hint:
<idle>-0 0d..30 400269.477150: hrtimer_cancel: hrtimer=0xf7061e80
<idle>-0 0d..30 400269.477151: hrtimer_start: hrtimer=0xf7061e80 ...
irq/20-S-587 1d..32 400273.772118: sched_wakeup: comm= ... target_cpu=0
<idle>-0 0dN.30 400273.772118: hrtimer_cancel: hrtimer=0xf7061e80
What happens is that CPU0 goes idle and invokes sched_clock_idle_sleep_event() which invokes sched_clock_local() and CPU1 runs a remote wakeup for CPU0 at the same time, which invokes sched_remote_clock(). The time jump gets propagated to CPU0 via sched_remote_clock() and stays stale on both cores for ~4 seconds.
There are only two other possibilities, which could cause a stale sched clock:
1) ktime_get() which reads out CLOCK_MONOTONIC returns a sporadic wrong value.
2) sched_clock() which reads the TSC returns a sporadic wrong value.
#1 can be excluded because sched_clock would continue to increase for
one jiffy and then go stale.
#2 can be excluded because it would not make the clock jump
forward. It would just result in a stale sched_clock for one jiffy.
After quite some brain twisting and finding the same pattern on other traces, sched_clock_remote() remained the only place which could cause such a problem and as explained above it's indeed racy on 32bit systems.
So while on 64bit systems the readout is atomic, we need to verify the remote readout on 32bit machines. We need to protect the local->clock readout in sched_clock_remote() on 32bit as well because an NMI could hit between the low and the high readout, call sched_clock_local() and modify local->clock.
Thanks to Siegfried Wulsch for bearing with my debug requests and going through the tedious tasks of running a bunch of reproducer systems to generate the debug information which let me decode the issue.
--- kernel/sched/clock.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
kernel/sched/clock.c +26 -0
@@ -176,10 +176,36 @@ static u64 sched_clock_remote(struct sched_clock_data *scd)u64 this_clock, remote_clock;u64 *ptr, old_val, val; +#if BITS_PER_LONG !=64 +again: +/* +* Careful here: The local and the remote clock values need to +* be read out atomic as we need to compare the values and +* then update either the local or the remote side. So the +* cmpxchg64 below only protects one readout. +* +* We must reread via sched_clock_local() in the retry case on +* 32bit as an NMI could use sched_clock_local() via the +* tracer and hit between the readout of +* the low32bit and the high 32bit portion. +*/ + this_clock =sched_clock_local (my_scd); +/* +* We must enforce atomic readout on 32bit, otherwise the +* update on the remote cpu can hit inbetween the readout of +* the low32bit and the high 32bit portion. +*/ + remote_clock =cmpxchg64 (&scd->clock,0 ,0 ); +#else +/* +* On 64bit the read of [my]scd->clock is atomic versus the +* update, so we can avoid the above 32bit dance. +*/ sched_clock_local (my_scd); again: this_clock = my_scd->clock; remote_clock = scd->clock; +#endif /* * Use the opportunity that we have both locks
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 58/126 x86, mm, paravirt: Fix vmalloc_fault oops during lazy MMU updates
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Samu Kallio <[email protected]>
[ Upstream commit 1160c2779b826c6f5c08e5cc542de58fd1f667d5 ]
In paravirtualized x86_64 kernels, vmalloc_fault may cause an oops when lazy MMU updates are enabled, because set_pgd effects are being deferred.
One instance of this problem is during process mm cleanup with memory cgroups enabled. The chain of events is as follows:
- zap_pte_range enables lazy MMU updates
- zap_pte_range eventually calls mem_cgroup_charge_statistics, which accesses the vmalloc'd mem_cgroup per-cpu stat area
- vmalloc_fault is triggered which tries to sync the corresponding PGD entry with set_pgd, but the update is deferred
- vmalloc_fault oopses due to a mismatch in the PUD entries
The OOPs usually looks as so:
------------[ cut here ]------------ kernel BUG at arch/x86/mm/fault.c:396!
invalid opcode: 0000 [#1] SMP
.. snip ..
CPU 1
Pid: 10866, comm: httpd Not tainted 3.6.10-4.fc18.x86_64 #1
RIP: e030:[<ffffffff816271bf>] [<ffffffff816271bf>] vmalloc_fault+0x11f/0x208 .. snip .. Call Trace: [<ffffffff81627759>] do_page_fault+0x399/0x4b0 [<ffffffff81004f4c>] ? xen_mc_extend_args+0xec/0x110 [<ffffffff81624065>] page_fault+0x25/0x30 [<ffffffff81184d03>] ? mem_cgroup_charge_statistics.isra.13+0x13/0x50 [<ffffffff81186f78>] __mem_cgroup_uncharge_common+0xd8/0x350 [<ffffffff8118aac7>] mem_cgroup_uncharge_page+0x57/0x60 [<ffffffff8115fbc0>] page_remove_rmap+0xe0/0x150 [<ffffffff8115311a>] ? vm_normal_page+0x1a/0x80 [<ffffffff81153e61>] unmap_single_vma+0x531/0x870 [<ffffffff81154962>] unmap_vmas+0x52/0xa0 [<ffffffff81007442>] ? pte_mfn_to_pfn+0x72/0x100 [<ffffffff8115c8f8>] exit_mmap+0x98/0x170 [<ffffffff810050d9>] ? __raw_callee_save_xen_pmd_val+0x11/0x1e [<ffffffff81059ce3>] mmput+0x83/0xf0 [<ffffffff810624c4>] exit_mm+0x104/0x130 [<ffffffff8106264a>] do_exit+0x15a/0x8c0 [<ffffffff810630ff>] do_group_exit+0x3f/0xa0 [<ffffffff81063177>] sys_exit_group+0x17/0x20 [<ffffffff8162bae9>] system_call_fastpath+0x16/0x1b
Calling arch_flush_lazy_mmu_mode immediately after set_pgd makes the changes visible to the consistency checks.
Cc: <[email protected]>
RedHat-Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=914737
--- arch/x86/mm/fault.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/x86/mm/fault.c +4 -2
@@ -377,10 +377,12 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)if (pgd_none (*pgd_ref))return -1 ; -if (pgd_none (*pgd)) +if (pgd_none (*pgd)) {set_pgd (pgd, *pgd_ref); -else +arch_flush_lazy_mmu_mode (); + }else {BUG_ON (pgd_page_vaddr (*pgd) !=pgd_page_vaddr (*pgd_ref)); + }/* * Below here mismatches are bugs because these lower tables
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 59/126 x86, mm: Patch out arch_flush_lazy_mmu_mode() when running on bare metal
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Boris Ostrovsky <[email protected]>
[ Upstream commit 511ba86e1d386f671084b5d0e6f110bb30b8eeb2 ]
Invoking arch_flush_lazy_mmu_mode() results in calls to preempt_enable()/disable() which may have performance impact.
Since lazy MMU is not used on bare metal we can patch away arch_flush_lazy_mmu_mode() so that it is never called in such environment.
[ hpa: the previous patch "Fix vmalloc_fault oops during lazy MMU
updates" may cause a minor performance regression on
bare metal. This patch resolves that performance regression. It is somewhat unclear to me if this is a good -stable candidate. ]
--- arch/x86/include/asm/paravirt.h | 5 ++++- arch/x86/include/asm/paravirt_types.h | 2 ++ arch/x86/kernel/paravirt.c | 25 +++++++++++++------------ arch/x86/lguest/boot.c | 1 + arch/x86/xen/mmu.c | 1 + 5 files changed, 21 insertions(+), 13 deletions(-)
arch/x86/include/asm/paravirt.h +4 -1
@@ -705,7 +705,10 @@ static inline void arch_leave_lazy_mmu_mode(void)PVOP_VCALL0 (pv_mmu_ops.lazy_mode.leave); } -void arch_flush_lazy_mmu_mode (void ); +static inline void arch_flush_lazy_mmu_mode (void ) +{ +PVOP_VCALL0 (pv_mmu_ops.lazy_mode.flush); +}static inline void __set_fixmap (unsigned /* enum fixed_addresses */ idx,phys_addr_t phys,pgprot_t flags)
arch/x86/include/asm/paravirt_types.h +2 -0
@@ -91,6 +91,7 @@ struct pv_lazy_ops {/* Set deferred update mode, used for batching operations. */ void (*enter)(void );void (*leave)(void ); +void (*flush)(void ); };struct pv_time_ops {
@@ -679,6 +680,7 @@ void paravirt_end_context_switch(struct task_struct *next);void paravirt_enter_lazy_mmu (void );void paravirt_leave_lazy_mmu (void ); +void paravirt_flush_lazy_mmu (void );void _paravirt_nop (void );u32 _paravirt_ident_32 (u32 );
arch/x86/kernel/paravirt.c +13 -12
@@ -263,6 +263,18 @@ void paravirt_leave_lazy_mmu(void)leave_lazy (PARAVIRT_LAZY_MMU ); } +void paravirt_flush_lazy_mmu (void ) +{ +preempt_disable (); + +if (paravirt_get_lazy_mode () ==PARAVIRT_LAZY_MMU ) { +arch_leave_lazy_mmu_mode (); +arch_enter_lazy_mmu_mode (); + } + +preempt_enable (); +} +void paravirt_start_context_switch (struct task_struct *prev) {BUG_ON (preemptible ());
@@ -292,18 +304,6 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)return this_cpu_read (paravirt_lazy_mode); } -void arch_flush_lazy_mmu_mode (void ) -{ -preempt_disable (); - -if (paravirt_get_lazy_mode () ==PARAVIRT_LAZY_MMU ) { -arch_leave_lazy_mmu_mode (); -arch_enter_lazy_mmu_mode (); - } - -preempt_enable (); -} -struct pv_info pv_info = { .name ="bare hardware" , .paravirt_enabled =0 ,
@@ -475,6 +475,7 @@ struct pv_mmu_ops pv_mmu_ops = { .lazy_mode = { .enter = paravirt_nop, .leave = paravirt_nop, + .flush = paravirt_nop, }, .set_fixmap = native_set_fixmap,
arch/x86/lguest/boot.c +1 -0
@@ -1333,6 +1333,7 @@ __init void lguest_init(void) pv_mmu_ops.read_cr3 = lguest_read_cr3; pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu; pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mmu_mode; + pv_mmu_ops.lazy_mode.flush = paravirt_flush_lazy_mmu; pv_mmu_ops.pte_update = lguest_pte_update; pv_mmu_ops.pte_update_defer = lguest_pte_update;
arch/x86/xen/mmu.c +1 -0
@@ -2079,6 +2079,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { .lazy_mode = { .enter = paravirt_enter_lazy_mmu, .leave = xen_leave_lazy_mmu, + .flush = paravirt_flush_lazy_mmu, }, .set_fixmap = xen_set_fixmap,
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 60/126 ARM: Do 15e0d9e37c (ARM: pm: let platforms select cpu_suspend support) properly
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
[ Upstream commit b6c7aabd923a17af993c5a5d5d7995f0b27c000a ]
Let's do the changes properly and fix the same problem everywhere, not just for one case.
--- arch/arm/mm/proc-arm920.S | 2 +- arch/arm/mm/proc-arm926.S | 2 +- arch/arm/mm/proc-mohawk.S | 2 +- arch/arm/mm/proc-sa1100.S | 2 +- arch/arm/mm/proc-v6.S | 2 +- arch/arm/mm/proc-xsc3.S | 2 +- arch/arm/mm/proc-xscale.S | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/mm/proc-arm920.S +1 -1
@@ -384,7 +384,7 @@ ENTRY(cpu_arm920_set_pte_ext) /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ .globl cpu_arm920_suspend_size .equ cpu_arm920_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_arm920_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-arm926.S +1 -1
@@ -399,7 +399,7 @@ ENTRY(cpu_arm926_set_pte_ext) /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ .globl cpu_arm926_suspend_size .equ cpu_arm926_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_arm926_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-mohawk.S +1 -1
@@ -347,7 +347,7 @@ ENTRY(cpu_mohawk_set_pte_ext) .globl cpu_mohawk_suspend_size .equ cpu_mohawk_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_mohawk_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-sa1100.S +1 -1
@@ -172,7 +172,7 @@ ENTRY(cpu_sa1100_set_pte_ext) .globl cpu_sa1100_suspend_size .equ cpu_sa1100_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_sa1100_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c3, c0, 0 @ domain ID
arch/arm/mm/proc-v6.S +1 -1
@@ -138,7 +138,7 @@ ENTRY(cpu_v6_set_pte_ext) /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */ .globl cpu_v6_suspend_size .equ cpu_v6_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_v6_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
arch/arm/mm/proc-xsc3.S +1 -1
@@ -410,7 +410,7 @@ ENTRY(cpu_xsc3_set_pte_ext) .globl cpu_xsc3_suspend_size .equ cpu_xsc3_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_xsc3_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-xscale.S +1 -1
@@ -524,7 +524,7 @@ ENTRY(cpu_xscale_set_pte_ext) .globl cpu_xscale_suspend_size .equ cpu_xscale_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_xscale_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 61/126 hrtimer: Dont reinitialize a cpu_base lock on CPU_UP
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Michael Bohan <[email protected]>
[ Upstream commit 84cc8fd2fe65866e49d70b38b3fdf7219dd92fe0 ]
The current code makes the assumption that a cpu_base lock won't be held if the CPU corresponding to that cpu_base is offline, which isn't always true.
If a hrtimer is not queued, then it will not be migrated by migrate_hrtimers() when a CPU is offlined. Therefore, the hrtimer's cpu_base may still point to a CPU which has subsequently gone offline if the timer wasn't enqueued at the time the CPU went down.
Normally this wouldn't be a problem, but a cpu_base's lock is blindly reinitialized each time a CPU is brought up. If a CPU is brought online during the period that another thread is performing a hrtimer operation on a stale hrtimer, then the lock will be reinitialized under its feet, and a SPIN_BUG() like the following will be observed:
<0>[ 28.082085] BUG: spinlock already unlocked on CPU#0, swapper/0/0 <0>[ 28.087078] lock: 0xc4780b40, value 0x0 .magic: dead4ead, .owner: <none>/-1, .owner_cpu: -1 <4>[ 42.451150] [<c0014398>] (unwind_backtrace+0x0/0x120) from [<c0269220>] (do_raw_spin_unlock+0x44/0xdc) <4>[ 42.460430] [<c0269220>] (do_raw_spin_unlock+0x44/0xdc) from [<c071b5bc>] (_raw_spin_unlock+0x8/0x30) <4>[ 42.469632] [<c071b5bc>] (_raw_spin_unlock+0x8/0x30) from [<c00a9ce0>] (__hrtimer_start_range_ns+0x1e4/0x4f8) <4>[ 42.479521] [<c00a9ce0>] (__hrtimer_start_range_ns+0x1e4/0x4f8) from [<c00aa014>] (hrtimer_start+0x20/0x28) <4>[ 42.489247] [<c00aa014>] (hrtimer_start+0x20/0x28) from [<c00e6190>] (rcu_idle_enter_common+0x1ac/0x320) <4>[ 42.498709] [<c00e6190>] (rcu_idle_enter_common+0x1ac/0x320) from [<c00e6440>] (rcu_idle_enter+0xa0/0xb8) <4>[ 42.508259] [<c00e6440>] (rcu_idle_enter+0xa0/0xb8) from [<c000f268>] (cpu_idle+0x24/0xf0) <4>[ 42.516503] [<c000f268>] (cpu_idle+0x24/0xf0) from [<c06ed3c0>] (rest_init+0x88/0xa0) <4>[ 42.524319] [<c06ed3c0>] (rest_init+0x88/0xa0) from [<c0c00978>] (start_kernel+0x3d0/0x434)
As an example, this particular crash occurred when hrtimer_start() was executed on CPU #0. The code locked the hrtimer's current cpu_base corresponding to CPU #1. CPU #0 then tried to switch the hrtimer's cpu_base to an optimal CPU which was online. In this case, it selected the cpu_base corresponding to CPU #3.
Before it could proceed, CPU #1 came online and reinitialized the spinlock corresponding to its cpu_base. Thus now CPU #0 held a lock which was reinitialized. When CPU #0 finally ended up unlocking the old cpu_base corresponding to CPU #1 so that it could switch to CPU #3, we hit this SPIN_BUG() above while in switch_hrtimer_base().
CPU #0 CPU #1 ---- ---- ... <offline> hrtimer_start() lock_hrtimer_base(base #1) ... init_hrtimers_cpu() switch_hrtimer_base() ... ... raw_spin_lock_init(&cpu_base->lock) raw_spin_unlock(&cpu_base->lock) ...
<spin_bug>
Solve this by statically initializing the lock.
--- kernel/hrtimer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/hrtimer.c +1 -2
@@ -61,6 +61,7 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) = { + .lock =__RAW_SPIN_LOCK_UNLOCKED (hrtimer_bases.lock), .clock_base = { {
@@ -1640,8 +1641,6 @@ static void __cpuinit init_hrtimers_cpu(int cpu)struct hrtimer_cpu_base *cpu_base = &per_cpu (hrtimer_bases, cpu);int i; -raw_spin_lock_init (&cpu_base->lock); -for (i =0 ; i <HRTIMER_MAX_CLOCK_BASES ; i++) { cpu_base->clock_base[i].cpu_base = cpu_base;timerqueue_init_head (&cpu_base->clock_base[i].active);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 62/126 can: mcp251x: add missing IRQF_ONESHOT to request_threaded_irq
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
[ Upstream commit db388d6460ffa53b3b38429da6f70a913f89b048 ]
Since commit:
1c6c695 genirq: Reject bogus threaded irq requests
threaded irqs must provide a primary handler or set the IRQF_ONESHOT flag. Since the mcp251x driver doesn't make use of a primary handler set the IRQF_ONESHOT flag.
--- drivers/net/can/mcp251x.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/can/mcp251x.c +8 -2
@@ -922,6 +922,7 @@ static int mcp251x_open(struct net_device *net)struct mcp251x_priv *priv =netdev_priv (net);struct spi_device *spi = priv->spi;struct mcp251x_platform_data *pdata = spi->dev.platform_data; +unsigned long flags;int ret; ret =open_candev (net);
@@ -938,9 +939,14 @@ static int mcp251x_open(struct net_device *net) priv->tx_skb =NULL ; priv->tx_len =0 ; + flags =IRQF_ONESHOT ; +if (pdata->irq_flags) + flags |= pdata->irq_flags; +else + flags |=IRQF_TRIGGER_FALLING ; + ret =request_threaded_irq (spi->irq,NULL , mcp251x_can_ist, - pdata->irq_flags ? pdata->irq_flags :IRQF_TRIGGER_FALLING , -DEVICE_NAME , priv); + flags,DEVICE_NAME , priv);if (ret) {dev_err (&spi->dev,"failed to acquire irq %d\n" , spi->irq);if (pdata->transceiver_enable)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 63/126 can: sja1000: fix handling on dt properties on little endian systems
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Christoph Fritz <[email protected]>
[ Upstream commit 0443de5fbf224abf41f688d8487b0c307dc5a4b4 ]
To get correct endianes on little endian cpus (like arm) while reading device tree properties, this patch replaces of_get_property() with of_property_read_u32(). While there use of_property_read_bool() for the handling of the boolean "nxp,no-comparator-bypass" property.
--- drivers/net/can/sja1000/sja1000_of_platform.c | 31 ++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-)
drivers/net/can/sja1000/sja1000_of_platform.c +15 -16
@@ -94,8 +94,8 @@ static int __devinit sja1000_ofp_probe(struct platform_device *ofdev)struct net_device *dev;struct sja1000_priv *priv;struct resource res; -const u32 *prop; -int err, irq, res_size, prop_size; +u32 prop; +int err, irq, res_size;void __iomem *base; err =of_address_to_resource (np,0 , &res);
@@ -136,27 +136,27 @@ static int __devinit sja1000_ofp_probe(struct platform_device *ofdev) priv->read_reg = sja1000_ofp_read_reg; priv->write_reg = sja1000_ofp_write_reg; - prop =of_get_property (np,"nxp,external-clock-frequency" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->can.clock.freq = *prop /2 ; + err =of_property_read_u32 (np,"nxp,external-clock-frequency" , &prop); +if (!err) + priv->can.clock.freq = prop /2 ;else priv->can.clock.freq =SJA1000_OFP_CAN_CLOCK ;/* default */ - prop =of_get_property (np,"nxp,tx-output-mode" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->ocr |= *prop &OCR_MODE_MASK ; + err =of_property_read_u32 (np,"nxp,tx-output-mode" , &prop); +if (!err) + priv->ocr |= prop &OCR_MODE_MASK ;else priv->ocr |=OCR_MODE_NORMAL ;/* default */ - prop =of_get_property (np,"nxp,tx-output-config" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->ocr |= (*prop <<OCR_TX_SHIFT ) &OCR_TX_MASK ; + err =of_property_read_u32 (np,"nxp,tx-output-config" , &prop); +if (!err) + priv->ocr |= (prop <<OCR_TX_SHIFT ) &OCR_TX_MASK ;else priv->ocr |=OCR_TX0_PULLDOWN ;/* default */ - prop =of_get_property (np,"nxp,clock-out-frequency" , &prop_size); -if (prop && (prop_size ==sizeof (u32)) && *prop) { -u32 divider = priv->can.clock.freq *2 / *prop; + err =of_property_read_u32 (np,"nxp,clock-out-frequency" , &prop); +if (!err && prop) { +u32 divider = priv->can.clock.freq *2 / prop;if (divider >1 ) priv->cdr |= divider /2 -1 ;
@@ -166,8 +166,7 @@ static int __devinit sja1000_ofp_probe(struct platform_device *ofdev) priv->cdr |=CDR_CLK_OFF ;/* default */ } - prop =of_get_property (np,"nxp,no-comparator-bypass" ,NULL ); -if (!prop) +if (!of_property_read_bool (np,"nxp,no-comparator-bypass" )) priv->cdr |=CDR_CBP ;/* default */ priv->irq_flags =IRQF_SHARED ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 64/126 hugetlbfs: add swap entry check in follow_hugetlb_page()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Naoya Horiguchi <[email protected]>
[ Upstream commit 9cc3a5bd40067b9a0fbd49199d0780463fc2140f ]
With applying the previous patch "hugetlbfs: stop setting VM_DONTDUMP in initializing vma(VM_HUGETLB)" to reenable hugepage coredump, if a memory error happens on a hugepage and the affected processes try to access the error hugepage, we hit VM_BUG_ON(atomic_read(&page->_count) <= 0) in get_page().
The reason for this bug is that coredump-related code doesn't recognise "hugepage hwpoison entry" with which a pmd entry is replaced when a memory error occurs on a hugepage.
In other words, physical address information is stored in different bit layout between hugepage hwpoison entry and pmd entry, so follow_hugetlb_page() which is called in get_dump_page() returns a wrong page from a given address.
The expected behavior is like this:
absent is_swap_pte FOLL_DUMP Expected behavior
-------------------------------------------------------------------
true false false hugetlb_fault false true false hugetlb_fault false false false return page true false true skip page (to avoid allocation) false true true hugetlb_fault false false true return page
With this patch, we can call hugetlb_fault() and take proper actions (we wait for migration entries, fail with VM_FAULT_HWPOISON_LARGE for hwpoisoned entries,) and as the result we can dump all hugepages except for hwpoisoned ones.
--- mm/hugetlb.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
mm/hugetlb.c +11 -1
@@ -2963,7 +2963,17 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,break ; } -if (absent || +/* +* We need call hugetlb_fault for both hugepages under migration +* (in which case hugetlb_fault waits for the migration,) and +* hwpoisoned hugepages (in which case we need to prevent the +* caller from accessing to them.) In order to do this, we use +* here is_swap_pte instead of is_hugetlb_entry_migration and +* is_hugetlb_entry_hwpoisoned. This is because it simply covers +* both cases, and because we can't follow correct pages +* directly from any kind of swap entries. +*/ +if (absent ||is_swap_pte (huge_ptep_get (pte)) || ((flags &FOLL_WRITE ) && !pte_write (huge_ptep_get (pte)))) {int ret;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 65/126 kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Emese Revfy <[email protected]>
[ Upstream commit b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f ]
This fixes a kernel memory contents leak via the tkill and tgkill syscalls for compat processes.
This is visible in the siginfo_t->_sifields._rt.si_sigval.sival_ptr field when handling signals delivered from tkill.
The place of the infoleak:
int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
{
...
put_user_ex(ptr_to_compat(from->si_ptr), &to->si_ptr);
...
}--- kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/signal.c +1 -1
@@ -2898,7 +2898,7 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info)static int do_tkill (pid_t tgid,pid_t pid,int sig) { -struct siginfo info; +struct siginfo info = {}; info.si_signo = sig; info.si_errno =0 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 66/126 hfsplus: fix potential overflow in hfsplus_file_truncate()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Vyacheslav Dubeyko <[email protected]>
[ Upstream commit 12f267a20aecf8b84a2a9069b9011f1661c779b4 ]
Change a u32 to loff_t hfsplus_file_truncate().
--- fs/hfsplus/extents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/extents.c +1 -1
@@ -517,7 +517,7 @@ void hfsplus_file_truncate(struct inode *inode)struct address_space *mapping = inode->i_mapping;struct page *page;void *fsdata; -u32 size = inode->i_size; +loff_t size = inode->i_size; res = pagecache_write_begin(NULL, mapping, size, 0, AOP_FLAG_UNINTERRUPTIBLE,
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 67/126 KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796)
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Andy Honig <[email protected]>
[ Upstream commit c300aa64ddf57d9c5d9c898a64b36877345dd4a9 ]
If the guest sets the GPA of the time_page so that the request to update the time straddles a page then KVM will write onto an incorrect page. The write is done byusing kmap atomic to get a pointer to the page for the time structure and then performing a memcpy to that page starting at an offset that the guest controls. Well behaved guests always provide a 32-byte aligned address, however a malicious guest could use this to corrupt host kernel memory.
Tested: Tested against kvmclock unit test.
--- arch/x86/kvm/x86.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/kvm/x86.c +5 -0
@@ -1636,6 +1636,11 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)/* ...but clean it before doing the actual write */ vcpu->arch.time_offset = data & ~(PAGE_MASK |1 ); +/* Check that the address is 32-byte aligned. */ +if (vcpu->arch.time_offset & + (sizeof (struct pvclock_vcpu_time_info ) -1 )) +break ; + vcpu->arch.time_page =gfn_to_page (vcpu->kvm, data >>PAGE_SHIFT );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 68/126 KVM: x86: Convert MSR_KVM_SYSTEM_TIME to use gfn_to_hva_cache functions (CVE-2013-1797)
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Andy Honig <[email protected]>
[ Upstream commit 0b79459b482e85cb7426aa7da683a9f2c97aeae1 ]
There is a potential use after free issue with the handling of MSR_KVM_SYSTEM_TIME. If the guest specifies a GPA in a movable or removable memory such as frame buffers then KVM might continue to write to that address even after it's removed via KVM_SET_USER_MEMORY_REGION. KVM pins the page in memory so it's unlikely to cause an issue, but if the user space component re-purposes the memory previously used for the guest, then the guest will be able to corrupt that memory.
Tested: Tested against kvmclock unit test
--- arch/x86/include/asm/kvm_host.h | 4 ++-- arch/x86/kvm/x86.c | 41 ++++++++++++++------------------------- 2 files changed, 17 insertions(+), 28 deletions(-)
arch/x86/include/asm/kvm_host.h +2 -2
@@ -418,8 +418,8 @@ struct kvm_vcpu_arch {gpa_t time;struct pvclock_vcpu_time_info hv_clock;unsigned int hw_tsc_khz; -unsigned int time_offset; -struct page *time_page; +struct gfn_to_hva_cache pv_time; +bool pv_time_enabled;struct {u64 msr_val;
arch/x86/kvm/x86.c +15 -26
93 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 69/126 KVM: Fix bounds checking in ioapic indirect register reads (CVE-2013-1798)
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Andy Honig <[email protected]>
[ Upstream commit a2c118bfab8bc6b8bb213abfc35201e441693d55 ]
If the guest specifies a IOAPIC_REG_SELECT with an invalid value and follows that with a read of the IOAPIC_REG_WINDOW KVM does not properly validate that request. ioapic_read_indirect contains an ASSERT(redir_index < IOAPIC_NUM_PINS), but the ASSERT has no effect in non-debug builds. In recent kernels this allows a guest to cause a kernel oops by reading invalid memory. In older kernels (pre-3.3) this allows a guest to read from large ranges of host memory.
Tested: tested against apic unit tests.
--- virt/kvm/ioapic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
virt/kvm/ioapic.c +5 -2
@@ -73,9 +73,12 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,u32 redir_index = (ioapic->ioregsel -0x10 ) >>1 ;u64 redir_content; -ASSERT (redir_index <IOAPIC_NUM_PINS ); +if (redir_index <IOAPIC_NUM_PINS ) + redir_content = + ioapic->redirtbl[redir_index].bits; +else + redir_content = ~0ULL ; - redir_content = ioapic->redirtbl[redir_index].bits; result = (ioapic->ioregsel &0x1 ) ? (redir_content >>32 ) &0xffffffff : redir_content &0xffffffff ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 70/126 KVM: Allow cross page reads and writes from cached translations.
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Andrew Honig <[email protected]>
[ Upstream commit 8f964525a121f2ff2df948dac908dcc65be21b5b ]
This patch adds support for kvm_gfn_to_hva_cache_init functions for reads and writes that will cross a page. If the range falls within the same memslot, then this will be a fast operation. If the range is split between two memslots, then the slower kvm_read_guest and kvm_write_guest are used.
Tested: Test against kvm_clock unit tests.
--- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/x86.c | 13 ++++++------- include/linux/kvm_host.h | 2 +- include/linux/kvm_types.h | 1 + virt/kvm/kvm_main.c | 47 +++++++++++++++++++++++++++++++++++---------- 5 files changed, 46 insertions(+), 19 deletions(-)
arch/x86/kvm/lapic.c +1 -1
@@ -1574,5 +1574,5 @@ int kvm_lapic_enable_pv_eoi(struct kvm_vcpu *vcpu, u64 data)if (!pv_eoi_enabled (vcpu))return 0 ;return kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.pv_eoi.data, - addr); + addr,sizeof (u8)); }
arch/x86/kvm/x86.c +6 -7
@@ -1510,7 +1510,8 @@ static int kvm_pv_enable_async_pf(struct kvm_vcpu *vcpu, u64 data)return 0 ; } -if (kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.apf.data, gpa)) +if (kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.apf.data, gpa, +sizeof (u32)))return 1 ; vcpu->arch.apf.send_user_only = !(data &KVM_ASYNC_PF_SEND_ALWAYS );
@@ -1627,12 +1628,9 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) gpa_offset = data & ~(PAGE_MASK |1 ); -/* Check that the address is 32-byte aligned. */ -if (gpa_offset & (sizeof (struct pvclock_vcpu_time_info ) -1 )) -break ; -if (kvm_gfn_to_hva_cache_init (vcpu->kvm, - &vcpu->arch.pv_time, data & ~1ULL )) + &vcpu->arch.pv_time, data & ~1ULL , +sizeof (struct pvclock_vcpu_time_info ))) vcpu->arch.pv_time_enabled = false;else vcpu->arch.pv_time_enabled = true;
@@ -1651,7 +1649,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)return 1 ;if (kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.st.stime, - data &KVM_STEAL_VALID_BITS )) + data &KVM_STEAL_VALID_BITS , +sizeof (struct kvm_steal_time )))return 1 ; vcpu->arch.st.msr_val = data;
include/linux/kvm_host.h +1 -1
@@ -456,7 +456,7 @@ int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data,int kvm_write_guest_cached (struct kvm *kvm,struct gfn_to_hva_cache *ghc,void *data,unsigned long len);int kvm_gfn_to_hva_cache_init (struct kvm *kvm,struct gfn_to_hva_cache *ghc, -gpa_t gpa); +gpa_t gpa,unsigned long len);int kvm_clear_guest_page (struct kvm *kvm,gfn_t gfn,int offset,int len);int kvm_clear_guest (struct kvm *kvm,gpa_t gpa,unsigned long len);struct kvm_memory_slot *gfn_to_memslot (struct kvm *kvm,gfn_t gfn);
include/linux/kvm_types.h +1 -0
@@ -71,6 +71,7 @@ struct gfn_to_hva_cache {u64 generation;gpa_t gpa;unsigned long hva; +unsigned long len;struct kvm_memory_slot *memslot; };
virt/kvm/kvm_main.c +37 -10
74 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 71/126 ARM: i.MX35: enable MAX clock
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sascha Hauer <[email protected]>
[ Upstream commit 5dc2eb7da1e387e31ce54f54af580c6a6f512ca6 ]
The i.MX35 has two bits per clock gate which are decoded as follows:
0b00 -> clock off
0b01 -> clock is on in run mode, off in wait/doze
0b10 -> clock is on in run/wait mode, off in doze
0b11 -> clock is always onThe reset value for the MAX clock is 0b10.
The MAX clock is needed by the SoC, yet unused in the Kernel, so the common clock framework will disable it during late init time. It will only disable clocks though which it detects as being turned on. This detection is made depending on the lower bit of the gate. If the reset value has been altered by the bootloader to 0b11 the clock framework will detect the clock as turned on, yet unused, hence it will turn it off and the system locks up.
This patch turns the MAX clock on unconditionally making the Kernel independent of the bootloader.
--- arch/arm/mach-imx/clk-imx35.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-imx/clk-imx35.c +1 -0
@@ -260,6 +260,7 @@ int __init mx35_clocks_init()clk_prepare_enable (clk[gpio3_gate]);clk_prepare_enable (clk[iim_gate]);clk_prepare_enable (clk[emi_gate]); +clk_prepare_enable (clk[max_gate]);/* * SCC is needed to boot via mmc after a watchdog reset. The clock code
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 72/126 ARM: clk-imx35: Bugfix iomux clock
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Markus Pargmann <[email protected]>
[ Upstream commit cab1e0a36c9dd0b0671fb84197ed294513f5adc1 ]
This patch enables iomuxc_gate clock. It is necessary to be able to reconfigure iomux pads. Without this clock enabled, the clk_disable_unused function will disable this clock and the iomux pads are not configurable anymore. This happens at every boot. After a reboot (watchdog system reset) the clock is not enabled again, so all iomux pad reconfigurations in boot code are without effect.
The iomux pads should be always configurable, so this patch always enables it.
--- arch/arm/mach-imx/clk-imx35.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-imx/clk-imx35.c +1 -0
@@ -261,6 +261,7 @@ int __init mx35_clocks_init()clk_prepare_enable (clk[iim_gate]);clk_prepare_enable (clk[emi_gate]);clk_prepare_enable (clk[max_gate]); +clk_prepare_enable (clk[iomuxc_gate]);/* * SCC is needed to boot via mmc after a watchdog reset. The clock code
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 73/126 tg3: Add 57766 device support.
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Matt Carlson <[email protected]>
[ Upstream commit d3f677afb8076d09d090ff0a5d1229c9dd9f136e ]
The patch also adds a couple of fixes
- For the 57766 and non Ax versions of 57765, bootcode needs to setup the PCIE Fast Training Sequence (FTS) value to prevent transmit hangs. Unfortunately, it does not have enough room in the selfboot case (i.e. devices with no NVRAM). The driver needs to implement this.
- For performance reasons, the 2k DMA engine mode on the 57766 should be enabled and dma size limited to 2k for standard sized packets.
--- drivers/net/ethernet/broadcom/tg3.c | 18 +++++++++++++++++- drivers/net/ethernet/broadcom/tg3.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.c +17 -1
@@ -301,6 +301,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = { {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)}, {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5720)}, {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57762)}, + {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57766)}, {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)}, {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)}, {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
@@ -8784,7 +8785,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) }if (GET_CHIP_REV (tp->pci_chip_rev_id) !=CHIPREV_57765_AX ) { -u32 grc_mode =tr32 (GRC_MODE ); +u32 grc_mode; + +/* Fix transmit hangs */ + val =tr32 (TG3_CPMU_PADRNG_CTL ); + val |=TG3_CPMU_PADRNG_CTL_RDIV2 ; +tw32 (TG3_CPMU_PADRNG_CTL , val); + + grc_mode =tr32 (GRC_MODE );/* Access the lower 1K of DL PCIE block registers. */ val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK ;
@@ -9088,6 +9096,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)if (tg3_flag (tp,PCI_EXPRESS )) rdmac_mode |=RDMAC_MODE_FIFO_LONG_BURST ; +if (GET_ASIC_REV (tp->pci_chip_rev_id) ==ASIC_REV_57766 ) { + tp->dma_limit =0 ; +if (tp->dev->mtu <=ETH_DATA_LEN ) { + rdmac_mode |=RDMAC_MODE_JMB_2K_MMRR ; + tp->dma_limit =TG3_TX_BD_DMA_MAX_2K ; + } + } +if (tg3_flag (tp,HW_TSO_1 ) ||tg3_flag (tp,HW_TSO_2 ) ||tg3_flag (tp,HW_TSO_3 ))
drivers/net/ethernet/broadcom/tg3.h +2 -0
@@ -1120,6 +1120,8 @@#define CPMU_MUTEX_GNT_DRIVER 0x00001000#define TG3_CPMU_PHY_STRAP 0x00003664#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 +#define TG3_CPMU_PADRNG_CTL 0x00003668 +#define TG3_CPMU_PADRNG_CTL_RDIV2 0x00040000/* 0x3664 --> 0x36b0 unused */ #define TG3_CPMU_EEE_MODE 0x000036b0
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 74/126 sched: Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
[ Upstream commit 383efcd00053ec40023010ce5034bd702e7ab373 ]
try_to_wake_up_local() should only be invoked to wake up another task in the same runqueue and BUG_ON()s are used to enforce the rule. Missing try_to_wake_up_local() can stall workqueue execution but such stalls are likely to be finite either by another work item being queued or the one blocked getting unblocked. There's no reason to trigger BUG while holding rq lock crashing the whole system.
Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s.
--- kernel/sched/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/sched/core.c +4 -2
@@ -1651,8 +1651,10 @@ static void try_to_wake_up_local(struct task_struct *p) {struct rq *rq =task_rq (p); -BUG_ON (rq !=this_rq ()); -BUG_ON (p == current); +if (WARN_ON_ONCE (rq !=this_rq ()) || +WARN_ON_ONCE (p == current)) +return ; +lockdep_assert_held (&rq->lock);if (!raw_spin_trylock (&p->pi_lock)) {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 75/126 ARM: 7696/1: Fix kexec by setting outer_cache.inv_all for Feroceon
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Illia Ragozin <[email protected]>
[ Upstream commit cd272d1ea71583170e95dde02c76166c7f9017e6 ]
On Feroceon the L2 cache becomes non-coherent with the CPU when the L1 caches are disabled. Thus the L2 needs to be invalidated after both L1 caches are disabled.
On kexec before the starting the code for relocation the kernel, the L1 caches are disabled in cpu_froc_fin (cpu_v7_proc_fin for Feroceon), but after L2 cache is never invalidated, because inv_all is not set in cache-feroceon-l2.c.
So kernel relocation and decompression may has (and usually has) errors. Setting the function enables L2 invalidation and fixes the issue.
--- arch/arm/mm/cache-feroceon-l2.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mm/cache-feroceon-l2.c +1 -0
@@ -343,6 +343,7 @@ void __init feroceon_l2_init(int __l2_wt_override) outer_cache.inv_range = feroceon_l2_inv_range; outer_cache.clean_range = feroceon_l2_clean_range; outer_cache.flush_range = feroceon_l2_flush_range; + outer_cache.inv_all = l2_inv_all;enable_l2 ();
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 76/126 ARM: 7698/1: perf: fix group validation when using enable_on_exec
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
[ Upstream commit cb2d8b342aa084d1f3ac29966245dec9163677fb ]
Events may be created with attr->disabled == 1 and attr->enable_on_exec == 1, which confuses the group validation code because events with the PERF_EVENT_STATE_OFF are not considered candidates for scheduling, which may lead to failure at group scheduling time.
This patch fixes the validation check for ARM, so that events in the OFF state are still considered when enable_on_exec is true.
--- arch/arm/kernel/perf_event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/kernel/perf_event.c +4 -1
@@ -316,7 +316,10 @@ validate_event(struct pmu_hw_events *hw_events,struct hw_perf_event fake_event = event->hw;struct pmu *leader_pmu = event->group_leader->pmu; -if (event->pmu != leader_pmu || event->state <=PERF_EVENT_STATE_OFF ) +if (event->pmu != leader_pmu || event->state <PERF_EVENT_STATE_OFF ) +return 1 ; + +if (event->state ==PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)return 1 ;return armpmu->get_event_idx (hw_events, &fake_event) >=0 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 77/126 ath9k_htc: accept 1.x firmware newer than 1.3
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit 319e7bd96aca64a478f3aad40711c928405b8b77 ]
Since the firmware has been open sourced, the minor version has been bumped to 1.4 and the API/ABI will stay compatible across further 1.x releases.
--- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 -1
@@ -774,7 +774,7 @@ static int ath9k_init_firmware_version(struct ath9k_htc_priv *priv)* required version. */ if (priv->fw_version_major !=MAJOR_VERSION_REQ || - priv->fw_version_minor !=MINOR_VERSION_REQ ) { + priv->fw_version_minor <MINOR_VERSION_REQ ) {dev_err (priv->dev,"ath9k_htc: Please upgrade to FW version %d.%d\n" ,MAJOR_VERSION_REQ ,MINOR_VERSION_REQ );return -EINVAL ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 78/126 ath9k_hw: change AR9580 initvals to fix a stability issue
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit f09a878511997c25a76bf111a32f6b8345a701a5 ]
The hardware parsing of Control Wrapper Frames needs to be disabled, as it has been causing spurious decryption error reports. The initvals for other chips have been updated to disable it, but AR9580 was left out for some reason.
--- drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h +1 -1
@@ -519,7 +519,7 @@ static const u32 ar9580_1p0_mac_core[][2] = { {0x00008258, 0x00000000}, {0x0000825c, 0x40000000}, {0x00008260, 0x00080922}, - {0x00008264, 0x9bc00010}, + {0x00008264, 0x9d400010}, {0x00008268, 0xffffffff}, {0x0000826c, 0x0000ffff}, {0x00008270, 0x00000000},
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 79/126 mac80211: fix cfg80211 interaction on auth/assoc request
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 7b119dc06d871405fc7c3e9a73a6c987409ba639 ]
If authentication (or association with FT) is requested by userspace, mac80211 currently doesn't tell cfg80211 that it disconnected from the AP. That leaves inconsistent state:
cfg80211 thinks it's connected while mac80211 thinks it's not. Typically this won't last long, as soon as mac80211 reports the new association to cfg80211 the old one goes away. If, however, the new authentication or association doesn't succeed, then cfg80211 will forever think the old one still exists and will refuse attempts to authenticate or associate with the AP it thinks it's connected to.
Anders reported that this leads to it taking a very long time to reconnect to a network, or never even succeeding. I tested this with an AP hacked to never respond to auth frames, and one that works, and with just those two the system never recovers because one won't work and cfg80211 thinks it's connected to the other so refuses connections to it.
To fix this, simply make mac80211 tell cfg80211 when it is no longer connected to the old AP, while authenticating or associating to a new one.
--- net/mac80211/mlme.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-)
net/mac80211/mlme.c +20 -4
@@ -3237,8 +3237,16 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,/* prep auth_data so we don't go into idle on disassoc */ ifmgd->auth_data = auth_data; -if (ifmgd->associated) -ieee80211_set_disassoc (sdata,0 ,0 , false,NULL ); +if (ifmgd->associated) { +u8 frame_buf[DEAUTH_DISASSOC_LEN ]; + +ieee80211_set_disassoc (sdata,IEEE80211_STYPE_DEAUTH , +WLAN_REASON_UNSPECIFIED , + false, frame_buf); + +__cfg80211_send_deauth (sdata->dev, frame_buf, +sizeof (frame_buf)); + }sdata_info (sdata,"authenticate with %pM\n" , req->bss->bssid);
@@ -3290,8 +3298,16 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,mutex_lock (&ifmgd->mtx); -if (ifmgd->associated) -ieee80211_set_disassoc (sdata,0 ,0 , false,NULL ); +if (ifmgd->associated) { +u8 frame_buf[DEAUTH_DISASSOC_LEN ]; + +ieee80211_set_disassoc (sdata,IEEE80211_STYPE_DEAUTH , +WLAN_REASON_UNSPECIFIED , + false, frame_buf); + +__cfg80211_send_deauth (sdata->dev, frame_buf, +sizeof (frame_buf)); + }if (ifmgd->auth_data && !ifmgd->auth_data->done) { err = -EBUSY ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 80/126 ssb: implement spurious tone avoidance
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
[ Upstream commit 46fc4c909339f5a84d1679045297d9d2fb596987 ]
And make use of it in b43. This fixes a regression introduced with 49d55cef5b1925a5c1efb6aaddaa40fc7c693335
b43: N-PHY: implement spurious tone avoidance
This commit made BCM4322 use only MCS 0 on channel 13, which of course resulted in performance drop (down to 0.7Mb/s).
--- drivers/net/wireless/b43/phy_n.c | 3 ++- drivers/ssb/driver_chipcommon_pmu.c | 29 +++++++++++++++++++++++++++++ include/linux/ssb/ssb_driver_chipcommon.h | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-)
drivers/net/wireless/b43/phy_n.c +2 -1
@@ -4583,7 +4583,8 @@ static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)#endif #ifdef CONFIG_B43_SSB case B43_BUS_SSB : -/* FIXME */ +ssb_pmu_spuravoid_pllupdate (&dev->dev->sdev->bus->chipco, + avoid);break ;#endif }
drivers/ssb/driver_chipcommon_pmu.c +29 -0
@@ -645,3 +645,32 @@ u32 ssb_pmu_get_controlclock(struct ssb_chipcommon *cc)return 0 ; } } + +void ssb_pmu_spuravoid_pllupdate (struct ssb_chipcommon *cc,int spuravoid) +{ +u32 pmu_ctl =0 ; + +switch (cc->dev->bus->chip_id) { +case 0x4322 : +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL0 ,0x11100070 ); +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL1 ,0x1014140a ); +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL5 ,0x88888854 ); +if (spuravoid ==1 ) +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL2 ,0x05201828 ); +else +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL2 ,0x05001828 ); + pmu_ctl =SSB_CHIPCO_PMU_CTL_PLL_UPD ; +break ; +case 43222 : +/* TODO: BCM43222 requires updating PLLs too */ +return ; +default : + ssb_printk(KERN_ERR PFX +"Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n" , + cc->dev->bus->chip_id); +return ; + } + +chipco_set32 (cc,SSB_CHIPCO_PMU_CTL , pmu_ctl); +} +EXPORT_SYMBOL_GPL (ssb_pmu_spuravoid_pllupdate);
include/linux/ssb/ssb_driver_chipcommon.h +2 -0
@@ -219,6 +219,7 @@#define SSB_CHIPCO_PMU_CTL 0x0600/* PMU control */ #define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000/* ILP div mask */ #define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16 +#define SSB_CHIPCO_PMU_CTL_PLL_UPD 0x00000400#define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200/* No ILP on wait */ #define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100/* HT req enable */ #define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080/* ALP req enable */
@@ -661,5 +662,6 @@ enum ssb_pmu_ldo_volt_id {void ssb_pmu_set_ldo_voltage (struct ssb_chipcommon *cc,enum ssb_pmu_ldo_volt_id id,u32 voltage);void ssb_pmu_set_ldo_paref (struct ssb_chipcommon *cc,bool on); +void ssb_pmu_spuravoid_pllupdate (struct ssb_chipcommon *cc,int spuravoid);#endif /* LINUX_SSB_CHIPCO_H_ */
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 81/126 crypto: algif - suppress sending source address information in recvmsg
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 72a763d805a48ac8c0bf48fdb510e84c12de51fe ]
The current code does not set the msg_namelen member to 0 and therefore makes net/socket.c leak the local sockaddr_storage variable to userland -- 128 bytes of kernel stack memory. Fix that.
--- crypto/algif_hash.c | 2 ++ crypto/algif_skcipher.c | 1 + 2 files changed, 3 insertions(+)
crypto/algif_hash.c +2 -0
@@ -161,6 +161,8 @@ static int hash_recvmsg(struct kiocb *unused, struct socket *sock,else if (len < ds) msg->msg_flags |=MSG_TRUNC ; + msg->msg_namelen =0 ; +lock_sock (sk);if (ctx->more) { ctx->more =0 ;
crypto/algif_skcipher.c +1 -0
@@ -432,6 +432,7 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock,long copied =0 ;lock_sock (sk); + msg->msg_namelen =0 ;for (iov = msg->msg_iov, iovlen = msg->msg_iovlen; iovlen >0 ; iovlen--, iov++) {unsigned long seglen = iov->iov_len;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 82/126 perf: Treat attr.config as u64 in perf_swevent_init()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Tommi Rantala <[email protected]>
[ Upstream commit 8176cced706b5e5d15887584150764894e94e02f ]
Trinity discovered that we fail to check all 64 bits of attr.config passed by user space, resulting to out-of-bounds access of the perf_swevent_enabled array in sw_perf_event_destroy().
Introduced in commit b0a873ebb ("perf: Register PMU implementations").
--- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
@@ -5131,7 +5131,7 @@ static void sw_perf_event_destroy(struct perf_event *event)static int perf_swevent_init (struct perf_event *event) { -int event_id = event->attr.config; +u64 event_id = event->attr.config;if (event->attr.type !=PERF_TYPE_SOFTWARE )return -ENOENT ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 83/126 perf/x86: Fix offcore_rsp valid mask for SNB/IVB
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Stephane Eranian <[email protected]>
[ Upstream commit f1923820c447e986a9da0fc6bf60c1dccdf0408e ]
The valid mask for both offcore_response_0 andoffcore_response_1 was wrong for SNB/SNB-EP,
IVB/IVB-EP. It was possible to write to
reserved bit and cause a GP fault crashing
the kernel.
This patch fixes the problem by correctly marking the reserved bits in the valid mask for all the processors mentioned above.
A distinction between desktop and server parts is introduced because bits 24-30 are only available on the server parts.
This version of the patch is just a rebase to perf/urgent tree and should apply to older kernels as well.
--- arch/x86/kernel/cpu/perf_event_intel.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/perf_event_intel.c +16 -4
@@ -128,8 +128,14 @@ static struct event_constraint intel_gen_event_constraints[] __read_mostly = };static struct extra_reg intel_snb_extra_regs[]__read_mostly = { -INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3fffffffffull ,RSP_0 ), -INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3fffffffffull ,RSP_1 ), +INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3f807f8fffull ,RSP_0 ), +INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3f807f8fffull ,RSP_1 ), +EVENT_EXTRA_END +}; + +static struct extra_reg intel_snbep_extra_regs[]__read_mostly = { +INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3fffff8fffull ,RSP_0 ), +INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3fffff8fffull ,RSP_1 ),EVENT_EXTRA_END };
@@ -2058,7 +2064,10 @@ __init int intel_pmu_init(void) x86_pmu.event_constraints = intel_snb_event_constraints; x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints; x86_pmu.pebs_aliases = intel_pebs_aliases_snb; - x86_pmu.extra_regs = intel_snb_extra_regs; +if (boot_cpu_data.x86_model ==45 ) + x86_pmu.extra_regs = intel_snbep_extra_regs; +else + x86_pmu.extra_regs = intel_snb_extra_regs;/* all extra regs are per-cpu when HT is on */ x86_pmu.er_flags |=ERF_HAS_RSP_1 ; x86_pmu.er_flags |=ERF_NO_HT_SHARING ;
@@ -2083,7 +2092,10 @@ __init int intel_pmu_init(void) x86_pmu.event_constraints = intel_snb_event_constraints; x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints; x86_pmu.pebs_aliases = intel_pebs_aliases_snb; - x86_pmu.extra_regs = intel_snb_extra_regs; +if (boot_cpu_data.x86_model ==62 ) + x86_pmu.extra_regs = intel_snbep_extra_regs; +else + x86_pmu.extra_regs = intel_snb_extra_regs;/* all extra regs are per-cpu when HT is on */ x86_pmu.er_flags |=ERF_HAS_RSP_1 ; x86_pmu.er_flags |=ERF_NO_HT_SHARING ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 84/126 vm: add vm_iomap_memory() helper function
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit b4cbb197c7e7a68dbad0d491242e3ca67420c13e ]
Various drivers end up replicating the code to mmap() their memory buffers into user space, and our core memory remapping function may be very flexible but it is unnecessarily complicated for the common cases to use.
Our internal VM uses pfn's ("page frame numbers") which simplifies things for the VM, and allows us to pass physical addresses around in a denser and more efficient format than passing a "phys_addr_t" around, and having to shift it up and down by the page size. But it just means that drivers end up doing that shifting instead at the interface level.
It also means that drivers end up mucking around with internal VM things like the vma details (vm_pgoff, vm_start/end) way more than they really need to.
So this just exports a function to map a certain physical memory range into user space (using a phys_addr_t based interface that is much more natural for a driver) and hides all the complexity from the driver. Some drivers will still end up tweaking the vm_page_prot details for things like prefetching or cacheability etc, but that's actually relevant to the driver, rather than caring about what the page offset of the mapping is into the particular IO memory region.
--- include/linux/mm.h | 2 ++ mm/memory.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+)
include/linux/mm.h +2 -0
@@ -1534,6 +1534,8 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn);int vm_insert_mixed (struct vm_area_struct *vma,unsigned long addr,unsigned long pfn); +int vm_iomap_memory (struct vm_area_struct *vma,phys_addr_t start,unsigned long len); +struct page *follow_page (struct vm_area_struct *,unsigned long address,unsigned int foll_flags);
mm/memory.c +47 -0
53 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 85/126 vm: convert snd_pcm_lib_mmap_iomem() to vm_iomap_memory() helper
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 0fe09a45c4848b5b5607b968d959fdc1821c161d ]
This is my example conversion of a few existing mmap users. The pcm mmap case is one of the more straightforward ones.
--- sound/core/pcm_native.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
sound/core/pcm_native.c +2 -10
@@ -3219,18 +3219,10 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap);int snd_pcm_lib_mmap_iomem (struct snd_pcm_substream *substream,struct vm_area_struct *area) { -long size; -unsigned long offset; +struct snd_pcm_runtime *runtime = substream->runtime;; area->vm_page_prot =pgprot_noncached (area->vm_page_prot); - area->vm_flags |=VM_IO ; - size = area->vm_end - area->vm_start; - offset = area->vm_pgoff <<PAGE_SHIFT ; -if (io_remap_pfn_range (area, area->vm_start, - (substream->runtime->dma_addr + offset) >>PAGE_SHIFT , - size, area->vm_page_prot)) -return -EAGAIN ; -return 0 ; +return vm_iomap_memory (area, runtime->dma_addr, runtime->dma_bytes); }EXPORT_SYMBOL (snd_pcm_lib_mmap_iomem);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 86/126 vm: convert fb_mmap to vm_iomap_memory() helper
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit fc9bbca8f650e5f738af8806317c0a041a48ae4a ]
This is my example conversion of a few existing mmap users. The fb_mmap() case is a good example because it is a bit more complicated than some: fb_mmap() mmaps one of two different memory areas depending on the page offset of the mmap (but happily there is never any mixing of the two, so the helper function still works).
--- drivers/video/fbmem.c | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-)
drivers/video/fbmem.c +14 -26
@@ -1371,15 +1371,12 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) {struct fb_info *info =file_fb_info (file);struct fb_ops *fb; -unsigned long off; +unsigned long mmio_pgoff;unsigned long start;u32 len;if (!info)return -ENODEV ; -if (vma->vm_pgoff > (~0UL >>PAGE_SHIFT )) -return -EINVAL ; - off = vma->vm_pgoff <<PAGE_SHIFT ; fb = info->fbops;if (!fb)return -ENODEV ;
@@ -1391,33 +1388,24 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)return res; } -/* frame buffer memory */ +/* +* Ugh. This can be either the frame buffer mapping, or +* if pgoff points past it, the mmio mapping. +*/ start = info->fix.smem_start; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + info->fix.smem_len); -if (off >= len) { -/* memory mapped io */ - off -= len; -if (info->var.accel_flags) { -mutex_unlock (&info->mm_lock); -return -EINVAL ; - } + len = info->fix.smem_len; + mmio_pgoff =PAGE_ALIGN ((start & ~PAGE_MASK ) + len) >>PAGE_SHIFT ; +if (vma->vm_pgoff >= mmio_pgoff) { + vma->vm_pgoff -= mmio_pgoff; start = info->fix.mmio_start; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + info->fix.mmio_len); + len = info->fix.mmio_len; }mutex_unlock (&info->mm_lock); - start &=PAGE_MASK ; -if ((vma->vm_end - vma->vm_start + off) > len) -return -EINVAL ; - off += start; - vma->vm_pgoff = off >>PAGE_SHIFT ; -/* This is an IO map - tell maydump to skip this VMA */ - vma->vm_flags |=VM_IO |VM_RESERVED ; + vma->vm_page_prot =vm_get_page_prot (vma->vm_flags); -fb_pgprotect (file, vma, off); -if (io_remap_pfn_range (vma, vma->vm_start, off >>PAGE_SHIFT , - vma->vm_end - vma->vm_start, vma->vm_page_prot)) -return -EAGAIN ; -return 0 ; +fb_pgprotect (file, vma, start); + +return vm_iomap_memory (vma, start, len); } static int
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 87/126 vm: convert HPET mmap to vm_iomap_memory() helper
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 2323036dfec8ce3ce6e1c86a49a31b039f3300d1 ]
This is my example conversion of a few existing mmap users. The HPET case is simple, widely available, and easy to test (Clemens Ladisch sent a trivial test-program for it).
--- drivers/char/hpet.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/char/hpet.c +1 -13
@@ -373,26 +373,14 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma)struct hpet_dev *devp;unsigned long addr; -if (((vma->vm_end - vma->vm_start) !=PAGE_SIZE ) || vma->vm_pgoff) -return -EINVAL ; - devp = file->private_data; addr = devp->hd_hpets->hp_hpet_phys;if (addr & (PAGE_SIZE -1 ))return -ENOSYS ; - vma->vm_flags |=VM_IO ; vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); - -if (io_remap_pfn_range (vma, vma->vm_start, addr >>PAGE_SHIFT , -PAGE_SIZE , vma->vm_page_prot)) { -printk (KERN_ERR "%s: io_remap_pfn_range failed\n" , - __func__); -return -EAGAIN ; - } - -return 0 ; +return vm_iomap_memory (vma, addr,PAGE_SIZE );#else return -ENOSYS ;#endif
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 88/126 mtd: Disable mtdchar mmap on MMU systems
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
[ Upstream commit f5cf8f07423b2677cebebcebc863af77223a4972 ]
This code was broken because it assumed that all MTD devices were map-based. Disable it for now, until it can be fixed properly for the next merge window.
--- drivers/mtd/mtdchar.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mtd/mtdchar.c +5 -1
@@ -1162,7 +1162,11 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma)resource_size_t start, off;unsigned long len, vma_len; -if (mtd->type ==MTD_RAM || mtd->type ==MTD_ROM ) { +/* This is broken because it assumes the MTD device is map-based +and that mtd->priv is a valid struct map_info. It should be +replaced with something that uses the mtd_get_unmapped_area() +operation properly. */ +if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/ ) { off =get_vm_offset (vma); start = map->phys; len =PAGE_ALIGN ((start & ~PAGE_MASK ) + map->size);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 89/126 vm: convert mtdchar mmap to vm_iomap_memory() helper
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 8558e4a26b00225efeb085725bc319f91201b239 ]
This is my example conversion of a few existing mmap users. The mtdchar case is actually disabled right now (and stays disabled), but I did it because it showed up on my "git grep", and I was familiar with the code due to fixing an overflow problem in the code in commit 9c603e53d380 ("mtdchar: fix offset overflow detection").
--- drivers/mtd/mtdchar.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-)
drivers/mtd/mtdchar.c +2 -30
@@ -1159,45 +1159,17 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma)struct mtd_file_info *mfi = file->private_data;struct mtd_info *mtd = mfi->mtd;struct map_info *map = mtd->priv; -resource_size_t start, off; -unsigned long len, vma_len;/* This is broken because it assumes the MTD device is map-based and that mtd->priv is a valid struct map_info. It should be replaced with something that uses the mtd_get_unmapped_area() operation properly. */ if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/ ) { - off =get_vm_offset (vma); - start = map->phys; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + map->size); - start &=PAGE_MASK ; - vma_len =get_vm_size (vma); - -/* Overflow in off+len? */ -if (vma_len + off < off) -return -EINVAL ; -/* Does it fit in the mapping? */ -if (vma_len + off > len) -return -EINVAL ; - - off += start; -/* Did that overflow? */ -if (off < start) -return -EINVAL ; -if (set_vm_offset (vma, off) <0 ) -return -EINVAL ; - vma->vm_flags |=VM_IO |VM_RESERVED ; -#ifdef pgprot_noncached -if (file->f_flags &O_DSYNC || off >=__pa (high_memory)) +if (file->f_flags &O_DSYNC || map->phys >=__pa (high_memory)) vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot);#endif -if (io_remap_pfn_range (vma, vma->vm_start, off >>PAGE_SHIFT , - vma->vm_end - vma->vm_start, - vma->vm_page_prot)) -return -EAGAIN ; - -return 0 ; +return vm_iomap_memory (vma, map->phys, map->size); }return -ENOSYS ;#else
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 90/126 Btrfs: make sure nbytes are right after log replay
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit 4bc4bee4595662d8bff92180d5c32e3313a704b0 ]
While trying to track down a tree log replay bug I noticed that fsck was always complaining about nbytes not being right for our fsynced file. That is because the new fsync stuff doesn't wait for ordered extents to complete, so the inodes nbytes are not necessarily updated properly when we log it. So to fix this we need to set nbytes to whatever it is on the inode that is on disk, so when we replay the extents we can just add the bytes that are being added as we replay the extent. This makes it work for the case that we have the wrong nbytes or the case that we logged everything and nbytes is actually correct. With this I'm no longer getting nbytes errors out of btrfsck.
--- fs/btrfs/tree-log.c | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-)
fs/btrfs/tree-log.c +42 -6
@@ -315,6 +315,7 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans,unsigned long src_ptr;unsigned long dst_ptr;int overwrite_root =0 ; +bool inode_item = key->type ==BTRFS_INODE_ITEM_KEY ;if (root->root_key.objectid !=BTRFS_TREE_LOG_OBJECTID ) overwrite_root =1 ;
@@ -324,6 +325,9 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans,/* look for the key in the destination tree */ ret =btrfs_search_slot (NULL , root, key, path,0 ,0 ); +if (ret <0 ) +return ret; +if (ret ==0 ) {char *src_copy;char *dst_copy;
@@ -365,6 +369,30 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans,return 0 ; } +/* +* We need to load the old nbytes into the inode so when we +* replay the extents we've logged we get the right nbytes. +*/ +if (inode_item) { +struct btrfs_inode_item *item; +u64 nbytes; + + item =btrfs_item_ptr (path->nodes[0 ], path->slots[0 ], + struct btrfs_inode_item); + nbytes =btrfs_inode_nbytes (path->nodes[0 ], item); + item =btrfs_item_ptr (eb, slot, + struct btrfs_inode_item); +btrfs_set_inode_nbytes (eb, item, nbytes); + } + }else if (inode_item) { +struct btrfs_inode_item *item; + +/* +* New inode, set nbytes to 0 so that the nbytes comes out +* properly when we replay the extents. +*/ + item = btrfs_item_ptr(eb, slot, struct btrfs_inode_item); +btrfs_set_inode_nbytes (eb, item,0 ); } insert:btrfs_release_path (path);
@@ -486,7 +514,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,u64 extent_end;u64 alloc_hint;u64 start = key->offset; -u64 saved_nbytes; +u64 nbytes =0 ;struct btrfs_file_extent_item *item;struct inode *inode =NULL ;unsigned long size;
@@ -496,10 +524,19 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, found_type =btrfs_file_extent_type (eb, item);if (found_type ==BTRFS_FILE_EXTENT_REG || - found_type ==BTRFS_FILE_EXTENT_PREALLOC ) - extent_end = start +btrfs_file_extent_num_bytes (eb, item); -else if (found_type ==BTRFS_FILE_EXTENT_INLINE ) { + found_type ==BTRFS_FILE_EXTENT_PREALLOC ) { + nbytes =btrfs_file_extent_num_bytes (eb, item); + extent_end = start + nbytes; + +/* +* We don't add to the inodes nbytes if we are prealloc or a +* hole. +*/ +if (btrfs_file_extent_disk_bytenr (eb, item) ==0 ) + nbytes =0 ; + }else if (found_type ==BTRFS_FILE_EXTENT_INLINE ) { size =btrfs_file_extent_inline_len (eb, item); + nbytes =btrfs_file_extent_ram_bytes (eb, item); extent_end = (start + size + mask) & ~mask; }else { ret =0 ;
@@ -548,7 +585,6 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, }btrfs_release_path (path); - saved_nbytes =inode_get_bytes (inode);/* drop any overlapping extents */ ret =btrfs_drop_extents (trans, inode, start, extent_end, &alloc_hint,1 );
@@ -636,7 +672,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,BUG_ON (ret); } -inode_set_bytes (inode, saved_nbytes); +inode_add_bytes (inode, nbytes); ret =btrfs_update_inode (trans, root, inode); out:if (inode)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 91/126 Add file_ns_capable() helper function for open-time capability checking
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 935d8aabd4331f47a89c3e1daa5779d23cf244ee ]
Nothing is using it yet, but this will allow us to delay the open-time checks to use time, without breaking the normal UNIX permission semantics where permissions are determined by the opener (and the file descriptor can then be passed to a different process, or the process can drop capabilities).
--- include/linux/capability.h | 2 ++ kernel/capability.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+)
include/linux/capability.h +2 -0
@@ -377,6 +377,7 @@ struct cpu_vfs_cap_data {#ifdef __KERNEL__ +struct file ;struct inode ;struct dentry ;struct user_namespace ;
@@ -553,6 +554,7 @@ extern bool capable(int cap);extern bool ns_capable (struct user_namespace *ns,int cap);extern bool nsown_capable (int cap);extern bool inode_capable (const struct inode *inode,int cap); +extern bool file_ns_capable (const struct file *file,struct user_namespace *ns,int cap);/* audit system wants to get cap info from files as well */ extern int get_vfs_caps_from_disk (const struct dentry *dentry,struct cpu_vfs_cap_data *cpu_caps);
kernel/capability.c +24 -0
@@ -393,6 +393,30 @@ bool ns_capable(struct user_namespace *ns, int cap)EXPORT_SYMBOL (ns_capable);/** +* file_ns_capable - Determine if the file's opener had a capability in effect +* @file: The file we want to check +* @ns: The usernamespace we want the capability in +* @cap: The capability to be tested for +* +* Return true if task that opened the file had a capability in effect +* when the file was opened. +* +* This does not set PF_SUPERPRIV because the caller may not +* actually be privileged. +*/ +bool file_ns_capable (const struct file *file,struct user_namespace *ns,int cap) +{ +if (WARN_ON_ONCE (!cap_valid (cap))) +return false; + +if (security_capable (file->f_cred, ns, cap) ==0 ) +return true; + +return false; +} +EXPORT_SYMBOL (file_ns_capable); + +/** * capable - Determine if the current task has a superior capability in effect * @cap: The capability to be tested for *
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 92/126 aio: fix possible invalid memory access when DEBUG is enabled
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Zhao Hongjiang <[email protected]>
[ Upstream commit 91d80a84bbc8f28375cca7e65ec666577b4209ad ]
dprintk() shouldn't access @ring after it's unmapped.
--- fs/aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/aio.c +1 -1
@@ -1027,9 +1027,9 @@ static int aio_read_evt(struct kioctx *ioctx, struct io_event *ent)spin_unlock (&info->ring_lock); out: -kunmap_atomic (ring);dprintk ("leaving aio_read_evt: %d h%lu t%lu\n" , ret, (unsigned long )ring->head, (unsigned long )ring->tail); +kunmap_atomic (ring);return ret; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 93/126 TTY: do not update atime/mtime on read/write
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jiri Slaby <[email protected]>
[ Upstream commit b0de59b5733d18b0d1974a060860a8b5c1b36a2e ]
On http://vladz.devzero.fr/013_ptmx-timing.php, we can see how to find out length of a password using timestamps of /dev/ptmx. It is documented in "Timing Analysis of Keystrokes and Timing Attacks on SSH". To avoid that problem, do not update time when reading from/writing to a TTY.
I am afraid of regressions as this is a behavior we have since 0.97 and apps may expect the time to be current, e.g. for monitoring whether there was a change on the TTY. Now, there is no change. So this would better have a lot of testing before it goes upstream.
References: CVE-2013-0160
--- drivers/tty/tty_io.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/tty/tty_io.c +2 -6
@@ -975,8 +975,7 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,else i = -EIO ;tty_ldisc_deref (ld); -if (i >0 ) - inode->i_atime =current_fs_time (inode->i_sb); +return i; }
@@ -1077,11 +1076,8 @@ static inline ssize_t do_tty_write(break ;cond_resched (); } -if (written) { -struct inode *inode = file->f_path.dentry->d_inode; - inode->i_mtime =current_fs_time (inode->i_sb); +if (written) ret = written; - } out:tty_write_unlock (tty);return ret;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 94/126 TTY: fix atime/mtime regression
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Jiri Slaby <[email protected]>
[ Upstream commit 37b7f3c76595e23257f61bd80b223de8658617ee ]
In commit b0de59b5733d ("TTY: do not update atime/mtime on read/write") we removed timestamps from tty inodes to fix a security issue and waited if something breaks. Well, 'w', the utility to find out logged users and their inactivity time broke. It shows that users are inactive since the time they logged in.
To revert to the old behaviour while still preventing attackers to guess the password length, we update the timestamps in one-minute intervals by this patch.
--- drivers/tty/tty_io.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/tty/tty_io.c +15 -1
@@ -939,6 +939,14 @@ void start_tty(struct tty_struct *tty)EXPORT_SYMBOL (start_tty); +static void tty_update_time (struct timespec *time) +{ +unsigned long sec =get_seconds (); + sec -= sec %60 ; +if ((long )(sec - time->tv_sec) >0 ) + time->tv_sec = sec; +} +/** * tty_read - read method for tty device files * @file: pointer to tty file
@@ -976,6 +984,9 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count, i = -EIO ;tty_ldisc_deref (ld); +if (i >0 ) +tty_update_time (&inode->i_atime); +return i; }
@@ -1076,8 +1087,11 @@ static inline ssize_t do_tty_write(break ;cond_resched (); } -if (written) +if (written) { +struct inode *inode = file->f_path.dentry->d_inode; +tty_update_time (&inode->i_mtime); ret = written; + } out:tty_write_unlock (tty);return ret;
Signature · 1 line
1.7.10.4
Re: [094/126] TTY: fix atime/mtime regression
Quoted 8 lines · Steven Rostedt
3.6.11.3 stable review patch.
If anyone has any objections, please let me know.------------------
From: Jiri Slaby <[email protected]>
[ Upstream commit
37b7f3c76595e23257f61bd80b223de8658617ee]
Hi, you also want this one:
commit b0b885657b6c8ef63a46bc9299b2a7715d19acde
Author: Linus Torvalds <[email protected]> Date: Wed May 1 07:32:21 2013 -0700
tty: fix up atime/mtime mess, take three
regards,
Signature · 2 lines
js suse labs
Steven Rostedt
maintainerRe: [094/126] TTY: fix atime/mtime regression
Quoted 8 lines · Jiri Slaby
Quoted 7 lines · Steven Rostedt
3.6.11.3 stable review patch.
If anyone has any objections, please let me know.------------------
From: Jiri Slaby <[email protected]>
Quoted 9 lines
Quoted 1 line
[ Upstream commit
37b7f3c76595e23257f61bd80b223de8658617ee]Hi, you also want this one:
commitb0b885657b6c8ef63a46bc9299b2a7715d19acdeAuthor: Linus Torvalds <[email protected]> Date: Wed May 1 07:32:21 2013 -0700tty: fix up atime/mtime mess, take three
Heh, thanks. I may add it. I'm usually behind Greg's releases by one. I'm sure he's adding this to his 3.9.1 series, and I haven't pulled his stuff in. I've based this off of 3.8.11.
I may just leave this out and pull it in on 3.6.11.4 when I use the 3.9 series.
But thanks for letting me know. I haven't totally decided yet.
-- Steve
Steven Rostedt
maintainerPATCH 95/126 atm: update msg_namelen in vcc_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 9b3e617f3df53822345a8573b6d358f6b9e5ed87 ]
The current code does not fill the msg_name member in case it is set. It also does not set the msg_namelen member to 0 and therefore makes net/socket.c leak the local, uninitialized sockaddr_storage variable to userland -- 128 bytes of kernel stack memory.
Fix that by simply setting msg_namelen to 0 as obviously nobody cared about vcc_recvmsg() not filling the msg_name in case it was set.
--- net/atm/common.c | 2 ++ 1 file changed, 2 insertions(+)
net/atm/common.c +2 -0
@@ -520,6 +520,8 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,struct sk_buff *skb;int copied, error = -EINVAL ; + msg->msg_namelen =0 ; +if (sock->state !=SS_CONNECTED )return -ENOTCONN ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 96/126 ax25: fix info leak via msg_name in ax25_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit ef3313e84acbf349caecae942ab3ab731471f1a1 ]
When msg_namelen is non-zero the sockaddr info gets filled out, as requested, but the code fails to initialize the padding bytes of struct sockaddr_ax25 inserted by the compiler for alignment. Additionally the msg_namelen value is updated to sizeof(struct full_sockaddr_ax25) but is not always filled up to this size.
Both issues lead to the fact that the code will leak uninitialized kernel stack bytes in net/socket.c.
Fix both issues by initializing the memory with memset(0).
--- net/ax25/af_ax25.c | 1 + 1 file changed, 1 insertion(+)
net/ax25/af_ax25.c +1 -0
@@ -1647,6 +1647,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,ax25_address src;const unsigned char *mac =skb_mac_header (skb); +memset (sax,0 ,sizeof (struct full_sockaddr_ax25 ));ax25_addr_parse (mac +1 , skb->data - mac -1 , &src,NULL , &digi,NULL ,NULL ); sax->sax25_family =AF_AX25 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 97/126 Bluetooth: fix possible info leak in bt_sock_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 4683f42fde3977bdb4e8a09622788cc8b5313778 ]
In case the socket is already shutting down, bt_sock_recvmsg() returns with 0 without updating msg_namelen leading to net/socket.c leaking the local, uninitialized sockaddr_storage variable to userland -- 128 bytes of kernel stack memory.
Fix this by moving the msg_namelen assignment in front of the shutdown test.
--- net/bluetooth/af_bluetooth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/bluetooth/af_bluetooth.c +2 -2
@@ -229,6 +229,8 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,if (flags & (MSG_OOB ))return -EOPNOTSUPP ; + msg->msg_namelen =0 ; + skb =skb_recv_datagram (sk, flags, noblock, &err);if (!skb) {if (sk->sk_shutdown &RCV_SHUTDOWN )
@@ -236,8 +238,6 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,return err; } - msg->msg_namelen =0 ; - copied = skb->len;if (len < copied) { msg->msg_flags |=MSG_TRUNC ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 98/126 Bluetooth: RFCOMM - Fix missing msg_namelen update in rfcomm_sock_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit e11e0455c0d7d3d62276a0c55d9dfbc16779d691 ]
If RFCOMM_DEFER_SETUP is set in the flags, rfcomm_sock_recvmsg() returns early with 0 without updating the possibly set msg_namelen member. This, in turn, leads to a 128 byte kernel stack leak in net/socket.c.
Fix this by updating msg_namelen in this case. For all other cases it will be handled in bt_sock_stream_recvmsg().
--- net/bluetooth/rfcomm/sock.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/rfcomm/sock.c +1 -0
@@ -610,6 +610,7 @@ static int rfcomm_sock_recvmsg(struct kiocb *iocb, struct socket *sock,if (test_and_clear_bit (RFCOMM_DEFER_SETUP , &d->flags)) {rfcomm_dlc_accept (d); + msg->msg_namelen =0 ;return 0 ; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 99/126 caif: Fix missing msg_namelen update in caif_seqpkt_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 2d6fbfe733f35c6b355c216644e08e149c61b271 ]
The current code does not fill the msg_name member in case it is set. It also does not set the msg_namelen member to 0 and therefore makes net/socket.c leak the local, uninitialized sockaddr_storage variable to userland -- 128 bytes of kernel stack memory.
Fix that by simply setting msg_namelen to 0 as obviously nobody cared about caif_seqpkt_recvmsg() not filling the msg_name in case it was set.
--- net/caif/caif_socket.c | 2 ++ 1 file changed, 2 insertions(+)
net/caif/caif_socket.c +2 -0
@@ -286,6 +286,8 @@ static int caif_seqpkt_recvmsg(struct kiocb *iocb, struct socket *sock,if (m->msg_flags&MSG_OOB ) goto read_error; + m->msg_namelen =0 ; + skb =skb_recv_datagram (sk, flags,0 , &ret);if (!skb) goto read_error;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 100/126 irda: Fix missing msg_namelen update in irda_recvmsg_dgram()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 5ae94c0d2f0bed41d6718be743985d61b7f5c47d ]
The current code does not fill the msg_name member in case it is set. It also does not set the msg_namelen member to 0 and therefore makes net/socket.c leak the local, uninitialized sockaddr_storage variable to userland -- 128 bytes of kernel stack memory.
Fix that by simply setting msg_namelen to 0 as obviously nobody cared about irda_recvmsg_dgram() not filling the msg_name in case it was set.
--- net/irda/af_irda.c | 2 ++ 1 file changed, 2 insertions(+)
net/irda/af_irda.c +2 -0
@@ -1386,6 +1386,8 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,IRDA_DEBUG (4 ,"%s()\n" , __func__); + msg->msg_namelen =0 ; + skb =skb_recv_datagram (sk, flags & ~MSG_DONTWAIT , flags &MSG_DONTWAIT , &err);if (!skb)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 101/126 iucv: Fix missing msg_namelen update in iucv_sock_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit a5598bd9c087dc0efc250a5221e5d0e6f584ee88 ]
The current code does not fill the msg_name member in case it is set. It also does not set the msg_namelen member to 0 and therefore makes net/socket.c leak the local, uninitialized sockaddr_storage variable to userland -- 128 bytes of kernel stack memory.
Fix that by simply setting msg_namelen to 0 as obviously nobody cared about iucv_sock_recvmsg() not filling the msg_name in case it was set.
--- net/iucv/af_iucv.c | 2 ++ 1 file changed, 2 insertions(+)
net/iucv/af_iucv.c +2 -0
@@ -1331,6 +1331,8 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,struct sk_buff *skb, *rskb, *cskb;int err =0 ; + msg->msg_namelen =0 ; + if ((sk->sk_state == IUCV_DISCONN) && skb_queue_empty(&iucv->backlog_skb_q) && skb_queue_empty(&sk->sk_receive_queue) &&
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 102/126 l2tp: fix info leak in l2tp_ip6_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit b860d3cc62877fad02863e2a08efff69a19382d2 ]
The L2TP code for IPv6 fails to initialize the l2tp_conn_id member of struct sockaddr_l2tpip6 and therefore leaks four bytes kernel stack in l2tp_ip6_recvmsg() in case msg_name is set.
Initialize l2tp_conn_id with 0 to avoid the info leak.
--- net/l2tp/l2tp_ip6.c | 1 + 1 file changed, 1 insertion(+)
net/l2tp/l2tp_ip6.c +1 -0
@@ -684,6 +684,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, lsa->l2tp_addr =ipv6_hdr (skb)->saddr; lsa->l2tp_flowinfo =0 ; lsa->l2tp_scope_id =0 ; + lsa->l2tp_conn_id =0 ;if (ipv6_addr_type (&lsa->l2tp_addr) &IPV6_ADDR_LINKLOCAL ) lsa->l2tp_scope_id =IP6CB (skb)->iif; }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 103/126 llc: Fix missing msg_namelen update in llc_ui_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit c77a4b9cffb6215a15196ec499490d116dfad181 ]
For stream sockets the code misses to update the msg_namelen member to 0 and therefore makes net/socket.c leak the local, uninitialized sockaddr_storage variable to userland -- 128 bytes of kernel stack memory. The msg_namelen update is also missing for datagram sockets in case the socket is shutting down during receive.
Fix both issues by setting msg_namelen to 0 early. It will be updated later if we're going to fill the msg_name member.
--- net/llc/af_llc.c | 2 ++ 1 file changed, 2 insertions(+)
net/llc/af_llc.c +2 -0
@@ -720,6 +720,8 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,int target;/* Read at least this many bytes */ long timeo; + msg->msg_namelen =0 ; +lock_sock (sk); copied = -ENOTCONN ;if (unlikely (sk->sk_type ==SOCK_STREAM && sk->sk_state ==TCP_LISTEN ))
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 104/126 netrom: fix info leak via msg_name in nr_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 3ce5efad47b62c57a4f5c54248347085a750ce0e ]
In case msg_name is set the sockaddr info gets filled out, as requested, but the code fails to initialize the padding bytes of struct sockaddr_ax25 inserted by the compiler for alignment. Also the sax25_ndigis member does not get assigned, leaking four more bytes.
Both issues lead to the fact that the code will leak uninitialized kernel stack bytes in net/socket.c.
Fix both issues by initializing the memory with memset(0).
--- net/netrom/af_netrom.c | 1 + 1 file changed, 1 insertion(+)
net/netrom/af_netrom.c +1 -0
@@ -1177,6 +1177,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, }if (sax !=NULL ) { +memset (sax,0 ,sizeof (sax)); sax->sax25_family =AF_NETROM ;skb_copy_from_linear_data_offset (skb,7 , sax->sax25_call.ax25_call,AX25_ADDR_LEN );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 105/126 netrom: fix invalid use of sizeof in nr_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
[ Upstream commit c802d759623acbd6e1ee9fbdabae89159a513913 ]
sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data.
Introduced by commit 3ce5ef(netrom: fix info leak via msg_name in nr_recvmsg)
--- net/netrom/af_netrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netrom/af_netrom.c +1 -1
@@ -1177,7 +1177,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, }if (sax !=NULL ) { -memset (sax,0 ,sizeof (sax)); +memset (sax,0 ,sizeof (*sax)); sax->sax25_family =AF_NETROM ;skb_copy_from_linear_data_offset (skb,7 , sax->sax25_call.ax25_call,AX25_ADDR_LEN );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 106/126 NFC: llcp: fix info leaks via msg_name in llcp_sock_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit d26d6504f23e803824e8ebd14e52d4fc0a0b09cb ]
The code in llcp_sock_recvmsg() does not initialize all the members of struct sockaddr_nfc_llcp when filling the sockaddr info. Nor does it initialize the padding bytes of the structure inserted by the compiler for alignment.
Also, if the socket is in state LLCP_CLOSED or is shutting down during receive the msg_namelen member is not updated to 0 while otherwise returning with 0, i.e. "success". The msg_namelen update is also missing for stream and seqpacket sockets which don't fill the sockaddr info.
Both issues lead to the fact that the code will leak uninitialized kernel stack bytes in net/socket.c.
Fix the first issue by initializing the memory used for sockaddr info with memset(0). Fix the second one by setting msg_namelen to 0 early. It will be updated later if we're going to fill the msg_name member.
--- net/nfc/llcp/sock.c | 2 ++ 1 file changed, 2 insertions(+)
net/nfc/llcp/sock.c +2 -0
@@ -579,6 +579,8 @@ static int llcp_sock_recvmsg(struct kiocb *iocb, struct socket *sock,pr_debug ("%p %zu\n" , sk, len); + msg->msg_namelen =0 ; +lock_sock (sk); if (sk->sk_state == LLCP_CLOSED &&
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 107/126 rose: fix info leak via msg_name in rose_recvmsg()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 4a184233f21645cf0b719366210ed445d1024d72 ]
The code in rose_recvmsg() does not initialize all of the members of struct sockaddr_rose/full_sockaddr_rose when filling the sockaddr info. Nor does it initialize the padding bytes of the structure inserted by the compiler for alignment. This will lead to leaking uninitialized kernel stack bytes in net/socket.c.
Fix the issue by initializing the memory used for sockaddr info with memset(0).
--- net/rose/af_rose.c | 1 + 1 file changed, 1 insertion(+)
net/rose/af_rose.c +1 -0
@@ -1257,6 +1257,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,skb_copy_datagram_iovec (skb,0 , msg->msg_iov, copied);if (srose !=NULL ) { +memset (srose,0 , msg->msg_namelen); srose->srose_family =AF_ROSE ; srose->srose_addr = rose->dest_addr; srose->srose_call = rose->dest_call;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 108/126 tipc: fix info leaks via msg_name in recv_msg/recv_stream
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mathias Krause <[email protected]>
[ Upstream commit 60085c3d009b0df252547adb336d1ccca5ce52ec ]
The code in set_orig_addr() does not initialize all of the members of struct sockaddr_tipc when filling the sockaddr info -- namely the union is only partly filled. This will make recv_msg() and recv_stream() -- the only users of this function -- leak kernel stack memory as the msg_name member is a local variable in net/socket.c.
Additionally to that both recv_msg() and recv_stream() fail to update the msg_namelen member to 0 while otherwise returning with 0, i.e. "success". This is the case for, e.g., non-blocking sockets. This will lead to a 128 byte kernel stack leak in net/socket.c.
Fix the first issue by initializing the memory of the union with memset(0). Fix the second one by setting msg_namelen to 0 early as it will be updated later if we're going to fill the msg_name member.
--- net/tipc/socket.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/tipc/socket.c +7 -0
@@ -802,6 +802,7 @@ static void set_orig_addr(struct msghdr *m, struct tipc_msg *msg)if (addr) { addr->family =AF_TIPC ; addr->addrtype =TIPC_ADDR_ID ; +memset (&addr->addr,0 ,sizeof (addr->addr)); addr->addr.id.ref =msg_origport (msg); addr->addr.id.node =msg_orignode (msg); addr->addr.name.domain =0 ;/* could leave uninitialized */
@@ -916,6 +917,9 @@ static int recv_msg(struct kiocb *iocb, struct socket *sock, goto exit; } +/* will be updated in set_orig_addr() if needed */ + m->msg_namelen =0 ; + timeout =sock_rcvtimeo (sk, flags &MSG_DONTWAIT ); restart:
@@ -1032,6 +1036,9 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock, goto exit; } +/* will be updated in set_orig_addr() if needed */ + m->msg_namelen =0 ; + target =sock_rcvlowat (sk, flags &MSG_WAITALL , buf_len); timeout =sock_rcvtimeo (sk, flags &MSG_DONTWAIT );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 109/126 cbq: incorrect processing of high limits
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Vasily Averin <[email protected]>
[ Upstream commit f0f6ee1f70c4eaab9d52cf7d255df4bd89f8d1c2 ]
currently cbq works incorrectly for limits > 10% real link bandwidth, and practically does not work for limits > 50% real link bandwidth. Below are results of experiments taken on 1 Gbit link
In shaper | Actual Result
-----------+---------------
100M | 108 Mbps 200M | 244 Mbps 300M | 412 Mbps 500M | 893 Mbps
This happen because of q->now changes incorrectly in cbq_dequeue():
when it is called before real end of packet transmitting, L2T is greater than real time delay, q_now gets an extra boost but never compensate it.
To fix this problem we prevent change of q->now until its synchronization with real time.
--- net/sched/sch_cbq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/sched/sch_cbq.c +4 -1
@@ -963,8 +963,11 @@ cbq_dequeue(struct Qdisc *sch)cbq_update (q);if ((incr -= incr2) <0 ) incr =0 ; + q->now += incr; + }else { +if (now > q->now) + q->now = now; } - q->now += incr; q->now_rt = now;for (;;) {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 110/126 net IPv6 : Fix broken IPv6 routing table after loopback down-up
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Balakumaran Kannan <[email protected]>
[ Upstream commit 25fb6ca4ed9cad72f14f61629b68dc03c0d9713f ]
IPv6 Routing table becomes broken once we do ifdown, ifup of the loopback(lo) interface. After down-up, routes of other interface's IPv6 addresses through 'lo' are lost.
IPv6 addresses assigned to all interfaces are routed through 'lo' for internal communication. Once 'lo' is down, those routing entries are removed from routing table. But those removed entries are not being re-created properly when 'lo' is brought up. So IPv6 addresses of other interfaces becomes unreachable from the same machine. Also this breaks communication with other machines because of NDISC packet processing failure.
This patch fixes this issue by reading all interface's IPv6 addresses and adding them to IPv6 routing table while bringing up 'lo'.
==Testing==
Before applying the patch:
$ route -A inet6 Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If 2000::20/128 :: U 256 0 0 eth0 fe80::/64 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo ::1/128 :: Un 0 1 0 lo 2000::20/128 :: Un 0 1 0 lo fe80::xxxx:xxxx:xxxx:xxxx/128 :: Un 0 1 0 lo ff00::/8 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo $ sudo ifdown lo $ sudo ifup lo $ route -A inet6 Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If 2000::20/128 :: U 256 0 0 eth0 fe80::/64 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo ::1/128 :: Un 0 1 0 lo ff00::/8 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo $
After applying the patch:
$ route -A inet6 Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If 2000::20/128 :: U 256 0 0 eth0 fe80::/64 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo ::1/128 :: Un 0 1 0 lo 2000::20/128 :: Un 0 1 0 lo fe80::xxxx:xxxx:xxxx:xxxx/128 :: Un 0 1 0 lo ff00::/8 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo $ sudo ifdown lo $ sudo ifup lo $ route -A inet6 Kernel IPv6 routing table Destination Next Hop Flag Met Ref Use If 2000::20/128 :: U 256 0 0 eth0 fe80::/64 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo ::1/128 :: Un 0 1 0 lo 2000::20/128 :: Un 0 1 0 lo fe80::xxxx:xxxx:xxxx:xxxx/128 :: Un 0 1 0 lo ff00::/8 :: U 256 0 0 eth0 ::/0 :: !n -1 1 1 lo $
--- net/ipv6/addrconf.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
net/ipv6/addrconf.c +27 -0
@@ -2397,6 +2397,9 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)static void init_loopback (struct net_device *dev) {struct inet6_dev *idev; +struct net_device *sp_dev; +struct inet6_ifaddr *sp_ifa; +struct rt6_info *sp_rt;/* ::1 */
@@ -2408,6 +2411,30 @@ static void init_loopback(struct net_device *dev) }add_addr (idev, &in6addr_loopback,128 ,IFA_HOST ); + +/* Add routes to other interface's IPv6 addresses */ +for_each_netdev (dev_net (dev), sp_dev) { +if (!strcmp (sp_dev->name, dev->name)) +continue ; + + idev =__in6_dev_get (sp_dev); +if (!idev) +continue ; + +read_lock_bh (&idev->lock); +list_for_each_entry (sp_ifa, &idev->addr_list, if_list) { + +if (sp_ifa->flags & (IFA_F_DADFAILED |IFA_F_TENTATIVE )) +continue ; + + sp_rt =addrconf_dst_alloc (idev, &sp_ifa->addr,0 ); + +/* Failure cases are ignored */ +if (!IS_ERR (sp_rt)) +ip6_ins_rt (sp_rt); + } +read_unlock_bh (&idev->lock); + } }static void addrconf_add_linklocal (struct inet6_dev *idev,const struct in6_addr *addr)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 111/126 net: count hw_addr syncs so that unsync works properly.
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Vlad Yasevich <[email protected]>
[ Upstream commit 4543fbefe6e06a9e40d9f2b28d688393a299f079 ]
A few drivers use dev_uc_sync/unsync to synchronize the address lists from master down to slave/lower devices. In some cases (bond/team) a single address list is synched down to multiple devices. At the time of unsync, we have a leak in these lower devices, because "synced" is treated as a boolean and the address will not be unsynced for anything after the first device/call.
Treat "synced" as a count (same as refcount) and allow all unsync calls to work.
--- include/linux/netdevice.h | 2 +- net/core/dev_addr_lists.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
include/linux/netdevice.h +1 -1
@@ -233,9 +233,9 @@ struct netdev_hw_addr {#define NETDEV_HW_ADDR_T_SLAVE 3#define NETDEV_HW_ADDR_T_UNICAST 4#define NETDEV_HW_ADDR_T_MULTICAST 5 -bool synced;bool global_use;int refcount; +int synced;struct rcu_head rcu_head; };
net/core/dev_addr_lists.c +3 -3
@@ -38,7 +38,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list, ha->type = addr_type; ha->refcount =1 ; ha->global_use = global; - ha->synced = false; + ha->synced =0 ;list_add_tail_rcu (&ha->list, &list->list); list->count++;
@@ -164,7 +164,7 @@ int __hw_addr_sync(struct netdev_hw_addr_list *to_list, addr_len, ha->type);if (err)break ; - ha->synced = true; + ha->synced++; ha->refcount++; }else if (ha->refcount ==1 ) {__hw_addr_del (to_list, ha->addr, addr_len, ha->type);
@@ -185,7 +185,7 @@ void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,if (ha->synced) {__hw_addr_del (to_list, ha->addr, addr_len, ha->type); - ha->synced = false; + ha->synced--;__hw_addr_del (from_list, ha->addr, addr_len, ha->type); }
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 112/126 atl1e: limit gso segment size to prevent generation of wrong ip length fields
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Hannes Frederic Sowa <[email protected]>
[ Upstream commit 31d1670e73f4911fe401273a8f576edc9c2b5fea ]
The limit of 0x3c00 is taken from the windows driver.
--- drivers/net/ethernet/atheros/atl1e/atl1e.h | 2 +- drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/atheros/atl1e/atl1e.h +1 -1
@@ -186,7 +186,7 @@ struct atl1e_tpd_desc {/* how about 0x2000 */ #define MAX_TX_BUF_LEN 0x2000#define MAX_TX_BUF_SHIFT 13 -/*#define MAX_TX_BUF_LEN 0x3000 */ +#define MAX_TSO_SEG_SIZE 0x3c00/* rrs word 1 bit 0:31 */ #define RRS_RX_CSUM_MASK 0xFFFF
drivers/net/ethernet/atheros/atl1e/atl1e_main.c +1 -0
@@ -2333,6 +2333,7 @@ static int __devinit atl1e_probe(struct pci_dev *pdev,INIT_WORK (&adapter->reset_task, atl1e_reset_task);INIT_WORK (&adapter->link_chg_task, atl1e_link_chg_task); +netif_set_gso_max_size (netdev,MAX_TSO_SEG_SIZE ); err =register_netdev (netdev);if (err) {netdev_err (netdev,"register netdevice failed\n" );
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 113/126 bonding: fix bonding_masters race condition in bond unloading
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "[email protected]" <[email protected]>
[ Upstream commit 69b0216ac255f523556fa3d4ff030d857eaaa37f ]
While the bonding module is unloading, it is considered that after rtnl_link_unregister all bond devices are destroyed but since no synchronization mechanism exists, a new bond device can be created via bonding_masters before unregister_pernet_subsys which would lead to multiple problems (e.g. NULL pointer dereference, wrong RIP, list corruption).
This patch fixes the issue by removing any bond devices left in the netns after bonding_masters is removed from sysfs.
--- drivers/net/bonding/bond_main.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/bonding/bond_main.c +9 -0
@@ -4876,9 +4876,18 @@ static int __net_init bond_net_init(struct net *net) static void __net_exit bond_net_exit(struct net *net) {struct bond_net *bn =net_generic (net, bond_net_id); +struct bonding *bond, *tmp_bond; +LIST_HEAD (list);bond_destroy_sysfs (bn);bond_destroy_proc_dir (bn); + +/* Kill off any bonds created after unregistering bond rtnl ops */ +rtnl_lock (); +list_for_each_entry_safe (bond, tmp_bond, &bn->dev_list, bond_list) +unregister_netdevice_queue (bond->dev, &list); +unregister_netdevice_many (&list); +rtnl_unlock (); }static struct pernet_operations bond_net_ops = {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 114/126 bonding: IFF_BONDING is not stripped on enslave failure
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "[email protected]" <[email protected]>
[ Upstream commit b6a5a7b9a528a8b4c8bec940b607c5dd9102b8cc ]
While enslaving a new device and after IFF_BONDING flag is set, in case of failure it is not stripped from the device's priv_flags while cleaning up, which could lead to other problems.
Cleaning at err_close because the flag is set after dev_open().
v2: no change
--- drivers/net/bonding/bond_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/bonding/bond_main.c +1 -0
@@ -1893,6 +1893,7 @@ err_detach:write_unlock_bh (&bond->lock); err_close: + slave_dev->priv_flags &= ~IFF_BONDING ;dev_close (slave_dev); err_unset_master:
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 115/126 af_unix: If we dont care about credentials coallesce all messages
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Eric W. Biederman" <[email protected]>
[ Upstream commit 0e82e7f6dfeec1013339612f74abc2cdd29d43d2 ]
It was reported that the following LSB test case failed
https://lsbbugs.linuxfoundation.org/attachment.cgi?id=2144 because we were not coallescing unix stream messages when the application was expecting us to.
The problem was that the first send was before the socket was accepted and thus sock->sk_socket was NULL in maybe_add_creds, and the second send after the socket was accepted had a non-NULL value for sk->socket and thus we could tell the credentials were not needed so we did not bother.
The unnecessary credentials on the first message cause unix_stream_recvmsg to start verifying that all messages had the same credentials before coallescing and then the coallescing failed because the second message had no credentials.
Ignoring credentials when we don't care in unix_stream_recvmsg fixes a long standing pessimization which would fail to coallesce messages when reading from a unix stream socket if the senders were different even if we did not care about their credentials.
I have tested this and verified that the in the LSB test case mentioned above that the messages do coallesce now, while the were failing to coallesce without this change.
--- net/unix/af_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/af_unix.c +1 -1
@@ -1998,7 +1998,7 @@ again:if ((UNIXCB (skb).pid != siocb->scm->pid) || (UNIXCB (skb).cred != siocb->scm->cred))break ; - }else { + }else if (test_bit (SOCK_PASSCRED , &sock->flags)) {/* Copy credentials */ scm_set_cred (siocb->scm,UNIXCB (skb).pid,UNIXCB (skb).cred); check_creds =1 ;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 116/126 ipv6/tcp: Stop processing ICMPv6 redirect messages
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Christoph Paasch <[email protected]>
[ Upstream commit 50a75a8914539c5dcd441c5f54d237a666a426fd ]
Tetja Rediske found that if the host receives an ICMPv6 redirect message after sending a SYN+ACK, the connection will be reset.
He bisected it down to 093d04d (ipv6: Change skb->data before using icmpv6_notify() to propagate redirect), but the origin of the bug comes from ec18d9a26 (ipv6: Add redirect support to all protocol icmp error handlers.). The bug simply did not trigger prior to 093d04d, because skb->data did not point to the inner IP header and thus icmpv6_notify did not call the correct err_handler.
This patch adds the missing "goto out;" in tcp_v6_err. After receiving an ICMPv6 Redirect, we should not continue processing the ICMP in tcp_v6_err, as this may trigger the removal of request-socks or setting sk_err(_soft).
--- net/ipv6/tcp_ipv6.c | 1 + 1 file changed, 1 insertion(+)
net/ipv6/tcp_ipv6.c +1 -0
@@ -397,6 +397,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,if (dst) dst->ops->redirect (dst, sk, skb); + goto out; }if (type ==ICMPV6_PKT_TOOBIG ) {
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 117/126 rtnetlink: Call nlmsg_parse() with correct header length
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Michael Riesch <[email protected]>
[ Upstream commit 88c5b5ce5cb57af6ca2a7cf4d5715fa320448ff9 ]
--- net/core/rtnetlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/rtnetlink.c +2 -2
@@ -1068,7 +1068,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)rcu_read_lock (); cb->seq = net->dev_base_seq; -if (nlmsg_parse (cb->nlh,sizeof (struct rtgenmsg ), tb,IFLA_MAX , +if (nlmsg_parse (cb->nlh,sizeof (struct ifinfomsg ), tb,IFLA_MAX , ifla_policy) >=0 ) {if (tb[IFLA_EXT_MASK ])
@@ -1918,7 +1918,7 @@ static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)u32 ext_filter_mask =0 ;u16 min_ifinfo_dump_size =0 ; -if (nlmsg_parse (nlh,sizeof (struct rtgenmsg ), tb,IFLA_MAX , +if (nlmsg_parse (nlh,sizeof (struct ifinfomsg ), tb,IFLA_MAX , ifla_policy) >=0 ) {if (tb[IFLA_EXT_MASK ]) ext_filter_mask =nla_get_u32 (tb[IFLA_EXT_MASK ]);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 118/126 tcp: incoming connections might use wrong route under synflood
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Dmitry Popov <[email protected]>
[ Upstream commit d66954a066158781ccf9c13c91d0316970fe57b6 ]
There is a bug in cookie_v4_check (net/ipv4/syncookies.c):
flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE, IPPROTO_TCP, inet_sk_flowi_flags(sk), (opt && opt->srr) ? opt->faddr : ireq->rmt_addr, ireq->loc_addr, th->source, th->dest);
Here we do not respect sk->sk_bound_dev_if, therefore wrong dst_entry may be taken. This dst_entry is used by new socket (get_cookie_sock -> tcp_v4_syn_recv_sock), so its packets may take the wrong path.
--- net/ipv4/syncookies.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/syncookies.c +2 -2
@@ -347,8 +347,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,* hasn't changed since we received the original syn, but I see * no easy way to do this. */ -flowi4_init_output (&fl4,0 , sk->sk_mark,RT_CONN_FLAGS (sk), -RT_SCOPE_UNIVERSE ,IPPROTO_TCP , +flowi4_init_output (&fl4, sk->sk_bound_dev_if, sk->sk_mark, +RT_CONN_FLAGS (sk),RT_SCOPE_UNIVERSE ,IPPROTO_TCP ,inet_sk_flowi_flags (sk), (opt && opt->srr) ? opt->faddr : ireq->rmt_addr, ireq->loc_addr, th->source, th->dest);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 119/126 tcp: Reallocate headroom if it would overflow csum_start
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Thomas Graf <[email protected]>
[ Upstream commit 50bceae9bd3569d56744882f3012734d48a1d413 ]
If a TCP retransmission gets partially ACKed and collapsed multiple times it is possible for the headroom to grow beyond 64K which will overflow the 16bit skb->csum_start which is based on the start of the headroom. It has been observed rarely in the wild with IPoIB due to the 64K MTU.
Verify if the acking and collapsing resulted in a headroom exceeding what csum_start can cover and reallocate the headroom if so.
A big thank you to Jim Foraker <[email protected]> and the team at LLNL for helping out with the investigation and testing.
--- net/ipv4/tcp_output.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/ipv4/tcp_output.c +6 -2
@@ -2380,8 +2380,12 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)*/ TCP_SKB_CB (skb)->when = tcp_time_stamp; -/* make sure skb->data is aligned on arches that require it */ -if (unlikely (NET_IP_ALIGN && ((unsigned long )skb->data &3 ))) { +/* make sure skb->data is aligned on arches that require it +* and check if ack-trimming & collapsing extended the headroom +* beyond what csum_start can cover. +*/ +if (unlikely ((NET_IP_ALIGN && ((unsigned long )skb->data &3 )) || +skb_headroom (skb) >=0xFFFF )) {struct sk_buff *nskb =__pskb_copy (skb,MAX_TCP_HEADER ,GFP_ATOMIC ); err = nskb ? tcp_transmit_skb(sk, nskb, 0, GFP_ATOMIC) :
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 120/126 esp4: fix error return code in esp_output()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
[ Upstream commit 06848c10f720cbc20e3b784c0df24930b7304b93 ]
Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function.
--- net/ipv4/esp4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/ipv4/esp4.c +3 -3
@@ -139,8 +139,6 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)/* skb is pure payload to encrypt */ - err = -ENOMEM ; - esp = x->data; aead = esp->aead; alen =crypto_aead_authsize (aead);
@@ -176,8 +174,10 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) } tmp =esp_alloc_tmp (aead, nfrags + sglists, seqhilen); -if (!tmp) +if (!tmp) { + err = -ENOMEM ; goto error; + } seqhi =esp_tmp_seqhi (tmp); iv =esp_tmp_iv (aead, tmp, seqhilen);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 121/126 tcp: call tcp_replace_ts_recent() from tcp_ack()
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 12fb3dd9dc3c64ba7d64cec977cca9b5fb7b1d4e ]
commit bd090dfc634d (tcp: tcp_replace_ts_recent() should not be called from tcp_validate_incoming()) introduced a TS ecr bug in slow path processing.
1 A > B P. 1:10001(10000) ack 1 <nop,nop,TS val 1001 ecr 200> 2 B < A . 1:1(0) ack 1 win 257 <sack 9001:10001,TS val 300 ecr 1001> 3 A > B . 1:1001(1000) ack 1 win 227 <nop,nop,TS val 1002 ecr 200> 4 A > B . 1001:2001(1000) ack 1 win 227 <nop,nop,TS val 1002 ecr 200>
(ecr 200 should be ecr 300 in packets 3 & 4)
Problem is tcp_ack() can trigger send of new packets (retransmits), reflecting the prior TSval, instead of the TSval contained in the currently processed incoming packet.
Fix this by calling tcp_replace_ts_recent() from tcp_ack() after the checks, but before the actions.
--- net/ipv4/tcp_input.c | 65 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 33 deletions(-)
net/ipv4/tcp_input.c +32 -33
@@ -116,6 +116,7 @@ int sysctl_tcp_early_retrans __read_mostly = 2;#define FLAG_DSACKING_ACK 0x800/* SACK blocks contained D-SACK info */ #define FLAG_NONHEAD_RETRANS_ACKED 0x1000/* Non-head rexmitted data was ACKed */ #define FLAG_SACK_RENEGING 0x2000/* snd_una advanced to a sacked seq */ +#define FLAG_UPDATE_TS_RECENT 0x4000/* tcp_replace_ts_recent() */ #define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED)#define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
@@ -3599,6 +3600,27 @@ static void tcp_send_challenge_ack(struct sock *sk) } } +static void tcp_store_ts_recent (struct tcp_sock *tp) +{ + tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval; + tp->rx_opt.ts_recent_stamp =get_seconds (); +} + +static void tcp_replace_ts_recent (struct tcp_sock *tp,u32 seq) +{ +if (tp->rx_opt.saw_tstamp && !after (seq, tp->rcv_wup)) { +/* PAWS bug workaround wrt. ACK frames, the PAWS discard +* extra check below makes sure this can only happen +* for pure ACK frames. -DaveM +* +* Not only, also it occurs for expired timestamps. +*/ + +if (tcp_paws_check (&tp->rx_opt,0 )) +tcp_store_ts_recent (tp); + } +} +/* This routine deals with incoming acks, but not outgoing ones. */ static int tcp_ack (struct sock *sk,const struct sk_buff *skb,int flag) {
@@ -3651,6 +3673,12 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) prior_fackets = tp->fackets_out; prior_in_flight =tcp_packets_in_flight (tp); +/* ts_recent update must be made after we are sure that the packet +* is in window. +*/ +if (flag &FLAG_UPDATE_TS_RECENT ) +tcp_replace_ts_recent (tp,TCP_SKB_CB (skb)->seq); +if (!(flag &FLAG_SLOWPATH ) &&after (ack, prior_snd_una)) {/* Window is constant, pure forward advance. * No more checks are required.
@@ -3967,27 +3995,6 @@ const u8 *tcp_parse_md5sig_option(const struct tcphdr *th)EXPORT_SYMBOL (tcp_parse_md5sig_option);#endif -static inline void tcp_store_ts_recent (struct tcp_sock *tp) -{ - tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval; - tp->rx_opt.ts_recent_stamp =get_seconds (); -} - -static inline void tcp_replace_ts_recent (struct tcp_sock *tp,u32 seq) -{ -if (tp->rx_opt.saw_tstamp && !after (seq, tp->rcv_wup)) { -/* PAWS bug workaround wrt. ACK frames, the PAWS discard -* extra check below makes sure this can only happen -* for pure ACK frames. -DaveM -* -* Not only, also it occurs for expired timestamps. -*/ - -if (tcp_paws_check (&tp->rx_opt,0 )) -tcp_store_ts_recent (tp); - } -} -/* Sorry, PAWS as specified is broken wrt. pure-ACKs -DaveM * * It is not fatal. If this ACK does _not_ change critical state (seqs, window)
@@ -5580,14 +5587,10 @@ slow_path:return 0 ; step5: -if (th->ack &&tcp_ack (sk, skb,FLAG_SLOWPATH ) <0 ) +if (th->ack && +tcp_ack (sk, skb,FLAG_SLOWPATH |FLAG_UPDATE_TS_RECENT ) <0 ) goto discard; -/* ts_recent update must be made after we are sure that the packet -* is in window. -*/ -tcp_replace_ts_recent (tp,TCP_SKB_CB (skb)->seq); -tcp_rcv_rtt_measure_ts (sk, skb);/* Process urgent data. */
@@ -6002,7 +6005,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,/* step 5: check the ACK field */ if (th->ack) { -int acceptable =tcp_ack (sk, skb,FLAG_SLOWPATH ) >0 ; +int acceptable =tcp_ack (sk, skb,FLAG_SLOWPATH | +FLAG_UPDATE_TS_RECENT ) >0 ;switch (sk->sk_state) {case TCP_SYN_RECV :
@@ -6114,11 +6118,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, }else goto discard; -/* ts_recent update must be made after we are sure that the packet -* is in window. -*/ -tcp_replace_ts_recent (tp,TCP_SKB_CB (skb)->seq); -/* step 6: check the URG bit */ tcp_urg (sk, skb, th);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 122/126 net: rate-limit warn-bad-offload splats.
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Ben Greear <[email protected]>
[ Upstream commit c846ad9b880ece01bb4d8d07ba917734edf0324f ]
If one does do something unfortunate and allow a bad offload bug into the kernel, this the skb_warn_bad_offload can effectively live-lock the system, filling the logs with the same error over and over.
Add rate limitation to this so that box remains otherwise functional in this case.
--- net/core/dev.c | 3 +++ 1 file changed, 3 insertions(+)
net/core/dev.c +3 -0
@@ -1907,6 +1907,9 @@ static void skb_warn_bad_offload(const struct sk_buff *skb)struct net_device *dev = skb->dev;const char *driver ="" ; +if (!net_ratelimit ()) +return ; +if (dev && dev->dev.parent) driver =dev_driver_string (dev->dev.parent);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 123/126 net: fix incorrect credentials passing
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
[ Upstream commit 83f1b4ba917db5dc5a061a44b3403ddb6e783494 ]
Commit 257b5358b32f ("scm: Capture the full credentials of the scm sender") changed the credentials passing code to pass in the effective uid/gid instead of the real uid/gid.
Obviously this doesn't matter most of the time (since normally they are the same), but it results in differences for suid binaries when the wrong uid/gid ends up being used.
This just undoes that (presumably unintentional) part of the commit.
--- include/linux/socket.h | 3 ++- include/net/scm.h | 2 +- net/core/sock.c | 14 ++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-)
include/linux/socket.h +2 -1
@@ -317,7 +317,8 @@ struct ucred {/* IPX options */ #define IPX_TYPE 1 -extern void cred_to_ucred (struct pid *pid,const struct cred *cred,struct ucred *ucred); +extern void cred_to_ucred (struct pid *pid,const struct cred *cred,struct ucred *ucred, +bool use_effective);extern int memcpy_fromiovec (unsigned char *kdata,struct iovec *iov,int len); extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
include/net/scm.h +1 -1
@@ -49,7 +49,7 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm, { scm->pid =get_pid (pid); scm->cred = cred ?get_cred (cred) :NULL ; -cred_to_ucred (pid, cred, &scm->creds); +cred_to_ucred (pid, cred, &scm->creds, false); }static __inline__void scm_destroy_cred (struct scm_cookie *scm)
net/core/sock.c +10 -4
@@ -862,15 +862,20 @@ EXPORT_SYMBOL(sock_setsockopt);void cred_to_ucred (struct pid *pid,const struct cred *cred, -struct ucred *ucred) +struct ucred *ucred,bool use_effective) { ucred->pid =pid_vnr (pid); ucred->uid = ucred->gid =-1 ;if (cred) {struct user_namespace *current_ns =current_user_ns (); - ucred->uid =from_kuid (current_ns, cred->euid); - ucred->gid =from_kgid (current_ns, cred->egid); +if (use_effective) { + ucred->uid =from_kuid (current_ns, cred->euid); + ucred->gid =from_kgid (current_ns, cred->egid); + }else { + ucred->uid =from_kuid (current_ns, cred->uid); + ucred->gid =from_kgid (current_ns, cred->gid); + } } }EXPORT_SYMBOL_GPL (cred_to_ucred);
@@ -1031,7 +1036,8 @@ int sock_getsockopt(struct socket *sock, int level, int optname,struct ucred peercred;if (len >sizeof (peercred)) len =sizeof (peercred); -cred_to_ucred (sk->sk_peer_pid, sk->sk_peer_cred, &peercred); +cred_to_ucred (sk->sk_peer_pid, sk->sk_peer_cred, + &peercred, true);if (copy_to_user (optval, &peercred, len))return -EFAULT ; goto lenout;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 124/126 net: drop dst before queueing fragments
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 97599dc792b45b1669c3cdb9a4b365aad0232f65 ]
Commit 4a94445c9a5c (net: Use ip_route_input_noref() in input path) added a bug in IP defragmentation handling, as non refcounted dst could escape an RCU protected section.
Commit 64f3b9e203bd068 (net: ip_expire() must revalidate route) fixed the case of timeouts, but not the general problem.
Tom Parkin noticed crashes in UDP stack and provided a patch, but further analysis permitted us to pinpoint the root cause.
Before queueing a packet into a frag list, we must drop its dst, as this dst has limited lifetime (RCU protected)
When/if a packet is finally reassembled, we use the dst of the very last skb, still protected by RCU and valid, as the dst of the reassembled packet.
Use same logic in IPv6, as there is no need to hold dst references.
--- net/ipv4/ip_fragment.c | 15 +++++++++++---- net/ipv6/reassembly.c | 13 +++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-)
net/ipv4/ip_fragment.c +11 -4
@@ -255,8 +255,7 @@ static void ip_expire(unsigned long arg)if (!head->dev) goto out_rcu_unlock; -/* skb dst is stale, drop it, and perform route lookup again */ -skb_dst_drop (head); +/* skb has no dst, perform route lookup again */ iph =ip_hdr (head); err =ip_route_input_noref (head, iph->daddr, iph->saddr, iph->tos, head->dev);
@@ -521,8 +520,16 @@ found: qp->q.last_in |=INET_FRAG_FIRST_IN ;if (qp->q.last_in == (INET_FRAG_FIRST_IN |INET_FRAG_LAST_IN ) && - qp->q.meat == qp->q.len) -return ip_frag_reasm (qp, prev, dev); + qp->q.meat == qp->q.len) { +unsigned long orefdst = skb->_skb_refdst; + + skb->_skb_refdst =0UL ; + err =ip_frag_reasm (qp, prev, dev); + skb->_skb_refdst = orefdst; +return err; + } + +skb_dst_drop (skb);write_lock (&ip4_frags.lock);list_move_tail (&qp->q.lru_list, &qp->q.net->lru_list);
net/ipv6/reassembly.c +11 -2
@@ -386,8 +386,17 @@ found: }if (fq->q.last_in == (INET_FRAG_FIRST_IN |INET_FRAG_LAST_IN ) && - fq->q.meat == fq->q.len) -return ip6_frag_reasm (fq, prev, dev); + fq->q.meat == fq->q.len) { +int res; +unsigned long orefdst = skb->_skb_refdst; + + skb->_skb_refdst =0UL ; + res =ip6_frag_reasm (fq, prev, dev); + skb->_skb_refdst = orefdst; +return res; + } + +skb_dst_drop (skb);write_lock (&ip6_frags.lock);list_move_tail (&fq->q.lru_list, &fq->q.net->lru_list);
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 125/126 ARM: 7699/1: sched_clock: Add more notrace to prevent recursion
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
[ Upstream commit cea15092f098b7018e89f64a5a14bb71955965d5 ]
cyc_to_sched_clock() is called by sched_clock() and cyc_to_ns() is called by cyc_to_sched_clock(). I suspect that some compilers inline both of these functions into sched_clock() and so we've been getting away without having a notrace marking. It seems that my compiler isn't inlining cyc_to_sched_clock() though, so I'm hitting a recursion bug when I enable the function graph tracer, causing my system to crash. Marking these functions notrace fixes it. Technically cyc_to_ns() doesn't need the notrace because it's already marked inline, but let's just add it so that if we ever remove inline from that function it doesn't blow up.
--- arch/arm/kernel/sched_clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/kernel/sched_clock.c +2 -2
@@ -41,12 +41,12 @@ static u32 notrace jiffy_sched_clock_read(void)static u32 __read_mostly (*read_sched_clock)(void ) = jiffy_sched_clock_read; -static inline u64 cyc_to_ns (u64 cyc,u32 mult,u32 shift) +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift) {return (cyc * mult) >> shift; } -static unsigned long long cyc_to_sched_clock (u32 cyc,u32 mask) +static unsigned long long notrace cyc_to_sched_clock (u32 cyc,u32 mask) {u64 epoch_ns;u32 epoch_cyc;
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerPATCH 126/126 ARM: 7692/1: iop3xx: move IOP3XX_PERIPHERAL_VIRT_BASE
In reply to Steven Rostedt3.6.11.3 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Aaro Koskinen <[email protected]>
[ Upstream commit f5d6a1441a5045824f36ff7c6b6bbae0373472a6 ]
Currently IOP3XX_PERIPHERAL_VIRT_BASE conflicts with PCI_IO_VIRT_BASE:
address size PCI_IO_VIRT_BASE 0xfee00000 0x200000 IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000 0x2000
Fix by moving IOP3XX_PERIPHERAL_VIRT_BASE below PCI_IO_VIRT_BASE.
The patch fixes the following kernel panic with 3.9-rc1 on iop3xx boards:
[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Linux version 3.9.0-rc1-iop32x (aaro@blackmetal) (gcc version 4.7.2 (GCC) ) #20 PREEMPT Tue Mar 5 16:44:36 EET 2013 [ 0.000000] bootconsole [earlycon0] enabled [ 0.000000] ------------[ cut here ]------------ [ 0.000000] kernel BUG at mm/vmalloc.c:1145! [ 0.000000] Internal error: Oops - BUG: 0 [#1] PREEMPT ARM [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 Not tainted (3.9.0-rc1-iop32x #20) [ 0.000000] PC is at vm_area_add_early+0x4c/0x88 [ 0.000000] LR is at add_static_vm_early+0x14/0x68 [ 0.000000] pc : [<c03e74a8>] lr : [<c03e1c40>] psr: 800000d3 [ 0.000000] sp : c03ffee4 ip : dfffdf88 fp : c03ffef4 [ 0.000000] r10: 00000002 r9 : 000000cf r8 : 00000653 [ 0.000000] r7 : c040eca8 r6 : c03e2408 r5 : dfffdf60 r4 : 00200000 [ 0.000000] r3 : dfffdfd8 r2 : feffe000 r1 : ff000000 r0 : dfffdf60 [ 0.000000] Flags: Nzcv IRQs off FIQs off Mode SVC_32 ISA ARM Segment kernel [ 0.000000] Control: 0000397f Table: a0004000 DAC: 00000017 [ 0.000000] Process swapper (pid: 0, stack limit = 0xc03fe1b8) [ 0.000000] Stack: (0xc03ffee4 to 0xc0400000) [ 0.000000] fee0: 00200000 c03fff0c c03ffef8 c03e1c40 c03e7468 00200000 fee00000 [ 0.000000] ff00: c03fff2c c03fff10 c03e23e4 c03e1c38 feffe000 c0408ee4 ff000000 c0408f04 [ 0.000000] ff20: c03fff3c c03fff30 c03e2434 c03e23b4 c03fff84 c03fff40 c03e2c94 c03e2414 [ 0.000000] ff40: c03f8878 c03f6410 ffff0000 000bffff 00001000 00000008 c03fff84 c03f6410 [ 0.000000] ff60: c04227e8 c03fffd4 a0008000 c03f8878 69052e30 c02f96eb c03fffbc c03fff88 [ 0.000000] ff80: c03e044c c03e268c 00000000 0000397f c0385130 00000001 ffffffff c03f8874 [ 0.000000] ffa0: dfffffff a0004000 69052e30 a03f61a0 c03ffff4 c03fffc0 c03dd5cc c03e0184 [ 0.000000] ffc0: 00000000 00000000 00000000 00000000 00000000 c03f8878 0000397d c040601c [ 0.000000] ffe0: c03f8874 c0408674 00000000 c03ffff8 a0008040 c03dd558 00000000 00000000 [ 0.000000] Backtrace: [ 0.000000] [<c03e745c>] (vm_area_add_early+0x0/0x88) from [<c03e1c40>] (add_static_vm_early+0x14/0x68)
--- arch/arm/include/asm/hardware/iop3xx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/hardware/iop3xx.h +1 -1
@@ -37,7 +37,7 @@ extern int iop3xx_get_init_atu(void);* IOP3XX processor registers */ #define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000 -#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000 +#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfedfe000#define IOP3XX_PERIPHERAL_SIZE 0x00002000#define IOP3XX_PERIPHERAL_UPPER_PA (IOP3XX_PERIPHERAL_PHYS_BASE +\ IOP3XX_PERIPHERAL_SIZE - 1)
Signature · 1 line
1.7.10.4
Steven Rostedt
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 6 SUBLEVEL = 11 -EXTRAVERSION = .2 +EXTRAVERSION = .3 NAME = Terrified Chipmunk # *DOCUMENTATION*
arch/alpha/kernel/sys_nautilus.c +5 -0
@@ -188,6 +188,10 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr)extern void free_reserved_mem (void *,void *);extern void pcibios_claim_one_bus (struct pci_bus *); +static struct resource irongate_io = { + .name ="Irongate PCI IO" , + .flags =IORESOURCE_IO , +};static struct resource irongate_mem = { .name ="Irongate PCI MEM" , .flags =IORESOURCE_MEM ,
@@ -209,6 +213,7 @@ nautilus_init_pci(void) irongate =pci_get_bus_and_slot (0 ,0 ); bus->self = irongate; + bus->resource[0 ] = &irongate_io; bus->resource[1 ] = &irongate_mem;pci_bus_size_bridges (bus);
arch/arm/include/asm/hardware/iop3xx.h +1 -1
@@ -37,7 +37,7 @@ extern int iop3xx_get_init_atu(void);* IOP3XX processor registers */ #define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000 -#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000 +#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfedfe000#define IOP3XX_PERIPHERAL_SIZE 0x00002000#define IOP3XX_PERIPHERAL_UPPER_PA (IOP3XX_PERIPHERAL_PHYS_BASE +\ IOP3XX_PERIPHERAL_SIZE - 1)
arch/arm/kernel/perf_event.c +4 -1
@@ -316,7 +316,10 @@ validate_event(struct pmu_hw_events *hw_events,struct hw_perf_event fake_event = event->hw;struct pmu *leader_pmu = event->group_leader->pmu; -if (event->pmu != leader_pmu || event->state <=PERF_EVENT_STATE_OFF ) +if (event->pmu != leader_pmu || event->state <PERF_EVENT_STATE_OFF ) +return 1 ; + +if (event->state ==PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)return 1 ;return armpmu->get_event_idx (hw_events, &fake_event) >=0 ;
arch/arm/kernel/sched_clock.c +2 -2
@@ -41,12 +41,12 @@ static u32 notrace jiffy_sched_clock_read(void)static u32 __read_mostly (*read_sched_clock)(void ) = jiffy_sched_clock_read; -static inline u64 cyc_to_ns (u64 cyc,u32 mult,u32 shift) +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift) {return (cyc * mult) >> shift; } -static unsigned long long cyc_to_sched_clock (u32 cyc,u32 mask) +static unsigned long long notrace cyc_to_sched_clock (u32 cyc,u32 mask) {u64 epoch_ns;u32 epoch_cyc;
arch/arm/mach-imx/clk-imx35.c +2 -0
@@ -260,6 +260,8 @@ int __init mx35_clocks_init()clk_prepare_enable (clk[gpio3_gate]);clk_prepare_enable (clk[iim_gate]);clk_prepare_enable (clk[emi_gate]); +clk_prepare_enable (clk[max_gate]); +clk_prepare_enable (clk[iomuxc_gate]);/* * SCC is needed to boot via mmc after a watchdog reset. The clock code
arch/arm/mm/cache-feroceon-l2.c +1 -0
@@ -343,6 +343,7 @@ void __init feroceon_l2_init(int __l2_wt_override) outer_cache.inv_range = feroceon_l2_inv_range; outer_cache.clean_range = feroceon_l2_clean_range; outer_cache.flush_range = feroceon_l2_flush_range; + outer_cache.inv_all = l2_inv_all;enable_l2 ();
arch/arm/mm/proc-arm920.S +1 -1
@@ -384,7 +384,7 @@ ENTRY(cpu_arm920_set_pte_ext) /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ .globl cpu_arm920_suspend_size .equ cpu_arm920_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_arm920_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-arm926.S +1 -1
@@ -399,7 +399,7 @@ ENTRY(cpu_arm926_set_pte_ext) /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ .globl cpu_arm926_suspend_size .equ cpu_arm926_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_arm926_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-mohawk.S +1 -1
@@ -347,7 +347,7 @@ ENTRY(cpu_mohawk_set_pte_ext) .globl cpu_mohawk_suspend_size .equ cpu_mohawk_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_mohawk_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-sa1100.S +1 -1
@@ -172,7 +172,7 @@ ENTRY(cpu_sa1100_set_pte_ext) .globl cpu_sa1100_suspend_size .equ cpu_sa1100_suspend_size, 4 * 3 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_sa1100_do_suspend) stmfd sp!, {r4 - r6, lr} mrc p15, 0, r4, c3, c0, 0 @ domain ID
arch/arm/mm/proc-v6.S +1 -1
@@ -138,7 +138,7 @@ ENTRY(cpu_v6_set_pte_ext) /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */ .globl cpu_v6_suspend_size .equ cpu_v6_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_v6_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
arch/arm/mm/proc-xsc3.S +1 -1
@@ -410,7 +410,7 @@ ENTRY(cpu_xsc3_set_pte_ext) .globl cpu_xsc3_suspend_size .equ cpu_xsc3_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_xsc3_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-xscale.S +1 -1
@@ -524,7 +524,7 @@ ENTRY(cpu_xscale_set_pte_ext) .globl cpu_xscale_suspend_size .equ cpu_xscale_suspend_size, 4 * 6 -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_xscale_do_suspend) stmfd sp!, {r4 - r9, lr} mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/powerpc/platforms/pseries/lpar.c +7 -1
@@ -187,7 +187,13 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) (0x1UL << 4), &dummy1, &dummy2);if (lpar_rc ==H_SUCCESS )return i; -BUG_ON (lpar_rc !=H_NOT_FOUND ); + +/* +* The test for adjunct partition is performed before the +* ANDCOND test. H_RESOURCE may be returned, so we need to +* check for that as well. +*/ +BUG_ON (lpar_rc !=H_NOT_FOUND && lpar_rc !=H_RESOURCE ); slot_offset++; slot_offset &=0x7 ;
arch/x86/boot/compressed/Makefile +2 -3
@@ -4,7 +4,7 @@ # create a compressed vmlinux image from the original vmlinux # -targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o +targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
@@ -29,7 +29,6 @@ VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ $(obj)/piggy.o $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone -$(obj)/efi_stub_$(BITS).o: KBUILD_CLFAGS += -fshort-wchar -mno-red-zone ifeq ($(CONFIG_EFI_STUB), y) VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
@@ -43,7 +42,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment -S $(obj)/vmlinux.bin: vmlinux FORCE $(call if_changed,objcopy) -targets += vmlinux.bin.all vmlinux.relocs +targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs CMD_RELOCS = arch/x86/tools/relocs quiet_cmd_relocs = RELOCS $@
arch/x86/include/asm/kvm_host.h +2 -2
@@ -418,8 +418,8 @@ struct kvm_vcpu_arch {gpa_t time;struct pvclock_vcpu_time_info hv_clock;unsigned int hw_tsc_khz; -unsigned int time_offset; -struct page *time_page; +struct gfn_to_hva_cache pv_time; +bool pv_time_enabled;struct {u64 msr_val;
arch/x86/include/asm/paravirt.h +4 -1
@@ -705,7 +705,10 @@ static inline void arch_leave_lazy_mmu_mode(void)PVOP_VCALL0 (pv_mmu_ops.lazy_mode.leave); } -void arch_flush_lazy_mmu_mode (void ); +static inline void arch_flush_lazy_mmu_mode (void ) +{ +PVOP_VCALL0 (pv_mmu_ops.lazy_mode.flush); +}static inline void __set_fixmap (unsigned /* enum fixed_addresses */ idx,phys_addr_t phys,pgprot_t flags)
arch/x86/include/asm/paravirt_types.h +2 -0
@@ -91,6 +91,7 @@ struct pv_lazy_ops {/* Set deferred update mode, used for batching operations. */ void (*enter)(void );void (*leave)(void ); +void (*flush)(void ); };struct pv_time_ops {
@@ -679,6 +680,7 @@ void paravirt_end_context_switch(struct task_struct *next);void paravirt_enter_lazy_mmu (void );void paravirt_leave_lazy_mmu (void ); +void paravirt_flush_lazy_mmu (void );void _paravirt_nop (void );u32 _paravirt_ident_32 (u32 );
arch/x86/include/asm/syscall.h +2 -2
@@ -29,13 +29,13 @@ extern const unsigned long sys_call_table[];*/ static inline int syscall_get_nr (struct task_struct *task,struct pt_regs *regs) { -return regs->orig_ax & __SYSCALL_MASK; +return regs->orig_ax; }static inline void syscall_rollback (struct task_struct *task,struct pt_regs *regs) { - regs->ax = regs->orig_ax & __SYSCALL_MASK; + regs->ax = regs->orig_ax; } static inline long syscall_get_error(struct task_struct *task,
arch/x86/include/asm/tlb.h +1 -1
@@ -7,7 +7,7 @@#define tlb_flush (tlb) \ { \ - if (tlb->fullmm == 0) \ + if (!tlb->fullmm && !tlb->need_flush_all) \ flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end, 0UL); \ else \ flush_tlb_mm_range(tlb->mm, 0UL, TLB_FLUSH_ALL, 0UL); \
arch/x86/kernel/cpu/perf_event_intel.c +16 -4
@@ -128,8 +128,14 @@ static struct event_constraint intel_gen_event_constraints[] __read_mostly = };static struct extra_reg intel_snb_extra_regs[]__read_mostly = { -INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3fffffffffull ,RSP_0 ), -INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3fffffffffull ,RSP_1 ), +INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3f807f8fffull ,RSP_0 ), +INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3f807f8fffull ,RSP_1 ), +EVENT_EXTRA_END +}; + +static struct extra_reg intel_snbep_extra_regs[]__read_mostly = { +INTEL_EVENT_EXTRA_REG (0xb7 ,MSR_OFFCORE_RSP_0 ,0x3fffff8fffull ,RSP_0 ), +INTEL_EVENT_EXTRA_REG (0xbb ,MSR_OFFCORE_RSP_1 ,0x3fffff8fffull ,RSP_1 ),EVENT_EXTRA_END };
@@ -2058,7 +2064,10 @@ __init int intel_pmu_init(void) x86_pmu.event_constraints = intel_snb_event_constraints; x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints; x86_pmu.pebs_aliases = intel_pebs_aliases_snb; - x86_pmu.extra_regs = intel_snb_extra_regs; +if (boot_cpu_data.x86_model ==45 ) + x86_pmu.extra_regs = intel_snbep_extra_regs; +else + x86_pmu.extra_regs = intel_snb_extra_regs;/* all extra regs are per-cpu when HT is on */ x86_pmu.er_flags |=ERF_HAS_RSP_1 ; x86_pmu.er_flags |=ERF_NO_HT_SHARING ;
@@ -2083,7 +2092,10 @@ __init int intel_pmu_init(void) x86_pmu.event_constraints = intel_snb_event_constraints; x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints; x86_pmu.pebs_aliases = intel_pebs_aliases_snb; - x86_pmu.extra_regs = intel_snb_extra_regs; +if (boot_cpu_data.x86_model ==62 ) + x86_pmu.extra_regs = intel_snbep_extra_regs; +else + x86_pmu.extra_regs = intel_snb_extra_regs;/* all extra regs are per-cpu when HT is on */ x86_pmu.er_flags |=ERF_HAS_RSP_1 ; x86_pmu.er_flags |=ERF_NO_HT_SHARING ;
arch/x86/kernel/paravirt.c +13 -12
@@ -263,6 +263,18 @@ void paravirt_leave_lazy_mmu(void)leave_lazy (PARAVIRT_LAZY_MMU ); } +void paravirt_flush_lazy_mmu (void ) +{ +preempt_disable (); + +if (paravirt_get_lazy_mode () ==PARAVIRT_LAZY_MMU ) { +arch_leave_lazy_mmu_mode (); +arch_enter_lazy_mmu_mode (); + } + +preempt_enable (); +} +void paravirt_start_context_switch (struct task_struct *prev) {BUG_ON (preemptible ());
@@ -292,18 +304,6 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)return this_cpu_read (paravirt_lazy_mode); } -void arch_flush_lazy_mmu_mode (void ) -{ -preempt_disable (); - -if (paravirt_get_lazy_mode () ==PARAVIRT_LAZY_MMU ) { -arch_leave_lazy_mmu_mode (); -arch_enter_lazy_mmu_mode (); - } - -preempt_enable (); -} -struct pv_info pv_info = { .name ="bare hardware" , .paravirt_enabled =0 ,
@@ -475,6 +475,7 @@ struct pv_mmu_ops pv_mmu_ops = { .lazy_mode = { .enter = paravirt_nop, .leave = paravirt_nop, + .flush = paravirt_nop, }, .set_fixmap = native_set_fixmap,
arch/x86/kvm/lapic.c +1 -1
@@ -1574,5 +1574,5 @@ int kvm_lapic_enable_pv_eoi(struct kvm_vcpu *vcpu, u64 data)if (!pv_eoi_enabled (vcpu))return 0 ;return kvm_gfn_to_hva_cache_init (vcpu->kvm, &vcpu->arch.pv_eoi.data, - addr); + addr,sizeof (u8)); }
arch/x86/kvm/x86.c +19 -26
106 lines not on this page · raw message
arch/x86/lguest/boot.c +1 -0
@@ -1333,6 +1333,7 @@ __init void lguest_init(void) pv_mmu_ops.read_cr3 = lguest_read_cr3; pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu; pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mmu_mode; + pv_mmu_ops.lazy_mode.flush = paravirt_flush_lazy_mmu; pv_mmu_ops.pte_update = lguest_pte_update; pv_mmu_ops.pte_update_defer = lguest_pte_update;
arch/x86/mm/fault.c +4 -2
@@ -377,10 +377,12 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)if (pgd_none (*pgd_ref))return -1 ; -if (pgd_none (*pgd)) +if (pgd_none (*pgd)) {set_pgd (pgd, *pgd_ref); -else +arch_flush_lazy_mmu_mode (); + }else {BUG_ON (pgd_page_vaddr (*pgd) !=pgd_page_vaddr (*pgd_ref)); + }/* * Below here mismatches are bugs because these lower tables
arch/x86/mm/pgtable.c +7 -0
@@ -58,6 +58,13 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)void ___pmd_free_tlb (struct mmu_gather *tlb,pmd_t *pmd) {paravirt_release_pmd (__pa (pmd) >>PAGE_SHIFT ); +/* +* NOTE! For PAE, any changes to the top page-directory-pointer-table +* entries need a full cr3 reload to flush. +*/ +#ifdef CONFIG_X86_PAE + tlb->need_flush_all =1 ; +#endif tlb_remove_page (tlb,virt_to_page (pmd)); }
arch/x86/xen/mmu.c +1 -0
@@ -2079,6 +2079,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { .lazy_mode = { .enter = paravirt_enter_lazy_mmu, .leave = xen_leave_lazy_mmu, + .flush = paravirt_flush_lazy_mmu, }, .set_fixmap = xen_set_fixmap,
block/blk-sysfs.c +2 -0
@@ -207,6 +207,8 @@ queue_store_##name(struct request_queue *q, const char *page, size_t count) \unsigned long val; \ssize_t ret; \ ret =queue_var_store (&val, page, count); \ +if (ret <0 ) \ +return ret; \if (neg) \ val = !val; \ \
crypto/algif_hash.c +2 -0
@@ -161,6 +161,8 @@ static int hash_recvmsg(struct kiocb *unused, struct socket *sock,else if (len < ds) msg->msg_flags |=MSG_TRUNC ; + msg->msg_namelen =0 ; +lock_sock (sk);if (ctx->more) { ctx->more =0 ;
crypto/algif_skcipher.c +1 -0
@@ -432,6 +432,7 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock,long copied =0 ;lock_sock (sk); + msg->msg_namelen =0 ;for (iov = msg->msg_iov, iovlen = msg->msg_iovlen; iovlen >0 ; iovlen--, iov++) {unsigned long seglen = iov->iov_len;
crypto/gcm.c +14 -3
@@ -44,6 +44,7 @@ struct crypto_rfc4543_ctx {struct crypto_rfc4543_req_ctx {u8 auth_tag[16 ]; +u8 assocbuf[32 ];struct scatterlist cipher[1 ];struct scatterlist payload[2 ];struct scatterlist assoc[2 ];
@@ -1142,9 +1143,19 @@ static struct aead_request *crypto_rfc4543_crypt(struct aead_request *req,scatterwalk_crypto_chain (payload, dst, vdst == req->iv +8 ,2 ); assoclen +=8 + req->cryptlen - (enc ?0 : authsize); -sg_init_table (assoc,2 ); -sg_set_page (assoc,sg_page (req->assoc), req->assoc->length, - req->assoc->offset); +if (req->assoc->length == req->assoclen) { +sg_init_table (assoc,2 ); +sg_set_page (assoc,sg_page (req->assoc), req->assoc->length, + req->assoc->offset); + }else { +BUG_ON (req->assoclen >sizeof (rctx->assocbuf)); + +scatterwalk_map_and_copy (rctx->assocbuf, req->assoc,0 , + req->assoclen,0 ); + +sg_init_table (assoc,2 ); +sg_set_buf (assoc, rctx->assocbuf, req->assoclen); + }scatterwalk_crypto_chain (assoc, payload,0 ,2 );aead_request_set_tfm (subreq, ctx->child);
drivers/ata/ata_piix.c +11 -0
@@ -150,6 +150,7 @@ enum piix_controller_ids { tolapai_sata, piix_pata_vmw,/* PIIX4 for VMware, spurious DMA_ERR */ ich8_sata_snb, + ich8_2port_sata_snb, }; struct piix_map_db {
@@ -502,6 +503,7 @@ static const struct piix_map_db *piix_map_db_table[] = { [ich8m_apple_sata] = &ich8m_apple_map_db, [tolapai_sata] = &tolapai_map_db, [ich8_sata_snb] = &ich8_map_db, + [ich8_2port_sata_snb] = &ich8_2port_map_db, };static struct ata_port_info piix_port_info[] = {
@@ -643,6 +645,15 @@ static struct ata_port_info piix_port_info[] = { .port_ops = &piix_sata_ops, }, + [ich8_2port_sata_snb] = + { + .flags =PIIX_SATA_FLAGS |PIIX_FLAG_SIDPR + | PIIX_FLAG_PIO16, + .pio_mask = ATA_PIO4, + .mwdma_mask = ATA_MWDMA2, + .udma_mask = ATA_UDMA6, + .port_ops = &piix_sata_ops, + }, };static struct pci_bits piix_enable_bits[] = {
drivers/ata/libata-core.c +4 -0
@@ -2413,6 +2413,9 @@ int ata_dev_configure(struct ata_device *dev) dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, dev->max_sectors); +if (dev->horkage &ATA_HORKAGE_MAX_SEC_LBA48 ) + dev->max_sectors =ATA_MAX_SECTORS_LBA48 ; +if (ap->ops->dev_config) ap->ops->dev_config (dev);
@@ -4069,6 +4072,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {/* Weird ATAPI devices */ { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA }, + { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, /* Devices we expect to fail diagnostics */
drivers/base/regmap/regcache-rbtree.c +1 -1
@@ -398,7 +398,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min, base =0 ;if (max < rbnode->base_reg + rbnode->blklen) - end = rbnode->base_reg + rbnode->blklen - max; + end = max - rbnode->base_reg +1 ;else end = rbnode->blklen;
drivers/char/hpet.c +1 -13
@@ -373,26 +373,14 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma)struct hpet_dev *devp;unsigned long addr; -if (((vma->vm_end - vma->vm_start) !=PAGE_SIZE ) || vma->vm_pgoff) -return -EINVAL ; - devp = file->private_data; addr = devp->hd_hpets->hp_hpet_phys;if (addr & (PAGE_SIZE -1 ))return -ENOSYS ; - vma->vm_flags |=VM_IO ; vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); - -if (io_remap_pfn_range (vma, vma->vm_start, addr >>PAGE_SHIFT , -PAGE_SIZE , vma->vm_page_prot)) { -printk (KERN_ERR "%s: io_remap_pfn_range failed\n" , - __func__); -return -EAGAIN ; - } - -return 0 ; +return vm_iomap_memory (vma, addr,PAGE_SIZE );#else return -ENOSYS ;#endif
drivers/cpufreq/exynos-cpufreq.c +2 -2
@@ -220,8 +220,6 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)cpufreq_frequency_table_get_attr (exynos_info->freq_table, policy->cpu); - locking_frequency =exynos_getspeed (0 ); -/* set the transition latency value */ policy->cpuinfo.transition_latency =100000 ;
@@ -285,6 +283,8 @@ static int __init exynos_cpufreq_init(void) goto err_vdd_arm; } + locking_frequency =exynos_getspeed (0 ); +register_pm_notifier (&exynos_cpufreq_nb);if (cpufreq_register_driver (&exynos_driver)) {
drivers/crypto/ux500/cryp/cryp_core.c +1 -1
@@ -1750,7 +1750,7 @@ static struct platform_driver cryp_driver = { .shutdown = ux500_cryp_shutdown, .driver = { .owner = THIS_MODULE, - .name = "cryp1" + .name = "cryp1", .pm = &ux500_cryp_pm, } };
drivers/eisa/pci_eisa.c +46 -21
87 lines not on this page · raw message
drivers/gpu/drm/i915/intel_display.c +9 -0
@@ -7153,6 +7153,15 @@ static struct intel_quirk intel_quirks[] = {/* Acer Aspire 5734Z must invert backlight brightness */ { 0x2a42, 0x1025, 0x0459, quirk_invert_brightness }, + +/* Acer/eMachines G725 */ + { 0x2a42, 0x1025, 0x0210, quirk_invert_brightness }, + +/* Acer/eMachines e725 */ + { 0x2a42, 0x1025, 0x0212, quirk_invert_brightness }, + +/* Acer/Packard Bell NCL20 */ + { 0x2a42, 0x1025, 0x034b, quirk_invert_brightness }, };static void intel_init_quirks (struct drm_device *dev)
drivers/gpu/drm/mgag200/mgag200_mode.c +3 -10
@@ -752,8 +752,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,int i;unsigned char misc =0 ;unsigned char ext_vga[6 ]; -unsigned char ext_vga_index24; -unsigned char dac_index90 =0 ;u8 bppshift;static unsigned char dacvalue[] = {
@@ -804,7 +802,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, option2 =0x0000b000 ;break ;case G200_ER : - dac_index90 =0 ;break ; }
@@ -853,10 +850,8 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,WREG_DAC (i, dacvalue[i]); } -if (mdev->type ==G200_ER ) { -WREG_DAC (0x90 , dac_index90); - } - +if (mdev->type ==G200_ER ) +WREG_DAC (0x90 ,0 );if (option)pci_write_config_dword (dev->pdev,PCI_MGA_OPTION , option);
@@ -953,8 +948,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,if (mdev->type ==G200_WB ) ext_vga[1 ] |=0x88 ; - ext_vga_index24 =0x05 ; -/* Set pixel clocks */ misc =0x2d ;WREG8 (MGA_MISC_OUT , misc);
@@ -966,7 +959,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, }if (mdev->type ==G200_ER ) -WREG_ECRT (24 , ext_vga_index24); +WREG_ECRT (0x24 ,0x5 );if (mdev->type ==G200_EV ) {WREG_ECRT (6 ,0 );
drivers/gpu/drm/udl/udl_connector.c +4 -0
@@ -56,6 +56,10 @@ static int udl_get_modes(struct drm_connector *connector)int ret; edid = (struct edid *)udl_get_edid (udl); +if (!edid) { +drm_mode_connector_update_edid_property (connector,NULL ); +return 0 ; + } connector->display_info.raw_edid = (char *)edid;
drivers/hwspinlock/hwspinlock_core.c +2 -0
@@ -416,6 +416,8 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock) ret =pm_runtime_get_sync (dev);if (ret <0 ) {dev_err (dev,"%s: can't power on device\n" , __func__); +pm_runtime_put_noidle (dev); +module_put (dev->driver->owner);return ret; }
drivers/mtd/mtdchar.c +7 -31
@@ -1159,41 +1159,17 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma)struct mtd_file_info *mfi = file->private_data;struct mtd_info *mtd = mfi->mtd;struct map_info *map = mtd->priv; -resource_size_t start, off; -unsigned long len, vma_len; - -if (mtd->type ==MTD_RAM || mtd->type ==MTD_ROM ) { - off =get_vm_offset (vma); - start = map->phys; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + map->size); - start &=PAGE_MASK ; - vma_len =get_vm_size (vma); - -/* Overflow in off+len? */ -if (vma_len + off < off) -return -EINVAL ; -/* Does it fit in the mapping? */ -if (vma_len + off > len) -return -EINVAL ; - - off += start; -/* Did that overflow? */ -if (off < start) -return -EINVAL ; -if (set_vm_offset (vma, off) <0 ) -return -EINVAL ; - vma->vm_flags |=VM_IO |VM_RESERVED ; +/* This is broken because it assumes the MTD device is map-based +and that mtd->priv is a valid struct map_info. It should be +replaced with something that uses the mtd_get_unmapped_area() +operation properly. */ +if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/ ) {#ifdef pgprot_noncached -if (file->f_flags &O_DSYNC || off >=__pa (high_memory)) +if (file->f_flags &O_DSYNC || map->phys >=__pa (high_memory)) vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot);#endif -if (io_remap_pfn_range (vma, vma->vm_start, off >>PAGE_SHIFT , - vma->vm_end - vma->vm_start, - vma->vm_page_prot)) -return -EAGAIN ; - -return 0 ; +return vm_iomap_memory (vma, map->phys, map->size); }return -ENOSYS ;#else
drivers/net/bonding/bond_main.c +10 -0
@@ -1893,6 +1893,7 @@ err_detach:write_unlock_bh (&bond->lock); err_close: + slave_dev->priv_flags &= ~IFF_BONDING ;dev_close (slave_dev); err_unset_master:
@@ -4876,9 +4877,18 @@ static int __net_init bond_net_init(struct net *net) static void __net_exit bond_net_exit(struct net *net) {struct bond_net *bn =net_generic (net, bond_net_id); +struct bonding *bond, *tmp_bond; +LIST_HEAD (list);bond_destroy_sysfs (bn);bond_destroy_proc_dir (bn); + +/* Kill off any bonds created after unregistering bond rtnl ops */ +rtnl_lock (); +list_for_each_entry_safe (bond, tmp_bond, &bn->dev_list, bond_list) +unregister_netdevice_queue (bond->dev, &list); +unregister_netdevice_many (&list); +rtnl_unlock (); }static struct pernet_operations bond_net_ops = {
drivers/net/can/mcp251x.c +8 -2
@@ -922,6 +922,7 @@ static int mcp251x_open(struct net_device *net)struct mcp251x_priv *priv =netdev_priv (net);struct spi_device *spi = priv->spi;struct mcp251x_platform_data *pdata = spi->dev.platform_data; +unsigned long flags;int ret; ret =open_candev (net);
@@ -938,9 +939,14 @@ static int mcp251x_open(struct net_device *net) priv->tx_skb =NULL ; priv->tx_len =0 ; + flags =IRQF_ONESHOT ; +if (pdata->irq_flags) + flags |= pdata->irq_flags; +else + flags |=IRQF_TRIGGER_FALLING ; + ret =request_threaded_irq (spi->irq,NULL , mcp251x_can_ist, - pdata->irq_flags ? pdata->irq_flags :IRQF_TRIGGER_FALLING , -DEVICE_NAME , priv); + flags,DEVICE_NAME , priv);if (ret) {dev_err (&spi->dev,"failed to acquire irq %d\n" , spi->irq);if (pdata->transceiver_enable)
drivers/net/can/sja1000/sja1000_of_platform.c +15 -16
@@ -94,8 +94,8 @@ static int __devinit sja1000_ofp_probe(struct platform_device *ofdev)struct net_device *dev;struct sja1000_priv *priv;struct resource res; -const u32 *prop; -int err, irq, res_size, prop_size; +u32 prop; +int err, irq, res_size;void __iomem *base; err =of_address_to_resource (np,0 , &res);
@@ -136,27 +136,27 @@ static int __devinit sja1000_ofp_probe(struct platform_device *ofdev) priv->read_reg = sja1000_ofp_read_reg; priv->write_reg = sja1000_ofp_write_reg; - prop =of_get_property (np,"nxp,external-clock-frequency" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->can.clock.freq = *prop /2 ; + err =of_property_read_u32 (np,"nxp,external-clock-frequency" , &prop); +if (!err) + priv->can.clock.freq = prop /2 ;else priv->can.clock.freq =SJA1000_OFP_CAN_CLOCK ;/* default */ - prop =of_get_property (np,"nxp,tx-output-mode" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->ocr |= *prop &OCR_MODE_MASK ; + err =of_property_read_u32 (np,"nxp,tx-output-mode" , &prop); +if (!err) + priv->ocr |= prop &OCR_MODE_MASK ;else priv->ocr |=OCR_MODE_NORMAL ;/* default */ - prop =of_get_property (np,"nxp,tx-output-config" , &prop_size); -if (prop && (prop_size ==sizeof (u32))) - priv->ocr |= (*prop <<OCR_TX_SHIFT ) &OCR_TX_MASK ; + err =of_property_read_u32 (np,"nxp,tx-output-config" , &prop); +if (!err) + priv->ocr |= (prop <<OCR_TX_SHIFT ) &OCR_TX_MASK ;else priv->ocr |=OCR_TX0_PULLDOWN ;/* default */ - prop =of_get_property (np,"nxp,clock-out-frequency" , &prop_size); -if (prop && (prop_size ==sizeof (u32)) && *prop) { -u32 divider = priv->can.clock.freq *2 / *prop; + err =of_property_read_u32 (np,"nxp,clock-out-frequency" , &prop); +if (!err && prop) { +u32 divider = priv->can.clock.freq *2 / prop;if (divider >1 ) priv->cdr |= divider /2 -1 ;
@@ -166,8 +166,7 @@ static int __devinit sja1000_ofp_probe(struct platform_device *ofdev) priv->cdr |=CDR_CLK_OFF ;/* default */ } - prop =of_get_property (np,"nxp,no-comparator-bypass" ,NULL ); -if (!prop) +if (!of_property_read_bool (np,"nxp,no-comparator-bypass" )) priv->cdr |=CDR_CBP ;/* default */ priv->irq_flags =IRQF_SHARED ;
drivers/net/ethernet/atheros/atl1e/atl1e.h +1 -1
@@ -186,7 +186,7 @@ struct atl1e_tpd_desc {/* how about 0x2000 */ #define MAX_TX_BUF_LEN 0x2000#define MAX_TX_BUF_SHIFT 13 -/*#define MAX_TX_BUF_LEN 0x3000 */ +#define MAX_TSO_SEG_SIZE 0x3c00/* rrs word 1 bit 0:31 */ #define RRS_RX_CSUM_MASK 0xFFFF
drivers/net/ethernet/atheros/atl1e/atl1e_main.c +1 -0
@@ -2333,6 +2333,7 @@ static int __devinit atl1e_probe(struct pci_dev *pdev,INIT_WORK (&adapter->reset_task, atl1e_reset_task);INIT_WORK (&adapter->link_chg_task, atl1e_link_chg_task); +netif_set_gso_max_size (netdev,MAX_TSO_SEG_SIZE ); err =register_netdev (netdev);if (err) {netdev_err (netdev,"register netdevice failed\n" );
drivers/net/ethernet/broadcom/tg3.c +17 -1
@@ -301,6 +301,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = { {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)}, {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5720)}, {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57762)}, + {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57766)}, {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)}, {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)}, {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
@@ -8784,7 +8785,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) }if (GET_CHIP_REV (tp->pci_chip_rev_id) !=CHIPREV_57765_AX ) { -u32 grc_mode =tr32 (GRC_MODE ); +u32 grc_mode; + +/* Fix transmit hangs */ + val =tr32 (TG3_CPMU_PADRNG_CTL ); + val |=TG3_CPMU_PADRNG_CTL_RDIV2 ; +tw32 (TG3_CPMU_PADRNG_CTL , val); + + grc_mode =tr32 (GRC_MODE );/* Access the lower 1K of DL PCIE block registers. */ val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK ;
@@ -9088,6 +9096,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)if (tg3_flag (tp,PCI_EXPRESS )) rdmac_mode |=RDMAC_MODE_FIFO_LONG_BURST ; +if (GET_ASIC_REV (tp->pci_chip_rev_id) ==ASIC_REV_57766 ) { + tp->dma_limit =0 ; +if (tp->dev->mtu <=ETH_DATA_LEN ) { + rdmac_mode |=RDMAC_MODE_JMB_2K_MMRR ; + tp->dma_limit =TG3_TX_BD_DMA_MAX_2K ; + } + } +if (tg3_flag (tp,HW_TSO_1 ) ||tg3_flag (tp,HW_TSO_2 ) ||tg3_flag (tp,HW_TSO_3 ))
drivers/net/ethernet/broadcom/tg3.h +2 -0
@@ -1120,6 +1120,8 @@#define CPMU_MUTEX_GNT_DRIVER 0x00001000#define TG3_CPMU_PHY_STRAP 0x00003664#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 +#define TG3_CPMU_PADRNG_CTL 0x00003668 +#define TG3_CPMU_PADRNG_CTL_RDIV2 0x00040000/* 0x3664 --> 0x36b0 unused */ #define TG3_CPMU_EEE_MODE 0x000036b0
drivers/net/ethernet/realtek/r8169.c +25 -3
@@ -3827,6 +3827,30 @@ static void __devinit rtl_init_mdio_ops(struct rtl8169_private *tp) } } +static void rtl_speed_down (struct rtl8169_private *tp) +{ +u32 adv; +int lpa; + +rtl_writephy (tp,0x1f ,0x0000 ); + lpa =rtl_readphy (tp,MII_LPA ); + +if (lpa & (LPA_10HALF |LPA_10FULL )) + adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full; +else if (lpa & (LPA_100HALF |LPA_100FULL )) + adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full; +else + adv = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | + (tp->mii.supports_gmii ? + ADVERTISED_1000baseT_Half | + ADVERTISED_1000baseT_Full :0 ); + +rtl8169_set_speed (tp->dev,AUTONEG_ENABLE ,SPEED_1000 ,DUPLEX_FULL , + adv); +} +static void rtl_wol_suspend_quirk (struct rtl8169_private *tp) {void __iomem *ioaddr = tp->mmio_addr;
@@ -3857,9 +3881,7 @@ static bool rtl_wol_pll_power_down(struct rtl8169_private *tp)if (!(__rtl8169_get_wol (tp) &WAKE_ANY ))return false; -rtl_writephy (tp,0x1f ,0x0000 ); -rtl_writephy (tp,MII_BMCR ,0x0000 ); - +rtl_speed_down (tp);rtl_wol_suspend_quirk (tp);return true;
drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h +1 -1
@@ -519,7 +519,7 @@ static const u32 ar9580_1p0_mac_core[][2] = { {0x00008258, 0x00000000}, {0x0000825c, 0x40000000}, {0x00008260, 0x00080922}, - {0x00008264, 0x9bc00010}, + {0x00008264, 0x9d400010}, {0x00008268, 0xffffffff}, {0x0000826c, 0x0000ffff}, {0x00008270, 0x00000000},
drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 -1
@@ -774,7 +774,7 @@ static int ath9k_init_firmware_version(struct ath9k_htc_priv *priv)* required version. */ if (priv->fw_version_major !=MAJOR_VERSION_REQ || - priv->fw_version_minor !=MINOR_VERSION_REQ ) { + priv->fw_version_minor <MINOR_VERSION_REQ ) {dev_err (priv->dev,"ath9k_htc: Please upgrade to FW version %d.%d\n" ,MAJOR_VERSION_REQ ,MINOR_VERSION_REQ );return -EINVAL ;
drivers/net/wireless/b43/phy_n.c +2 -1
@@ -4583,7 +4583,8 @@ static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)#endif #ifdef CONFIG_B43_SSB case B43_BUS_SSB : -/* FIXME */ +ssb_pmu_spuravoid_pllupdate (&dev->dev->sdev->bus->chipco, + avoid);break ;#endif }
drivers/net/wireless/mwifiex/cfg80211.c +2 -1
@@ -1487,7 +1487,8 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, } } -for (i =0 ; i < request->n_channels; i++) { +for (i =0 ; i <min_t (u32, request->n_channels, +MWIFIEX_USER_SCAN_CHAN_MAX ); i++) { chan = request->channels[i]; priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value; priv->user_scan_cfg->chan_list[i].radio_type = chan->band;
drivers/net/wireless/rt2x00/rt2x00pci.c +2 -2
@@ -52,8 +52,8 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev,udelay (REGISTER_BUSY_DELAY ); } -ERROR (rt2x00dev,"Indirect register access failed: " -"offset=0x%.08x, value=0x%.08x\n" , offset, *reg); +printk_once (KERN_ERR "%s() Indirect register access failed: " +"offset=0x%.08x, value=0x%.08x\n" , __func__, offset, *reg); *reg = ~0 ;return 0 ;
drivers/pci/pcie/portdrv_pci.c +0 -13
@@ -174,14 +174,6 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = {#endif /* !PM */ /* -* PCIe port runtime suspend is broken for some chipsets, so use a -* black list to disable runtime PM for these chipsets. -*/ -static const struct pci_device_id port_runtime_pm_black_list[] = { - {/* end: all zeroes */ } -}; - -/* * pcie_portdrv_probe - Probe PCI-Express port devices * @dev: PCI-Express port device being probed *
@@ -214,16 +206,11 @@ static int __devinit pcie_portdrv_probe(struct pci_dev *dev,* it by default. */ dev->d3cold_allowed = false; -if (!pci_match_id (port_runtime_pm_black_list, dev)) -pm_runtime_put_noidle (&dev->dev); -return 0 ; }static void pcie_portdrv_remove (struct pci_dev *dev) { -if (!pci_match_id (port_runtime_pm_black_list, dev)) -pm_runtime_get_noresume (&dev->dev);pcie_port_device_remove (dev);pci_disable_device (dev); }
drivers/platform/x86/msi-wmi.c +3 -1
@@ -176,7 +176,7 @@ static void msi_wmi_notify(u32 value, void *context)pr_debug ("Suppressed key event 0x%X - " "Last press was %lld us ago\n" , key->code,ktime_to_us (diff)); -return ; + goto msi_wmi_notify_exit; } last_pressed[key->code -SCANCODE_BASE ] = cur;
@@ -195,6 +195,8 @@ static void msi_wmi_notify(u32 value, void *context)pr_info ("Unknown key pressed - %x\n" , eventcode); }else pr_info ("Unknown event received\n" ); + +msi_wmi_notify_exit:kfree (response.pointer); }
drivers/remoteproc/Kconfig +1 -1
@@ -4,7 +4,7 @@ menu "Remoteproc drivers (EXPERIMENTAL)" config REMOTEPROC tristate depends on EXPERIMENTAL - select FW_CONFIG + select FW_LOADER select VIRTIO config OMAP_REMOTEPROC
drivers/remoteproc/remoteproc_core.c +3 -1
@@ -342,10 +342,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,/* it is now safe to add the virtio device */ ret =rproc_add_virtio_dev (rvdev, rsc->id);if (ret) - goto free_rvdev; + goto remove_rvdev;return 0 ; +remove_rvdev: +list_del (&rvdev->node); free_rvdev:kfree (rvdev);return ret;
drivers/scsi/libsas/sas_expander.c +12 -0
@@ -235,6 +235,17 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) linkrate = phy->linkrate;memcpy (sas_addr, phy->attached_sas_addr,SAS_ADDR_SIZE ); +/* Handle vacant phy - rest of dr data is not valid so skip it */ +if (phy->phy_state ==PHY_VACANT ) { +memset (phy->attached_sas_addr,0 ,SAS_ADDR_SIZE ); + phy->attached_dev_type =NO_DEVICE ; +if (!test_bit (SAS_HA_ATA_EH_ACTIVE , &ha->state)) { + phy->phy_id = phy_id; + goto skip; + }else + goto out; + } + phy->attached_dev_type =to_dev_type (dr);if (test_bit (SAS_HA_ATA_EH_ACTIVE , &ha->state)) goto out;
@@ -272,6 +283,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) phy->phy->maximum_linkrate = dr->pmax_linkrate; phy->phy->negotiated_linkrate = phy->linkrate; + skip:if (new_phy)if (sas_phy_add (phy->phy)) {sas_phy_free (phy->phy);
drivers/spi/spi-mpc512x-psc.c +1 -1
@@ -164,7 +164,7 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,for (i = count; i >0 ; i--) { data = tx_buf ? *tx_buf++ :0 ; -if (len ==EOFBYTE ) +if (len ==EOFBYTE && t->cs_change)setbits32 (&fifo->txcmd, MPC512x_PSC_FIFO_EOF);out_8 (&fifo->txdata_8, data); len--;
drivers/spi/spi-s3c64xx.c +25 -16
59 lines not on this page · raw message
drivers/ssb/driver_chipcommon_pmu.c +29 -0
@@ -645,3 +645,32 @@ u32 ssb_pmu_get_controlclock(struct ssb_chipcommon *cc)return 0 ; } } + +void ssb_pmu_spuravoid_pllupdate (struct ssb_chipcommon *cc,int spuravoid) +{ +u32 pmu_ctl =0 ; + +switch (cc->dev->bus->chip_id) { +case 0x4322 : +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL0 ,0x11100070 ); +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL1 ,0x1014140a ); +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL5 ,0x88888854 ); +if (spuravoid ==1 ) +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL2 ,0x05201828 ); +else +ssb_chipco_pll_write (cc,SSB_PMU1_PLLCTL2 ,0x05001828 ); + pmu_ctl =SSB_CHIPCO_PMU_CTL_PLL_UPD ; +break ; +case 43222 : +/* TODO: BCM43222 requires updating PLLs too */ +return ; +default : + ssb_printk(KERN_ERR PFX +"Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n" , + cc->dev->bus->chip_id); +return ; + } + +chipco_set32 (cc,SSB_CHIPCO_PMU_CTL , pmu_ctl); +} +EXPORT_SYMBOL_GPL (ssb_pmu_spuravoid_pllupdate);
drivers/target/target_core_alua.c +3 -0
@@ -420,6 +420,7 @@ static inline int core_alua_state_standby(case REPORT_LUNS :case RECEIVE_DIAGNOSTIC :case SEND_DIAGNOSTIC : +return 0 ;case MAINTENANCE_IN :switch (cdb[1 ] &0x1f ) {case MI_REPORT_TARGET_PGS :
@@ -462,6 +463,7 @@ static inline int core_alua_state_unavailable(switch (cdb[0 ]) {case INQUIRY :case REPORT_LUNS : +return 0 ;case MAINTENANCE_IN :switch (cdb[1 ] &0x1f ) {case MI_REPORT_TARGET_PGS :
@@ -502,6 +504,7 @@ static inline int core_alua_state_transition(switch (cdb[0 ]) {case INQUIRY :case REPORT_LUNS : +return 0 ;case MAINTENANCE_IN :switch (cdb[1 ] &0x1f ) {case MI_REPORT_TARGET_PGS :
drivers/thermal/thermal_sys.c +1 -0
@@ -1518,6 +1518,7 @@ static int __init thermal_init(void)idr_destroy (&thermal_cdev_idr);mutex_destroy (&thermal_idr_lock);mutex_destroy (&thermal_list_lock); +return result; } result =genetlink_init ();return result;
drivers/tty/tty_io.c +12 -2
@@ -939,6 +939,14 @@ void start_tty(struct tty_struct *tty)EXPORT_SYMBOL (start_tty); +static void tty_update_time (struct timespec *time) +{ +unsigned long sec =get_seconds (); + sec -= sec %60 ; +if ((long )(sec - time->tv_sec) >0 ) + time->tv_sec = sec; +} +/** * tty_read - read method for tty device files * @file: pointer to tty file
@@ -975,8 +983,10 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,else i = -EIO ;tty_ldisc_deref (ld); +if (i >0 ) - inode->i_atime =current_fs_time (inode->i_sb); +tty_update_time (&inode->i_atime); +return i; }
@@ -1079,7 +1089,7 @@ static inline ssize_t do_tty_write( }if (written) {struct inode *inode = file->f_path.dentry->d_inode; - inode->i_mtime =current_fs_time (inode->i_sb); +tty_update_time (&inode->i_mtime); ret = written; } out:
drivers/vfio/pci/vfio_pci.c +2 -1
@@ -315,6 +315,7 @@ static long vfio_pci_ioctl(void *device_data,if (!(hdr.flags &VFIO_IRQ_SET_DATA_NONE )) {size_t size; +int max =vfio_pci_get_irq_count (vdev, hdr.index);if (hdr.flags &VFIO_IRQ_SET_DATA_BOOL ) size =sizeof (uint8_t );
@@ -324,7 +325,7 @@ static long vfio_pci_ioctl(void *device_data,return -EINVAL ;if (hdr.argsz - minsz < hdr.count * size || - hdr.count >vfio_pci_get_irq_count (vdev, hdr.index)) + hdr.start >= max || hdr.start + hdr.count > max)return -EINVAL ; data =kmalloc (hdr.count * size,GFP_KERNEL );
drivers/video/fbmem.c +14 -26
@@ -1371,15 +1371,12 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) {struct fb_info *info =file_fb_info (file);struct fb_ops *fb; -unsigned long off; +unsigned long mmio_pgoff;unsigned long start;u32 len;if (!info)return -ENODEV ; -if (vma->vm_pgoff > (~0UL >>PAGE_SHIFT )) -return -EINVAL ; - off = vma->vm_pgoff <<PAGE_SHIFT ; fb = info->fbops;if (!fb)return -ENODEV ;
@@ -1391,33 +1388,24 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)return res; } -/* frame buffer memory */ +/* +* Ugh. This can be either the frame buffer mapping, or +* if pgoff points past it, the mmio mapping. +*/ start = info->fix.smem_start; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + info->fix.smem_len); -if (off >= len) { -/* memory mapped io */ - off -= len; -if (info->var.accel_flags) { -mutex_unlock (&info->mm_lock); -return -EINVAL ; - } + len = info->fix.smem_len; + mmio_pgoff =PAGE_ALIGN ((start & ~PAGE_MASK ) + len) >>PAGE_SHIFT ; +if (vma->vm_pgoff >= mmio_pgoff) { + vma->vm_pgoff -= mmio_pgoff; start = info->fix.mmio_start; - len =PAGE_ALIGN ((start & ~PAGE_MASK ) + info->fix.mmio_len); + len = info->fix.mmio_len; }mutex_unlock (&info->mm_lock); - start &=PAGE_MASK ; -if ((vma->vm_end - vma->vm_start + off) > len) -return -EINVAL ; - off += start; - vma->vm_pgoff = off >>PAGE_SHIFT ; -/* This is an IO map - tell maydump to skip this VMA */ - vma->vm_flags |=VM_IO |VM_RESERVED ; + vma->vm_page_prot =vm_get_page_prot (vma->vm_flags); -fb_pgprotect (file, vma, off); -if (io_remap_pfn_range (vma, vma->vm_start, off >>PAGE_SHIFT , - vma->vm_end - vma->vm_start, vma->vm_page_prot)) -return -EAGAIN ; -return 0 ; +fb_pgprotect (file, vma, start); + +return vm_iomap_memory (vma, start, len); } static int
fs/aio.c +1 -1
@@ -1027,9 +1027,9 @@ static int aio_read_evt(struct kioctx *ioctx, struct io_event *ent)spin_unlock (&info->ring_lock); out: -kunmap_atomic (ring);dprintk ("leaving aio_read_evt: %d h%lu t%lu\n" , ret, (unsigned long )ring->head, (unsigned long )ring->tail); +kunmap_atomic (ring);return ret; }
fs/btrfs/tree-log.c +42 -6
91 lines not on this page · raw message
fs/cifs/connect.c +13 -3
@@ -1489,14 +1489,24 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, }break ;case Opt_blank_pass: - vol->password =NULL ; -break ; -case Opt_pass:/* passwords have to be handled differently * to allow the character used for deliminator * to be passed within them */ +/* +* Check if this is a case where the password +* starts with a delimiter +*/ + tmp_end =strchr (data,'=' ); + tmp_end++; +if (!(tmp_end < end && tmp_end[1 ] == delim)) { +/* No it is not. Set the password to NULL */ + vol->password =NULL ; +break ; + } +/* Yes it is. Drop down to Opt_pass below.*/ +case Opt_pass:/* Obtain the value string */ value =strchr (data,'=' ); value++;
fs/gfs2/file.c +4 -1
@@ -926,8 +926,11 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) cmd =F_SETLK ; fl->fl_type =F_UNLCK ; } -if (unlikely (test_bit (SDF_SHUTDOWN , &sdp->sd_flags))) +if (unlikely (test_bit (SDF_SHUTDOWN , &sdp->sd_flags))) { +if (fl->fl_type ==F_UNLCK ) +posix_lock_file_wait (file, fl);return -EIO ; + }if (IS_GETLK (cmd))return dlm_posix_get (ls->ls_dlm, ip->i_no_addr, file, fl);else if (fl->fl_type ==F_UNLCK )
fs/hfsplus/extents.c +1 -1
@@ -517,7 +517,7 @@ void hfsplus_file_truncate(struct inode *inode)struct address_space *mapping = inode->i_mapping;struct page *page;void *fsdata; -u32 size = inode->i_size; +loff_t size = inode->i_size; res = pagecache_write_begin(NULL, mapping, size, 0, AOP_FLAG_UNINTERRUPTIBLE,
fs/inode.c +1 -1
@@ -725,7 +725,7 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)* inode to the back of the list so we don't spin on it. */ if (!spin_trylock (&inode->i_lock)) { -list_move_tail (&inode->i_lru, &sb->s_inode_lru); +list_move (&inode->i_lru, &sb->s_inode_lru);continue ; }
fs/ubifs/super.c +6 -6
@@ -1576,6 +1576,12 @@ static int ubifs_remount_rw(struct ubifs_info *c) c->remounting_rw =1 ; c->ro_mount =0 ; +if (c->space_fixup) { + err =ubifs_fixup_free_space (c); +if (err) +return err; + } + err =check_free_space (c);if (err) goto out;
@@ -1692,12 +1698,6 @@ static int ubifs_remount_rw(struct ubifs_info *c) err =dbg_check_space_info (c); } -if (c->space_fixup) { - err =ubifs_fixup_free_space (c); -if (err) - goto out; - } -mutex_unlock (&c->umount_mutex);return err;
include/asm-generic/tlb.h +6 -1
@@ -91,7 +91,12 @@ struct mmu_gather { unsigned int need_flush : 1, /* Did free PTEs */ fast_mode : 1; /* No batching */ -unsigned int fullmm; +/* we are in the middle of an operation to clear +* a full mm and can make some optimizations */ + unsigned int fullmm : 1, +/* we have performed an operation which +* requires a complete flush of the tlb */ + need_flush_all : 1;struct mmu_gather_batch *active;struct mmu_gather_batch local;
include/linux/ata.h +1 -1
@@ -938,7 +938,7 @@ static inline int atapi_cdb_len(const u16 *dev_id) } } -static inline bool atapi_command_packet_set (const u16 *dev_id) +static inline int atapi_command_packet_set (const u16 *dev_id) {return (dev_id[ATA_ID_CONFIG ] >>8 ) &0x1f ; }
include/linux/capability.h +2 -0
@@ -377,6 +377,7 @@ struct cpu_vfs_cap_data {#ifdef __KERNEL__ +struct file ;struct inode ;struct dentry ;struct user_namespace ;
@@ -553,6 +554,7 @@ extern bool capable(int cap);extern bool ns_capable (struct user_namespace *ns,int cap);extern bool nsown_capable (int cap);extern bool inode_capable (const struct inode *inode,int cap); +extern bool file_ns_capable (const struct file *file,struct user_namespace *ns,int cap);/* audit system wants to get cap info from files as well */ extern int get_vfs_caps_from_disk (const struct dentry *dentry,struct cpu_vfs_cap_data *cpu_caps);
include/linux/ftrace.h +2 -1
@@ -305,7 +305,6 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, size_t cnt, loff_t *ppos);ssize_t ftrace_notrace_write (struct file *file,const char __user *ubuf,size_t cnt,loff_t *ppos); -loff_t ftrace_regex_lseek (struct file *file,loff_t offset,int origin);int ftrace_regex_release (struct inode *inode,struct file *file);void __init
@@ -429,6 +428,8 @@ static inline int ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }#endif /* CONFIG_DYNAMIC_FTRACE */ +loff_t ftrace_filter_lseek (struct file *file,loff_t offset,int whence); +/* totally disable ftrace - can not re-enable after this */ void ftrace_kill (void );
include/linux/kref.h +21 -0
@@ -111,4 +111,25 @@ static inline int kref_put_mutex(struct kref *kref, }return 0 ; } + +/** +* kref_get_unless_zero - Increment refcount for object unless it is zero. +* @kref: object. +* +* Return non-zero if the increment succeeded. Otherwise return 0. +* +* This function is intended to simplify locking around refcounting for +* objects that can be looked up from a lookup structure, and which are +* removed from that lookup structure in the object destructor. +* Operations on such objects require at least a read lock around +* lookup + kref_get, and a write lock around kref_put + remove from lookup +* structure. Furthermore, RCU implementations become extremely tricky. +* With a lookup followed by a kref_get_unless_zero *with return value check* +* locking in the kref_put path can be deferred to the actual removal from +* the lookup structure and RCU lookups become trivial. +*/ +static inline int __must_check kref_get_unless_zero (struct kref *kref) +{ +return atomic_add_unless (&kref->refcount,1 ,0 ); +}#endif /* _KREF_H_ */
include/linux/kvm_host.h +1 -1
@@ -456,7 +456,7 @@ int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data,int kvm_write_guest_cached (struct kvm *kvm,struct gfn_to_hva_cache *ghc,void *data,unsigned long len);int kvm_gfn_to_hva_cache_init (struct kvm *kvm,struct gfn_to_hva_cache *ghc, -gpa_t gpa); +gpa_t gpa,unsigned long len);int kvm_clear_guest_page (struct kvm *kvm,gfn_t gfn,int offset,int len);int kvm_clear_guest (struct kvm *kvm,gpa_t gpa,unsigned long len);struct kvm_memory_slot *gfn_to_memslot (struct kvm *kvm,gfn_t gfn);
include/linux/kvm_types.h +1 -0
@@ -71,6 +71,7 @@ struct gfn_to_hva_cache {u64 generation;gpa_t gpa;unsigned long hva; +unsigned long len;struct kvm_memory_slot *memslot; };
include/linux/libata.h +1 -0
@@ -395,6 +395,7 @@ enum {ATA_HORKAGE_NOSETXFER = (1 <<14 ),/* skip SETXFER, SATA only */ ATA_HORKAGE_BROKEN_FPDMA_AA = (1 <<15 ),/* skip AA */ ATA_HORKAGE_DUMP_ID = (1 <<16 ),/* dump IDENTIFY data */ + ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 *//* DMA mask for user DMA control: User visible values; DO NOT renumber */
include/linux/mm.h +2 -0
@@ -1534,6 +1534,8 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn);int vm_insert_mixed (struct vm_area_struct *vma,unsigned long addr,unsigned long pfn); +int vm_iomap_memory (struct vm_area_struct *vma,phys_addr_t start,unsigned long len); +struct page *follow_page (struct vm_area_struct *,unsigned long address,unsigned int foll_flags);
include/linux/netdevice.h +1 -1
@@ -233,9 +233,9 @@ struct netdev_hw_addr {#define NETDEV_HW_ADDR_T_SLAVE 3#define NETDEV_HW_ADDR_T_UNICAST 4#define NETDEV_HW_ADDR_T_MULTICAST 5 -bool synced;bool global_use;int refcount; +int synced;struct rcu_head rcu_head; };
include/linux/preempt.h +14 -8
@@ -93,14 +93,20 @@ do { \#else /* !CONFIG_PREEMPT_COUNT */ -#define preempt_disable () do { } while (0) -#define sched_preempt_enable_no_resched () do { } while (0) -#define preempt_enable_no_resched () do { } while (0) -#define preempt_enable () do { } while (0) - -#define preempt_disable_notrace () do { } while (0) -#define preempt_enable_no_resched_notrace () do { } while (0) -#define preempt_enable_notrace () do { } while (0) +/* +* Even if we don't have any preemption, we need preempt disable/enable +* to be barriers, so that we don't have things like get_user/put_user +* that can cause faults and scheduling migrate into our preempt-protected +* region. +*/ +#define preempt_disable () barrier() +#define sched_preempt_enable_no_resched () barrier() +#define preempt_enable_no_resched () barrier() +#define preempt_enable () barrier() + +#define preempt_disable_notrace () barrier() +#define preempt_enable_no_resched_notrace () barrier() +#define preempt_enable_notrace () barrier()#endif /* CONFIG_PREEMPT_COUNT */
include/linux/socket.h +2 -1
@@ -317,7 +317,8 @@ struct ucred {/* IPX options */ #define IPX_TYPE 1 -extern void cred_to_ucred (struct pid *pid,const struct cred *cred,struct ucred *ucred); +extern void cred_to_ucred (struct pid *pid,const struct cred *cred,struct ucred *ucred, +bool use_effective);extern int memcpy_fromiovec (unsigned char *kdata,struct iovec *iov,int len); extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
include/linux/spinlock_up.h +18 -11
@@ -16,7 +16,10 @@* In the debug case, 1 means unlocked, 0 means locked. (the values * are inverted, to catch initialization bugs) * -* No atomicity anywhere, we are on UP. +* No atomicity anywhere, we are on UP. However, we still need +* the compiler barriers, because we do not want the compiler to +* move potentially faulting instructions (notably user accesses) +* into the locked sequence, resulting in non-atomic execution. */ #ifdef CONFIG_DEBUG_SPINLOCK
@@ -25,6 +28,7 @@static inline void arch_spin_lock (arch_spinlock_t *lock) { lock->slock =0 ; +barrier (); } static inline void
@@ -32,6 +36,7 @@ arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags) {local_irq_save (flags); lock->slock =0 ; +barrier (); }static inline int arch_spin_trylock (arch_spinlock_t *lock)
@@ -39,32 +44,34 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)char oldval = lock->slock; lock->slock =0 ; +barrier (); return oldval > 0; }static inline void arch_spin_unlock (arch_spinlock_t *lock) { +barrier (); lock->slock =1 ; }/* * Read-write spinlocks. No debug version. */ -#define arch_read_lock (lock) do { (void)(lock); } while (0) -#define arch_write_lock (lock) do { (void)(lock); } while (0) -#define arch_read_trylock (lock) ({ (void)(lock); 1; }) -#define arch_write_trylock (lock) ({ (void)(lock); 1; }) -#define arch_read_unlock (lock) do { (void)(lock); } while (0) -#define arch_write_unlock (lock) do { (void)(lock); } while (0) +#define arch_read_lock (lock) do { barrier(); (void)(lock); } while (0) +#define arch_write_lock (lock) do { barrier(); (void)(lock); } while (0) +#define arch_read_trylock (lock) ({ barrier(); (void)(lock); 1; }) +#define arch_write_trylock (lock) ({ barrier(); (void)(lock); 1; }) +#define arch_read_unlock (lock) do { barrier(); (void)(lock); } while (0) +#define arch_write_unlock (lock) do { barrier(); (void)(lock); } while (0)#else /* DEBUG_SPINLOCK */ #define arch_spin_is_locked (lock) ((void)(lock), 0)/* for sched.c and kernel_lock.c: */ -# define arch_spin_lock (lock) do { (void)(lock); } while (0) -# define arch_spin_lock_flags (lock, flags) do { (void)(lock); } while (0) -# define arch_spin_unlock (lock) do { (void)(lock); } while (0) -# define arch_spin_trylock (lock) ({ (void)(lock); 1; }) +# define arch_spin_lock (lock) do { barrier(); (void)(lock); } while (0) +# define arch_spin_lock_flags (lock, flags) do { barrier(); (void)(lock); } while (0) +# define arch_spin_unlock (lock) do { barrier(); (void)(lock); } while (0) +# define arch_spin_trylock (lock) ({ barrier(); (void)(lock); 1; })#endif /* DEBUG_SPINLOCK */ #define arch_spin_is_contended (lock) (((void)(lock), 0))
include/linux/ssb/ssb_driver_chipcommon.h +2 -0
@@ -219,6 +219,7 @@#define SSB_CHIPCO_PMU_CTL 0x0600/* PMU control */ #define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000/* ILP div mask */ #define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16 +#define SSB_CHIPCO_PMU_CTL_PLL_UPD 0x00000400#define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200/* No ILP on wait */ #define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100/* HT req enable */ #define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080/* ALP req enable */
@@ -661,5 +662,6 @@ enum ssb_pmu_ldo_volt_id {void ssb_pmu_set_ldo_voltage (struct ssb_chipcommon *cc,enum ssb_pmu_ldo_volt_id id,u32 voltage);void ssb_pmu_set_ldo_paref (struct ssb_chipcommon *cc,bool on); +void ssb_pmu_spuravoid_pllupdate (struct ssb_chipcommon *cc,int spuravoid);#endif /* LINUX_SSB_CHIPCO_H_ */
include/net/scm.h +1 -1
@@ -49,7 +49,7 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm, { scm->pid =get_pid (pid); scm->cred = cred ?get_cred (cred) :NULL ; -cred_to_ucred (pid, cred, &scm->creds); +cred_to_ucred (pid, cred, &scm->creds, false); }static __inline__void scm_destroy_cred (struct scm_cookie *scm)
kernel/capability.c +24 -0
@@ -393,6 +393,30 @@ bool ns_capable(struct user_namespace *ns, int cap)EXPORT_SYMBOL (ns_capable);/** +* file_ns_capable - Determine if the file's opener had a capability in effect +* @file: The file we want to check +* @ns: The usernamespace we want the capability in +* @cap: The capability to be tested for +* +* Return true if task that opened the file had a capability in effect +* when the file was opened. +* +* This does not set PF_SUPERPRIV because the caller may not +* actually be privileged. +*/ +bool file_ns_capable (const struct file *file,struct user_namespace *ns,int cap) +{ +if (WARN_ON_ONCE (!cap_valid (cap))) +return false; + +if (security_capable (file->f_cred, ns, cap) ==0 ) +return true; + +return false; +} +EXPORT_SYMBOL (file_ns_capable); + +/** * capable - Determine if the current task has a superior capability in effect * @cap: The capability to be tested for *
kernel/events/core.c +1 -1
@@ -5131,7 +5131,7 @@ static void sw_perf_event_destroy(struct perf_event *event)static int perf_swevent_init (struct perf_event *event) { -int event_id = event->attr.config; +u64 event_id = event->attr.config;if (event->attr.type !=PERF_TYPE_SOFTWARE )return -ENOENT ;
kernel/hrtimer.c +1 -2
@@ -61,6 +61,7 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) = { + .lock =__RAW_SPIN_LOCK_UNLOCKED (hrtimer_bases.lock), .clock_base = { {
@@ -1640,8 +1641,6 @@ static void __cpuinit init_hrtimers_cpu(int cpu)struct hrtimer_cpu_base *cpu_base = &per_cpu (hrtimer_bases, cpu);int i; -raw_spin_lock_init (&cpu_base->lock); -for (i =0 ; i <HRTIMER_MAX_CLOCK_BASES ; i++) { cpu_base->clock_base[i].cpu_base = cpu_base;timerqueue_init_head (&cpu_base->clock_base[i].active);
kernel/sched/clock.c +26 -0
@@ -176,10 +176,36 @@ static u64 sched_clock_remote(struct sched_clock_data *scd)u64 this_clock, remote_clock;u64 *ptr, old_val, val; +#if BITS_PER_LONG !=64 +again: +/* +* Careful here: The local and the remote clock values need to +* be read out atomic as we need to compare the values and +* then update either the local or the remote side. So the +* cmpxchg64 below only protects one readout. +* +* We must reread via sched_clock_local() in the retry case on +* 32bit as an NMI could use sched_clock_local() via the +* tracer and hit between the readout of +* the low32bit and the high 32bit portion. +*/ + this_clock =sched_clock_local (my_scd); +/* +* We must enforce atomic readout on 32bit, otherwise the +* update on the remote cpu can hit inbetween the readout of +* the low32bit and the high 32bit portion. +*/ + remote_clock =cmpxchg64 (&scd->clock,0 ,0 ); +#else +/* +* On 64bit the read of [my]scd->clock is atomic versus the +* update, so we can avoid the above 32bit dance. +*/ sched_clock_local (my_scd); again: this_clock = my_scd->clock; remote_clock = scd->clock; +#endif /* * Use the opportunity that we have both locks
kernel/sched/core.c +4 -2
@@ -1651,8 +1651,10 @@ static void try_to_wake_up_local(struct task_struct *p) {struct rq *rq =task_rq (p); -BUG_ON (rq !=this_rq ()); -BUG_ON (p == current); +if (WARN_ON_ONCE (rq !=this_rq ()) || +WARN_ON_ONCE (p == current)) +return ; +lockdep_assert_held (&rq->lock);if (!raw_spin_trylock (&p->pi_lock)) {
kernel/signal.c +1 -1
@@ -2898,7 +2898,7 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info)static int do_tkill (pid_t tgid,pid_t pid,int sig) { -struct siginfo info; +struct siginfo info = {}; info.si_signo = sig; info.si_errno =0 ;
kernel/sys.c +2 -1
@@ -323,7 +323,6 @@ void kernel_restart_prepare(char *cmd) system_state =SYSTEM_RESTART ;usermodehelper_disable ();device_shutdown (); -syscore_shutdown (); }/**
@@ -369,6 +368,7 @@ void kernel_restart(char *cmd) {kernel_restart_prepare (cmd);disable_nonboot_cpus (); +syscore_shutdown ();if (!cmd)printk (KERN_EMERG "Restarting system.\n" );else
@@ -394,6 +394,7 @@ static void kernel_shutdown_prepare(enum system_states state)void kernel_halt (void ) {kernel_shutdown_prepare (SYSTEM_HALT ); +disable_nonboot_cpus ();syscore_shutdown ();printk (KERN_EMERG "System halted.\n" );kmsg_dump (KMSG_DUMP_HALT );
kernel/trace/ftrace.c +8 -13
@@ -642,7 +642,6 @@ int ftrace_profile_pages_init(struct ftrace_profile_stat *stat)free_page (tmp); } -free_page ((unsigned long )stat->pages); stat->pages =NULL ; stat->start =NULL ;
@@ -2510,7 +2509,7 @@ static void ftrace_filter_reset(struct ftrace_hash *hash)* routine, you can use ftrace_filter_write() for the write * routine if @flag has FTRACE_ITER_FILTER set, or * ftrace_notrace_write() if @flag has FTRACE_ITER_NOTRACE set. -* ftrace_regex_lseek() should be used as the lseek routine, and +* ftrace_filter_lseek() should be used as the lseek routine, and * release must call ftrace_regex_release(). */ int
@@ -2595,7 +2594,7 @@ ftrace_notrace_open(struct inode *inode, struct file *file) }loff_t -ftrace_regex_lseek (struct file *file,loff_t offset,int origin) +ftrace_filter_lseek (struct file *file,loff_t offset,int origin) {loff_t ret;
@@ -3414,7 +3413,7 @@ static const struct file_operations ftrace_filter_fops = { .open = ftrace_filter_open, .read = seq_read, .write = ftrace_filter_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, };
@@ -3422,7 +3421,7 @@ static const struct file_operations ftrace_notrace_fops = { .open = ftrace_notrace_open, .read = seq_read, .write = ftrace_notrace_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, };
@@ -3627,8 +3626,8 @@ static const struct file_operations ftrace_graph_fops = { .open = ftrace_graph_open, .read = seq_read, .write = ftrace_graph_write, + .llseek = ftrace_filter_lseek, .release = ftrace_graph_release, - .llseek = seq_lseek, };#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
@@ -4237,7 +4236,7 @@ static const struct file_operations ftrace_pid_fops = { .open = ftrace_pid_open, .write = ftrace_pid_write, .read = seq_read, - .llseek = seq_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_pid_release, };
@@ -4353,12 +4352,8 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,ftrace_startup_sysctl ();/* we are starting ftrace again */ -if (ftrace_ops_list != &ftrace_list_end) { -if (ftrace_ops_list->next == &ftrace_list_end) - ftrace_trace_function = ftrace_ops_list->func; -else - ftrace_trace_function = ftrace_ops_list_func; - } +if (ftrace_ops_list != &ftrace_list_end) +update_ftrace_function (); }else {/* stopping ftrace calls (just send to ftrace_stub) */
kernel/trace/trace_stack.c +1 -1
@@ -324,7 +324,7 @@ static const struct file_operations stack_trace_filter_fops = { .open = stack_trace_filter_open, .read = seq_read, .write = ftrace_filter_write, - .llseek = ftrace_regex_lseek, + .llseek = ftrace_filter_lseek, .release = ftrace_regex_release, };
lib/kobject.c +8 -1
@@ -529,6 +529,13 @@ struct kobject *kobject_get(struct kobject *kobj)return kobj; } +static struct kobject *kobject_get_unless_zero (struct kobject *kobj) +{ +if (!kref_get_unless_zero (&kobj->kref)) + kobj =NULL ; +return kobj; +} +/* * kobject_cleanup - free kobject resources. * @kobj: object to cleanup
@@ -751,7 +758,7 @@ struct kobject *kset_find_obj(struct kset *kset, const char *name)list_for_each_entry (k, &kset->list, entry) {if (kobject_name (k) && !strcmp (kobject_name (k), name)) { - ret =kobject_get (k); + ret =kobject_get_unless_zero (k);break ; } }
mm/hugetlb.c +11 -1
@@ -2963,7 +2963,17 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,break ; } -if (absent || +/* +* We need call hugetlb_fault for both hugepages under migration +* (in which case hugetlb_fault waits for the migration,) and +* hwpoisoned hugepages (in which case we need to prevent the +* caller from accessing to them.) In order to do this, we use +* here is_swap_pte instead of is_hugetlb_entry_migration and +* is_hugetlb_entry_hwpoisoned. This is because it simply covers +* both cases, and because we can't follow correct pages +* directly from any kind of swap entries. +*/ +if (absent ||is_swap_pte (huge_ptep_get (pte)) || ((flags &FOLL_WRITE ) && !pte_write (huge_ptep_get (pte)))) {int ret;
mm/memory.c +48 -0
60 lines not on this page · raw message
mm/mmap.c +1 -1
@@ -1611,7 +1611,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)/* Check the cache first. */ /* (Cache hit rate is typically around 35%.) */ - vma = mm->mmap_cache; + vma =ACCESS_ONCE (mm->mmap_cache);if (!(vma && vma->vm_end > addr && vma->vm_start <= addr)) {struct rb_node *rb_node;
mm/nommu.c +1 -1
@@ -807,7 +807,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)struct vm_area_struct *vma;/* check the cache first */ - vma = mm->mmap_cache; + vma =ACCESS_ONCE (mm->mmap_cache);if (vma && vma->vm_start <= addr && vma->vm_end > addr)return vma;
net/atm/common.c +2 -0
@@ -520,6 +520,8 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,struct sk_buff *skb;int copied, error = -EINVAL ; + msg->msg_namelen =0 ; +if (sock->state !=SS_CONNECTED )return -ENOTCONN ;
net/ax25/af_ax25.c +1 -0
@@ -1647,6 +1647,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,ax25_address src;const unsigned char *mac =skb_mac_header (skb); +memset (sax,0 ,sizeof (struct full_sockaddr_ax25 ));ax25_addr_parse (mac +1 , skb->data - mac -1 , &src,NULL , &digi,NULL ,NULL ); sax->sax25_family =AF_AX25 ;
net/bluetooth/af_bluetooth.c +2 -2
@@ -229,6 +229,8 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,if (flags & (MSG_OOB ))return -EOPNOTSUPP ; + msg->msg_namelen =0 ; + skb =skb_recv_datagram (sk, flags, noblock, &err);if (!skb) {if (sk->sk_shutdown &RCV_SHUTDOWN )
@@ -236,8 +238,6 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,return err; } - msg->msg_namelen =0 ; - copied = skb->len;if (len < copied) { msg->msg_flags |=MSG_TRUNC ;
net/bluetooth/rfcomm/sock.c +1 -0
@@ -610,6 +610,7 @@ static int rfcomm_sock_recvmsg(struct kiocb *iocb, struct socket *sock,if (test_and_clear_bit (RFCOMM_DEFER_SETUP , &d->flags)) {rfcomm_dlc_accept (d); + msg->msg_namelen =0 ;return 0 ; }
net/caif/caif_socket.c +2 -0
@@ -286,6 +286,8 @@ static int caif_seqpkt_recvmsg(struct kiocb *iocb, struct socket *sock,if (m->msg_flags&MSG_OOB ) goto read_error; + m->msg_namelen =0 ; + skb =skb_recv_datagram (sk, flags,0 , &ret);if (!skb) goto read_error;
net/can/gw.c +3 -3
@@ -436,7 +436,7 @@ static int cgw_notifier(struct notifier_block *nb,if (gwj->src.dev == dev || gwj->dst.dev == dev) {hlist_del (&gwj->list);cgw_unregister_filter (gwj); -kfree (gwj); +kmem_cache_free (cgw_cache, gwj); } } }
@@ -826,7 +826,7 @@ static void cgw_remove_all_jobs(void)hlist_for_each_entry_safe (gwj, n, nx, &cgw_list, list) {hlist_del (&gwj->list);cgw_unregister_filter (gwj); -kfree (gwj); +kmem_cache_free (cgw_cache, gwj); } }
@@ -879,7 +879,7 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)hlist_del (&gwj->list);cgw_unregister_filter (gwj); -kfree (gwj); +kmem_cache_free (cgw_cache, gwj); err =0 ;break ; }
net/core/dev.c +3 -0
@@ -1907,6 +1907,9 @@ static void skb_warn_bad_offload(const struct sk_buff *skb)struct net_device *dev = skb->dev;const char *driver ="" ; +if (!net_ratelimit ()) +return ; +if (dev && dev->dev.parent) driver =dev_driver_string (dev->dev.parent);
net/core/dev_addr_lists.c +3 -3
@@ -38,7 +38,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list, ha->type = addr_type; ha->refcount =1 ; ha->global_use = global; - ha->synced = false; + ha->synced =0 ;list_add_tail_rcu (&ha->list, &list->list); list->count++;
@@ -164,7 +164,7 @@ int __hw_addr_sync(struct netdev_hw_addr_list *to_list, addr_len, ha->type);if (err)break ; - ha->synced = true; + ha->synced++; ha->refcount++; }else if (ha->refcount ==1 ) {__hw_addr_del (to_list, ha->addr, addr_len, ha->type);
@@ -185,7 +185,7 @@ void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,if (ha->synced) {__hw_addr_del (to_list, ha->addr, addr_len, ha->type); - ha->synced = false; + ha->synced--;__hw_addr_del (from_list, ha->addr, addr_len, ha->type); }
net/core/rtnetlink.c +2 -2
@@ -1068,7 +1068,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)rcu_read_lock (); cb->seq = net->dev_base_seq; -if (nlmsg_parse (cb->nlh,sizeof (struct rtgenmsg ), tb,IFLA_MAX , +if (nlmsg_parse (cb->nlh,sizeof (struct ifinfomsg ), tb,IFLA_MAX , ifla_policy) >=0 ) {if (tb[IFLA_EXT_MASK ])
@@ -1918,7 +1918,7 @@ static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)u32 ext_filter_mask =0 ;u16 min_ifinfo_dump_size =0 ; -if (nlmsg_parse (nlh,sizeof (struct rtgenmsg ), tb,IFLA_MAX , +if (nlmsg_parse (nlh,sizeof (struct ifinfomsg ), tb,IFLA_MAX , ifla_policy) >=0 ) {if (tb[IFLA_EXT_MASK ]) ext_filter_mask =nla_get_u32 (tb[IFLA_EXT_MASK ]);
net/core/sock.c +10 -4
@@ -862,15 +862,20 @@ EXPORT_SYMBOL(sock_setsockopt);void cred_to_ucred (struct pid *pid,const struct cred *cred, -struct ucred *ucred) +struct ucred *ucred,bool use_effective) { ucred->pid =pid_vnr (pid); ucred->uid = ucred->gid =-1 ;if (cred) {struct user_namespace *current_ns =current_user_ns (); - ucred->uid =from_kuid (current_ns, cred->euid); - ucred->gid =from_kgid (current_ns, cred->egid); +if (use_effective) { + ucred->uid =from_kuid (current_ns, cred->euid); + ucred->gid =from_kgid (current_ns, cred->egid); + }else { + ucred->uid =from_kuid (current_ns, cred->uid); + ucred->gid =from_kgid (current_ns, cred->gid); + } } }EXPORT_SYMBOL_GPL (cred_to_ucred);
@@ -1031,7 +1036,8 @@ int sock_getsockopt(struct socket *sock, int level, int optname,struct ucred peercred;if (len >sizeof (peercred)) len =sizeof (peercred); -cred_to_ucred (sk->sk_peer_pid, sk->sk_peer_cred, &peercred); +cred_to_ucred (sk->sk_peer_pid, sk->sk_peer_cred, + &peercred, true);if (copy_to_user (optval, &peercred, len))return -EFAULT ; goto lenout;
net/ipv4/esp4.c +3 -3
@@ -139,8 +139,6 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)/* skb is pure payload to encrypt */ - err = -ENOMEM ; - esp = x->data; aead = esp->aead; alen =crypto_aead_authsize (aead);
@@ -176,8 +174,10 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) } tmp =esp_alloc_tmp (aead, nfrags + sglists, seqhilen); -if (!tmp) +if (!tmp) { + err = -ENOMEM ; goto error; + } seqhi =esp_tmp_seqhi (tmp); iv =esp_tmp_iv (aead, tmp, seqhilen);
net/ipv4/ip_fragment.c +11 -4
@@ -255,8 +255,7 @@ static void ip_expire(unsigned long arg)if (!head->dev) goto out_rcu_unlock; -/* skb dst is stale, drop it, and perform route lookup again */ -skb_dst_drop (head); +/* skb has no dst, perform route lookup again */ iph =ip_hdr (head); err =ip_route_input_noref (head, iph->daddr, iph->saddr, iph->tos, head->dev);
@@ -521,8 +520,16 @@ found: qp->q.last_in |=INET_FRAG_FIRST_IN ;if (qp->q.last_in == (INET_FRAG_FIRST_IN |INET_FRAG_LAST_IN ) && - qp->q.meat == qp->q.len) -return ip_frag_reasm (qp, prev, dev); + qp->q.meat == qp->q.len) { +unsigned long orefdst = skb->_skb_refdst; + + skb->_skb_refdst =0UL ; + err =ip_frag_reasm (qp, prev, dev); + skb->_skb_refdst = orefdst; +return err; + } + +skb_dst_drop (skb);write_lock (&ip4_frags.lock);list_move_tail (&qp->q.lru_list, &qp->q.net->lru_list);
net/ipv4/syncookies.c +2 -2
@@ -347,8 +347,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,* hasn't changed since we received the original syn, but I see * no easy way to do this. */ -flowi4_init_output (&fl4,0 , sk->sk_mark,RT_CONN_FLAGS (sk), -RT_SCOPE_UNIVERSE ,IPPROTO_TCP , +flowi4_init_output (&fl4, sk->sk_bound_dev_if, sk->sk_mark, +RT_CONN_FLAGS (sk),RT_SCOPE_UNIVERSE ,IPPROTO_TCP ,inet_sk_flowi_flags (sk), (opt && opt->srr) ? opt->faddr : ireq->rmt_addr, ireq->loc_addr, th->source, th->dest);
net/ipv4/tcp_input.c +32 -33
109 lines not on this page · raw message
net/ipv4/tcp_output.c +6 -2
@@ -2380,8 +2380,12 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)*/ TCP_SKB_CB (skb)->when = tcp_time_stamp; -/* make sure skb->data is aligned on arches that require it */ -if (unlikely (NET_IP_ALIGN && ((unsigned long )skb->data &3 ))) { +/* make sure skb->data is aligned on arches that require it +* and check if ack-trimming & collapsing extended the headroom +* beyond what csum_start can cover. +*/ +if (unlikely ((NET_IP_ALIGN && ((unsigned long )skb->data &3 )) || +skb_headroom (skb) >=0xFFFF )) {struct sk_buff *nskb =__pskb_copy (skb,MAX_TCP_HEADER ,GFP_ATOMIC ); err = nskb ? tcp_transmit_skb(sk, nskb, 0, GFP_ATOMIC) :
net/ipv6/addrconf.c +27 -0
@@ -2397,6 +2397,9 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)static void init_loopback (struct net_device *dev) {struct inet6_dev *idev; +struct net_device *sp_dev; +struct inet6_ifaddr *sp_ifa; +struct rt6_info *sp_rt;/* ::1 */
@@ -2408,6 +2411,30 @@ static void init_loopback(struct net_device *dev) }add_addr (idev, &in6addr_loopback,128 ,IFA_HOST ); + +/* Add routes to other interface's IPv6 addresses */ +for_each_netdev (dev_net (dev), sp_dev) { +if (!strcmp (sp_dev->name, dev->name)) +continue ; + + idev =__in6_dev_get (sp_dev); +if (!idev) +continue ; + +read_lock_bh (&idev->lock); +list_for_each_entry (sp_ifa, &idev->addr_list, if_list) { + +if (sp_ifa->flags & (IFA_F_DADFAILED |IFA_F_TENTATIVE )) +continue ; + + sp_rt =addrconf_dst_alloc (idev, &sp_ifa->addr,0 ); + +/* Failure cases are ignored */ +if (!IS_ERR (sp_rt)) +ip6_ins_rt (sp_rt); + } +read_unlock_bh (&idev->lock); + } }static void addrconf_add_linklocal (struct inet6_dev *idev,const struct in6_addr *addr)
net/ipv6/reassembly.c +11 -2
@@ -386,8 +386,17 @@ found: }if (fq->q.last_in == (INET_FRAG_FIRST_IN |INET_FRAG_LAST_IN ) && - fq->q.meat == fq->q.len) -return ip6_frag_reasm (fq, prev, dev); + fq->q.meat == fq->q.len) { +int res; +unsigned long orefdst = skb->_skb_refdst; + + skb->_skb_refdst =0UL ; + res =ip6_frag_reasm (fq, prev, dev); + skb->_skb_refdst = orefdst; +return res; + } + +skb_dst_drop (skb);write_lock (&ip6_frags.lock);list_move_tail (&fq->q.lru_list, &fq->q.net->lru_list);
net/ipv6/tcp_ipv6.c +1 -0
@@ -397,6 +397,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,if (dst) dst->ops->redirect (dst, sk, skb); + goto out; }if (type ==ICMPV6_PKT_TOOBIG ) {
net/irda/af_irda.c +2 -0
@@ -1386,6 +1386,8 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,IRDA_DEBUG (4 ,"%s()\n" , __func__); + msg->msg_namelen =0 ; + skb =skb_recv_datagram (sk, flags & ~MSG_DONTWAIT , flags &MSG_DONTWAIT , &err);if (!skb)
net/iucv/af_iucv.c +2 -0
@@ -1331,6 +1331,8 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,struct sk_buff *skb, *rskb, *cskb;int err =0 ; + msg->msg_namelen =0 ; + if ((sk->sk_state == IUCV_DISCONN) && skb_queue_empty(&iucv->backlog_skb_q) && skb_queue_empty(&sk->sk_receive_queue) &&
net/l2tp/l2tp_ip6.c +1 -0
@@ -684,6 +684,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, lsa->l2tp_addr =ipv6_hdr (skb)->saddr; lsa->l2tp_flowinfo =0 ; lsa->l2tp_scope_id =0 ; + lsa->l2tp_conn_id =0 ;if (ipv6_addr_type (&lsa->l2tp_addr) &IPV6_ADDR_LINKLOCAL ) lsa->l2tp_scope_id =IP6CB (skb)->iif; }
net/llc/af_llc.c +2 -0
@@ -720,6 +720,8 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,int target;/* Read at least this many bytes */ long timeo; + msg->msg_namelen =0 ; +lock_sock (sk); copied = -ENOTCONN ;if (unlikely (sk->sk_type ==SOCK_STREAM && sk->sk_state ==TCP_LISTEN ))
net/mac80211/cfg.c +4 -2
@@ -2337,7 +2337,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,list_del (&dep->list);mutex_unlock (&local->mtx); -ieee80211_roc_notify_destroy (dep); +ieee80211_roc_notify_destroy (dep, true);return 0 ; }
@@ -2377,7 +2377,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,ieee80211_start_next_roc (local);mutex_unlock (&local->mtx); -ieee80211_roc_notify_destroy (found); +ieee80211_roc_notify_destroy (found, true); }else {/* work may be pending so use it all the time */ found->abort = true;
@@ -2387,6 +2387,8 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,/* work will clean up etc */ flush_delayed_work (&found->work); +WARN_ON (!found->to_be_freed); +kfree (found); }return 0 ;
net/mac80211/ieee80211_i.h +2 -1
@@ -339,6 +339,7 @@ struct ieee80211_roc_work {enum nl80211_channel_type chan_type;bool started, abort, hw_begun, notified; +bool to_be_freed;unsigned long hw_start_time;
@@ -1274,7 +1275,7 @@ void ieee80211_offchannel_return(struct ieee80211_local *local,void ieee80211_roc_setup (struct ieee80211_local *local);void ieee80211_start_next_roc (struct ieee80211_local *local);void ieee80211_roc_purge (struct ieee80211_sub_if_data *sdata); -void ieee80211_roc_notify_destroy (struct ieee80211_roc_work *roc); +void ieee80211_roc_notify_destroy (struct ieee80211_roc_work *roc,bool free);void ieee80211_sw_roc_work (struct work_struct *work);void ieee80211_handle_roc_started (struct ieee80211_roc_work *roc);
net/mac80211/mlme.c +20 -4
@@ -3237,8 +3237,16 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,/* prep auth_data so we don't go into idle on disassoc */ ifmgd->auth_data = auth_data; -if (ifmgd->associated) -ieee80211_set_disassoc (sdata,0 ,0 , false,NULL ); +if (ifmgd->associated) { +u8 frame_buf[DEAUTH_DISASSOC_LEN ]; + +ieee80211_set_disassoc (sdata,IEEE80211_STYPE_DEAUTH , +WLAN_REASON_UNSPECIFIED , + false, frame_buf); + +__cfg80211_send_deauth (sdata->dev, frame_buf, +sizeof (frame_buf)); + }sdata_info (sdata,"authenticate with %pM\n" , req->bss->bssid);
@@ -3290,8 +3298,16 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,mutex_lock (&ifmgd->mtx); -if (ifmgd->associated) -ieee80211_set_disassoc (sdata,0 ,0 , false,NULL ); +if (ifmgd->associated) { +u8 frame_buf[DEAUTH_DISASSOC_LEN ]; + +ieee80211_set_disassoc (sdata,IEEE80211_STYPE_DEAUTH , +WLAN_REASON_UNSPECIFIED , + false, frame_buf); + +__cfg80211_send_deauth (sdata->dev, frame_buf, +sizeof (frame_buf)); + }if (ifmgd->auth_data && !ifmgd->auth_data->done) { err = -EBUSY ;
net/mac80211/offchannel.c +17 -6
@@ -293,10 +293,13 @@ void ieee80211_start_next_roc(struct ieee80211_local *local) } } -void ieee80211_roc_notify_destroy (struct ieee80211_roc_work *roc) +void ieee80211_roc_notify_destroy (struct ieee80211_roc_work *roc,bool free) {struct ieee80211_roc_work *dep, *tmp; +if (WARN_ON (roc->to_be_freed)) +return ; +/* was never transmitted */ if (roc->frame) { cfg80211_mgmt_tx_status(&roc->sdata->wdev,
@@ -313,9 +316,12 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc) GFP_KERNEL);list_for_each_entry_safe (dep, tmp, &roc->dependents, list) -ieee80211_roc_notify_destroy (dep); +ieee80211_roc_notify_destroy (dep, true); -kfree (roc); +if (free) +kfree (roc); +else + roc->to_be_freed = true; }void ieee80211_sw_roc_work (struct work_struct *work)
@@ -328,6 +334,9 @@ void ieee80211_sw_roc_work(struct work_struct *work)mutex_lock (&local->mtx); +if (roc->to_be_freed) + goto out_unlock; +if (roc->abort) goto finish;
@@ -368,7 +377,7 @@ void ieee80211_sw_roc_work(struct work_struct *work) finish:list_del (&roc->list); started = roc->started; -ieee80211_roc_notify_destroy (roc); +ieee80211_roc_notify_destroy (roc, !roc->abort);if (started) {drv_flush (local, false);
@@ -408,7 +417,7 @@ static void ieee80211_hw_roc_done(struct work_struct *work)list_del (&roc->list); -ieee80211_roc_notify_destroy (roc); +ieee80211_roc_notify_destroy (roc, true);/* if there's another roc, start it now */ ieee80211_start_next_roc (local);
@@ -458,12 +467,14 @@ void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata)list_for_each_entry_safe (roc, tmp, &tmp_list, list) {if (local->ops->remain_on_channel) {list_del (&roc->list); -ieee80211_roc_notify_destroy (roc); +ieee80211_roc_notify_destroy (roc, true); }else {ieee80211_queue_delayed_work (&local->hw, &roc->work,0 );/* work will clean up etc */ flush_delayed_work (&roc->work); +WARN_ON (!roc->to_be_freed); +kfree (roc); } }
net/netrom/af_netrom.c +1 -0
@@ -1177,6 +1177,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, }if (sax !=NULL ) { +memset (sax,0 ,sizeof (*sax)); sax->sax25_family =AF_NETROM ;skb_copy_from_linear_data_offset (skb,7 , sax->sax25_call.ax25_call,AX25_ADDR_LEN );
net/nfc/llcp/sock.c +2 -0
@@ -579,6 +579,8 @@ static int llcp_sock_recvmsg(struct kiocb *iocb, struct socket *sock,pr_debug ("%p %zu\n" , sk, len); + msg->msg_namelen =0 ; +lock_sock (sk); if (sk->sk_state == LLCP_CLOSED &&
net/rose/af_rose.c +1 -0
@@ -1257,6 +1257,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,skb_copy_datagram_iovec (skb,0 , msg->msg_iov, copied);if (srose !=NULL ) { +memset (srose,0 , msg->msg_namelen); srose->srose_family =AF_ROSE ; srose->srose_addr = rose->dest_addr; srose->srose_call = rose->dest_call;
net/sched/sch_cbq.c +4 -1
@@ -963,8 +963,11 @@ cbq_dequeue(struct Qdisc *sch)cbq_update (q);if ((incr -= incr2) <0 ) incr =0 ; + q->now += incr; + }else { +if (now > q->now) + q->now = now; } - q->now += incr; q->now_rt = now;for (;;) {
net/tipc/socket.c +7 -0
@@ -802,6 +802,7 @@ static void set_orig_addr(struct msghdr *m, struct tipc_msg *msg)if (addr) { addr->family =AF_TIPC ; addr->addrtype =TIPC_ADDR_ID ; +memset (&addr->addr,0 ,sizeof (addr->addr)); addr->addr.id.ref =msg_origport (msg); addr->addr.id.node =msg_orignode (msg); addr->addr.name.domain =0 ;/* could leave uninitialized */
@@ -916,6 +917,9 @@ static int recv_msg(struct kiocb *iocb, struct socket *sock, goto exit; } +/* will be updated in set_orig_addr() if needed */ + m->msg_namelen =0 ; + timeout =sock_rcvtimeo (sk, flags &MSG_DONTWAIT ); restart:
@@ -1032,6 +1036,9 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock, goto exit; } +/* will be updated in set_orig_addr() if needed */ + m->msg_namelen =0 ; + target =sock_rcvlowat (sk, flags &MSG_WAITALL , buf_len); timeout =sock_rcvtimeo (sk, flags &MSG_DONTWAIT );
net/unix/af_unix.c +1 -1
@@ -1998,7 +1998,7 @@ again:if ((UNIXCB (skb).pid != siocb->scm->pid) || (UNIXCB (skb).cred != siocb->scm->cred))break ; - }else { + }else if (test_bit (SOCK_PASSCRED , &sock->flags)) {/* Copy credentials */ scm_set_cred (siocb->scm,UNIXCB (skb).pid,UNIXCB (skb).cred); check_creds =1 ;
sound/core/pcm_native.c +2 -10
@@ -3219,18 +3219,10 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap);int snd_pcm_lib_mmap_iomem (struct snd_pcm_substream *substream,struct vm_area_struct *area) { -long size; -unsigned long offset; +struct snd_pcm_runtime *runtime = substream->runtime;; area->vm_page_prot =pgprot_noncached (area->vm_page_prot); - area->vm_flags |=VM_IO ; - size = area->vm_end - area->vm_start; - offset = area->vm_pgoff <<PAGE_SHIFT ; -if (io_remap_pfn_range (area, area->vm_start, - (substream->runtime->dma_addr + offset) >>PAGE_SHIFT , - size, area->vm_page_prot)) -return -EAGAIN ; -return 0 ; +return vm_iomap_memory (area, runtime->dma_addr, runtime->dma_bytes); }EXPORT_SYMBOL (snd_pcm_lib_mmap_iomem);
sound/pci/hda/hda_codec.c +1 -1
@@ -165,7 +165,7 @@ const char *snd_hda_get_jack_type(u32 cfg)"Line Out" ,"Speaker" ,"HP Out" ,"CD" ,"SPDIF Out" ,"Digital Out" ,"Modem Line" ,"Modem Hand" ,"Line In" ,"Aux" ,"Mic" ,"Telephony" , -"SPDIF In" ,"Digitial In" ,"Reserved" ,"Other" +"SPDIF In" ,"Digital In" ,"Reserved" ,"Other" }; return jack_types[(cfg & AC_DEFCFG_DEVICE)
sound/pci/hda/patch_realtek.c +3 -1
@@ -6656,7 +6656,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec)const hda_nid_t *ssids;if (codec->vendor_id ==0x10ec0272 || codec->vendor_id ==0x10ec0663 || - codec->vendor_id ==0x10ec0665 || codec->vendor_id ==0x10ec0670 ) + codec->vendor_id ==0x10ec0665 || codec->vendor_id ==0x10ec0670 || + codec->vendor_id ==0x10ec0671 ) ssids = alc663_ssids;else ssids = alc662_ssids;
@@ -7108,6 +7109,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = { { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, { .id = 0x10ec0668, .name = "ALC668", .patch = patch_alc662 }, { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, + { .id = 0x10ec0671, .name = "ALC671", .patch = patch_alc662 }, { .id = 0x10ec0680, .name = "ALC680", .patch = patch_alc680 }, { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 },
sound/soc/codecs/wm8903.c +2 -0
@@ -1083,6 +1083,8 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = { { "ROP", NULL, "Right Speaker PGA" }, { "RON", NULL, "Right Speaker PGA" }, + { "Charge Pump", NULL, "CLK_DSP" }, + { "Left Headphone Output PGA", NULL, "Charge Pump" }, { "Right Headphone Output PGA", NULL, "Charge Pump" }, { "Left Line Output PGA", NULL, "Charge Pump" },
sound/soc/fsl/imx-ssi.c +5 -0
@@ -498,6 +498,8 @@ static void imx_ssi_ac97_reset(struct snd_ac97 *ac97)if (imx_ssi->ac97_reset) imx_ssi->ac97_reset (ac97); +/* First read sometimes fails, do a dummy read */ +imx_ssi_ac97_read (ac97,0 ); }static void imx_ssi_ac97_warm_reset (struct snd_ac97 *ac97)
@@ -506,6 +508,9 @@ static void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97)if (imx_ssi->ac97_warm_reset) imx_ssi->ac97_warm_reset (ac97); + +/* First read sometimes fails, do a dummy read */ +imx_ssi_ac97_read (ac97,0 ); }struct snd_ac97_bus_ops soc_ac97_ops = {
sound/soc/sh/dma-sh7760.c +2 -2
@@ -342,8 +342,8 @@ static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd)return 0 ; } -static struct snd_soc_platform sh7760_soc_platform = { - .pcm_ops = &camelot_pcm_ops, +static struct snd_soc_platform_driver sh7760_soc_platform = { + .ops = &camelot_pcm_ops, .pcm_new = camelot_pcm_new, .pcm_free = camelot_pcm_free, };
sound/soc/spear/spear_pcm.c +6 -6
@@ -149,9 +149,9 @@ static void spear_pcm_free(struct snd_pcm *pcm)static u64 spear_pcm_dmamask =DMA_BIT_MASK (32 ); -static int spear_pcm_new (struct snd_card *card, -struct snd_soc_dai *dai,struct snd_pcm *pcm) +static int spear_pcm_new (struct snd_soc_pcm_runtime *rtd) { +struct snd_card *card = rtd->card->snd_card;int ret;if (!card->dev->dma_mask)
@@ -159,16 +159,16 @@ static int spear_pcm_new(struct snd_card *card,if (!card->dev->coherent_dma_mask) card->dev->coherent_dma_mask =DMA_BIT_MASK (32 ); -if (dai->driver->playback.channels_min) { - ret =spear_pcm_preallocate_dma_buffer (pcm, +if (rtd->cpu_dai->driver->playback.channels_min) { + ret =spear_pcm_preallocate_dma_buffer (rtd->pcm,SNDRV_PCM_STREAM_PLAYBACK , spear_pcm_hardware.buffer_bytes_max);if (ret)return ret; } -if (dai->driver->capture.channels_min) { - ret =spear_pcm_preallocate_dma_buffer (pcm, +if (rtd->cpu_dai->driver->capture.channels_min) { + ret =spear_pcm_preallocate_dma_buffer (rtd->pcm,SNDRV_PCM_STREAM_CAPTURE , spear_pcm_hardware.buffer_bytes_max);if (ret)
sound/usb/mixer_quirks.c +2 -2
@@ -493,7 +493,7 @@ static int snd_nativeinstruments_control_get(struct snd_kcontrol *kcontrol,else ret =usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ), bRequest,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_IN , -0 ,cpu_to_le16 (wIndex), +0 , wIndex, &tmp,sizeof (tmp),1000 );up_read (&mixer->chip->shutdown_rwsem);
@@ -524,7 +524,7 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,else ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), bRequest,USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_OUT , -cpu_to_le16 (wValue),cpu_to_le16 (wIndex), + wValue, wIndex,NULL ,0 ,1000 );up_read (&mixer->chip->shutdown_rwsem);
sound/usb/quirks.c +1 -1
@@ -484,7 +484,7 @@ static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev) {int ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ),0xaf ,USB_TYPE_VENDOR |USB_RECIP_DEVICE , -cpu_to_le16 (1 ),0 ,NULL ,0 ,1000 ); +1 ,0 ,NULL ,0 ,1000 );if (ret <0 )return ret;
virt/kvm/ioapic.c +5 -2
@@ -73,9 +73,12 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,u32 redir_index = (ioapic->ioregsel -0x10 ) >>1 ;u64 redir_content; -ASSERT (redir_index <IOAPIC_NUM_PINS ); +if (redir_index <IOAPIC_NUM_PINS ) + redir_content = + ioapic->redirtbl[redir_index].bits; +else + redir_content = ~0ULL ; - redir_content = ioapic->redirtbl[redir_index].bits; result = (ioapic->ioregsel &0x1 ) ? (redir_content >>32 ) &0xffffffff : redir_content &0xffffffff ;
virt/kvm/kvm_main.c +37 -10
69 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Hello,
Quoted 7 lines · Steven Rostedt
This is the start of the stable review cycle for 3.6.11.3 release. There are 126 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu May 9 23:54:01. Anything received after that time might be too late.
Where is this tree maintained? www.kernel.org only has link to 3.6.11-stable but it says it's EOL, and the last tag is 3.6.11 from 2012.
How can I see what's in 3.6.11.2?
Quoted 3 lines
Aaro Koskinen (1):
ARM: 7692/1: iop3xx: move IOP3XX_PERIPHERAL_VIRT_BASE [f5d6a1441a5045824f36ff7c6b6bbae0373472a6]
This patch is probably not needed in 3.6.x.y but it probably won't do any harm either...
A.
Steven Rostedt
maintainerQuoted 8 lines · Aaro Koskinen
Hello,
Quoted 5 lines · Steven Rostedt
This is the start of the stable review cycle for 3.6.11.3 release. There are 126 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Quoted 5 lines
Quoted 2 lines
Responses should be made by Thu May 9 23:54:01. Anything received after that time might be too late.
Where is this tree maintained? www.kernel.org only has link to 3.6.11-stable but it says it's EOL, and the last tag is 3.6.11 from 2012.
It's part of the -rt releases. I'm only doing this temporally until 3.8-rt is stable.
Quoted 2 lines
How can I see what's in 3.6.11.2?
The git tree is at:
git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git
branch: v3.6-stable
As well as the patches at:
http://www.kernel.org/pub/linux/kernel/projects/rt/3.6/stable/patch-3.6.11.2.xz
I don't push up review patches until final. Although I might start storing -rc patches in the near future.
Quoted 7 lines
Quoted 4 lines
Aaro Koskinen (1):
ARM: 7692/1: iop3xx: move IOP3XX_PERIPHERAL_VIRT_BASE [f5d6a1441a5045824f36ff7c6b6bbae0373472a6]This patch is probably not needed in 3.6.x.y but it probably won't do any harm either...
OK, I'll keep it then.
Thanks,
-- Steve