* [34-longterm 000/260] v2.6.34.8 longterm review
@ 2011-01-02 7:14 Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 001/260] sctp: fix append error cause to ERROR chunk correctly Paul Gortmaker
` (261 more replies)
0 siblings, 262 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:14 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Paul Gortmaker
This is the start of the longterm review cycle for the v2.6.34.8 release.
There are 260 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let us know. If anyone is a maintainer of the proper subsystem, and
wants to add a Signed-off-by: line to the patch, please respond with it.
Reponses should be made within 72 hours.
Al Viro (1):
arm: fix really nasty sigreturn bug
Alan Cox (1):
bluetooth: Fix missing NULL check
Alan Stern (3):
USB: fix bug in initialization of interface minor numbers
USB: disable endpoints after unbinding interfaces, not before
USB: accept some invalid ep0-maxpacket values
Alexey Kuznetsov (1):
tcp: Prevent overzealous packetization by SWS logic.
Alok Kataria (1):
x86, kexec: Make sure to stop all CPUs before exiting the kernel
Alon Ziv (1):
USB: opticon: Fix long-standing bugs in opticon driver
Anders Larsen (1):
USB: cp210x: Add WAGO 750-923 Service Cable device ID
Andre Przywara (1):
x86, cpu: Fix renamed, not-yet-shipping AMD CPUID feature bit
Andreas Herrmann (2):
hwmon: (k8temp) Differentiate between AM2 and ASB1
x86, mtrr: Assume SYS_CFG[Tom2ForceMemTypeWB] exists on all future
AMD CPUs
Andrew Morton (1):
drivers/pci/intel-iommu.c: fix build with older gcc's
Andy Gospodarek (1):
bonding: correctly process non-linear skbs
Anton Vorontsov (1):
apm_power: Add missing break statement
Avi Kivity (2):
KVM: VMX: Fix host GDT.LIMIT corruption
KVM: Fix fs/gs reload oops with invalid ldt
Ben Hutchings (7):
ext4: Conditionally define compat ioctl numbers
ext4: Fix compat EXT4_IOC_ADD_GROUP
PCI: MSI: Remove unsafe and unnecessary hardware access
PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc()
tun: Don't add sysfs attributes to devices without sysfs directories
MIPS: Set io_map_base for several PCI bridges lacking it
sis-agp: Remove SIS 760, handled by amd64-agp
Borislav Petkov (1):
x86, AMD, MCE thresholding: Fix the MCi_MISCj iteration order
Chris Wilson (2):
drm/i915: Prevent double dpms on
drm: Only decouple the old_fb from the crtc is we call mode_set*
Chris Wright (1):
tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread
Christian Borntraeger (1):
ext4: allow defrag (EXT4_IOC_MOVE_EXT) in 32bit compat mode
Christian Lamparter (3):
p54: fix tx feedback status flag check
p54usb: fix off-by-one on !CONFIG_PM
p54usb: add five more USBIDs
Christof Schmitt (1):
Fix race when removing SCSI devices
Christoph Lameter (1):
mm: page allocator: calculate a better estimate of NR_FREE_PAGES when
memory is low and kswapd is awake
Clemens Ladisch (1):
ALSA: rawmidi: fix oops (use after free) when unloading a driver
module
Cliff Wickman (2):
mm, x86: Saving vmcore with non-lazy freeing of vmas
x86, kdump: Change copy_oldmem_page() to use cached addressing
Colin Ian King (1):
ACPI: enable repeated PCIEXP wakeup by clearing PCIEXP_WAKE_STS on
resume
Craig Shelley (1):
USB: CP210x Add new device ID
Curt Wohlgemuth (2):
ext4: Remove extraneous newlines in ext4_msg() calls
ext4: check for a good block group before loading buddy pages
DJ Delorie (1):
USB: cp210x: Add Renesas RX-Stick device ID
Dan Carpenter (9):
KEYS: Return more accurate error codes
USB: ehci-ppc-of: problems in unwind
sysfs: checking for NULL instead of ERR_PTR
irda: off by one
i915: return -EFAULT if copy_to_user fails
i915: return -EFAULT if copy_to_user fails
Staging: vt6655: fix buffer overflow
net/llc: make opt unsigned in llc_ui_setsockopt()
gdth: integer overflow in ioctl
Dan Rosenberg (9):
USB: serial/mos*: prevent reading uninitialized stack memory
drivers/net/usb/hso.c: prevent reading uninitialized memory
drivers/net/cxgb3/cxgb3_main.c: prevent reading uninitialized stack
memory
drivers/net/eql.c: prevent reading uninitialized stack memory
drivers/video/sis/sis_main.c: prevent reading uninitialized stack
memory
xfs: prevent reading uninitialized stack memory
drivers/video/via/ioctl.c: prevent reading uninitialized stack memory
ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory
ALSA: prevent heap corruption in snd_ctl_new()
Daniel J Blueman (2):
rcu: apply RCU protection to wake_affine()
Fix unprotected access to task credentials in waitid()
Daniel Suchy (1):
USB: ftdi_sio: new VID/PIDs for various Papouch devices
Darren Hart (1):
futex: Fix errors in nested key ref-counting
Dave Airlie (1):
drm/radeon: fix PCI ID 5657 to be an RV410
Dave Ludlow (2):
usb: serial: mos7840: Add USB ID to support the B&B Electronics
USOPTL4-2P.
usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485
converters.
David Daney (1):
MIPS: Quit using undefined behavior of ADDU in 64-bit atomic
operations.
David Henningsson (1):
ALSA: hda - Rename iMic to Int Mic on Lenovo NB0763
David Howells (3):
CIFS: Remove __exit mark from cifs_exit_dns_resolver()
KEYS: Fix RCU no-lock warning in keyctl_session_to_parent()
KEYS: Fix bug in keyctl_session_to_parent() if parent has no session
keyring
David Milburn (1):
libsas: fix NCQ mixing with non-NCQ
David S. Miller (6):
irda: Correctly clean up self->ias_obj on irda_bind() failure.
tcp: Combat per-cpu skew in orphan tests.
bridge: Clear INET control block of SKBs passed into ip_fragment().
sparc64: Get rid of indirect p1275 PROM call buffer.
tcp: Fix >4GB writes on 64-bit.
rose: Fix signedness issues wrt. digi count.
Dmitry Monakhov (8):
ext4: check missed return value in ext4_sync_file()
ext4: fix quota accounting in case of fallocate
ext4: Do not zero out uninitialized extents beyond i_size
ext4: clean up inode bitmaps manipulation in ext4_free_inode
ext4: init statistics after journal recovery
ext4: Use bitops to read/modify i_flags in struct ext4_inode_info
ext4: restart ext4_ext_remove_space() after transaction restart
ext4: Fix remaining racy updates of EXT4_I(inode)->i_flags
Dmitry Torokhov (1):
Input: i8042 - fix device removal on unload
Eric Dumazet (5):
gro: fix different skb headrooms
tcp: fix three tcp sysctls tuning
rds: fix a leak of kernel memory
ip: fix truesize mismatch in ip fragmentation
netxen: dont set skb->truesize
Eric Paris (2):
inotify: send IN_UNMOUNT events
inotify: fix inotify oneshot support
Eric Sandeen (4):
ext4: don't return to userspace after freezing the fs with a mutex
held
ext4: stop issuing discards if not supported by device
ext4: don't scan/accumulate more pages than mballoc will allocate
ext4: fix freeze deadlock under IO
Erik J. Staab (1):
ALSA: oxygen: fix analog capture on Claro halo cards
FUJITA Tomonori (1):
bsg: fix incorrect device_status value
Frank Mayhar (1):
ext4: Make fsync sync new parent directories in no-journal mode
Frederic Weisbecker (1):
perf: Initialize callchains roots's childen hits
Gary King (1):
bounce: call flush_dcache_page() after bounce_copy_vec()
Greg Kroah-Hartman (1):
USB: ftdi_sio: add device ids for ScienceScope
Guennadi Liakhovetski (1):
mmc: fix the use of kunmap_atomic() in tmio_mmc.h
Guillem Jover (2):
hwmon: (f75375s) Shift control mode to the correct bit position
hwmon: (f75375s) Do not overwrite values read from registers
H. Peter Anvin (3):
x86-64, compat: Test %rax for the syscall number, not %eax
compat: Make compat_alloc_user_space() incorporate the access_ok()
x86, cpu: After uncapping CPUID, re-run CPU feature detection
Haiyang Zhang (2):
staging: hv: Fix missing functions for net_device_ops
staging: hv: Fixed the value of the 64bit-hole inside ring buffer
Hank Janssen (3):
staging: hv: Fixed bounce kmap problem by using correct index
staging: hv: Increased storvsc ringbuffer and max_io_requests
staging: hv: Fixed lockup problem with bounce_buffer scatter list
Herbert Xu (1):
bridge: Clear IPCB before possible entry into IP stack
Jacob Pan (1):
x86: detect scattered cpuid features earlier
Jan Kara (2):
ext4: Show journal_checksum option
char: Mark /dev/zero and /dev/kmem as not capable of writeback
Jan Sembera (1):
binfmt_misc: fix binfmt_misc priority
Jarek Poplawski (1):
gro: Re-fix different skb headrooms
Jason Detring (1):
USB: cp210x: Add B&G H3000 link cable ID
Jean-Christophe PLAGNIOL-VILLARD (1):
USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request
failled
Jeff Moyer (1):
aio: check for multiplication overflow in do_io_submit
Jeremy Fitzhardinge (3):
xen: handle events as edge-triggered
xen: use percpu interrupts for IPIs and VIRQs
tracing/x86: Don't use mcount in pvclock.c
Jerome Marchand (1):
kernel/groups.c: fix integer overflow in groups_search
Jianzhao Wang (1):
net: blackhole route should always be recalculated
Jing Zhang (3):
ext4: fix memory leaks in error path handling of ext4_ext_zeroout()
ext4: Remove unnecessary call to ext4_get_group_desc() in mballoc
ext4: rename ext4_mb_release_desc() to ext4_mb_unload_buddy()
Jiri Olsa (1):
oprofile: Add Support for Intel CPU Family 6 / Model 29
Joel Becker (1):
ocfs2: Don't walk off the end of fast symlinks.
Joerg Roedel (3):
x86/amd-iommu: Set iommu configuration flags in enable-loop
x86/amd-iommu: Fix rounding-bug in __unmap_single
x86/amd-iommu: Work around S3 BIOS bug
Johannes Berg (2):
wireless extensions: fix kernel heap content leak
wext: fix potential private ioctl memory content leak
John W. Linville (2):
ath5k: check return value of ieee80211_get_tx_rate
hostap_pci: set dev->base_addr during probe
Julia Lawall (1):
drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory
allocation failure
KAMEZAWA Hiroyuki (1):
memory hotplug: fix next block calculation in is_removable
KOSAKI Motohiro (1):
tcp: select(writefds) don't hang up when a peer close connection
Kees Cook (1):
net: clear heap allocations for privileged ethtool actions
Kenneth Waters (1):
Input: joydev - fix JSIOCSAXMAP ioctl
Kumar Sanghvi (1):
Phonet: Correct header retrieval after pskb_may_pull
Len Brown (3):
intel_idle: PCI quirk to prevent Lenovo Ideapad s10-3 boot hang
ACPI: EC: add Vista incompatibility DMI entry for Toshiba Satellite
L355
ACPI: delete ZEPTO idle=nomwait DMI quirk
Li Zefan (1):
tracing: Fix a race in function profile
Linus Torvalds (2):
v4l1: fix 32-bit compat microcode loading translation
De-pessimize rds_page_copy_user
Luca Tettamanti (1):
atl1: fix resume
Luis R. Rodriguez (2):
ath5k: drop warning on jumbo frames
ath9k_hw: fix parsing of HT40 5 GHz CTLs
Luke Lowrey (1):
USB: ftdi_sio: Added custom PIDs for ChamSys products
Luke Yelavich (1):
ALSA: hda - Add Dell Latitude E6400 model quirk
Maciej Żenczykowski (1):
net: Fix IPv6 PMTU disc. w/ asymmetric routes
Marek Szyprowski (1):
mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove
Mark Lord (1):
sata_mv: fix broken DSM/TRIM support (v2)
Mathieu Desnoyers (1):
sched: Fix string comparison in /proc/sched_features
Matt Evans (1):
powerpc: Initialise paca->kstack before early_setup_secondary
Mauro Carvalho Chehab (2):
V4L/DVB: cx231xx: Avoid an OOPS when card is unknown (card=0)
USB: option: Add more ZTE modem USB id's
Max Vozeler (2):
staging: usbip: Notify usb core of port status changes
staging: usbip: Process event flags without delay
Maxim Osipov (1):
USB: Fix kernel oops with g_ether and Windows
Mel Gorman (2):
mm: page allocator: drain per-cpu lists after direct reclaim
allocation fails
mm: page allocator: update free page counters after pages are placed
on the free list
Michael Cree (1):
alpha: Fix printk format errors
Michael Neuling (1):
powerpc: Don't use kernel stack with translation off
Michael Reed (1):
sd name space exhaustion causes system hang
Mike Christie (1):
Fix regressions in scsi_internal_device_block
Mike Galbraith (1):
sched: Fix select_idle_sibling()
Miklos Szeredi (1):
fuse: flush background queue on connection close
Ming Lei (1):
usb: musb: gadget: fix kernel panic if using out ep with FIFO_TXRX
style
Nagendra Tomar (1):
net: Fix the condition passed to sk_wait_event()
Nicolas Ferre (1):
AT91: change dma resource index
Nicolas Kaiser (1):
pipe: fix failure to return error code on ->confirm()
Nikanth Karthikesan (1):
ext4: Prevent creation of files larger than RLIMIT_FSIZE using
fallocate
Oleg Nesterov (6):
sched: Kill the broken and deadlockable
cpuset_lock/cpuset_cpus_allowed_locked code
sched: move_task_off_dead_cpu(): Take rq->lock around
select_fallback_rq()
sched: move_task_off_dead_cpu(): Remove retry logic
sched: sched_exec(): Remove the select_fallback_rq() logic
sched: _cpu_down(): Don't play with current->cpus_allowed
sched: Make select_fallback_rq() cpuset friendly
Patrick Simmons (1):
oprofile: Add Support for Intel CPU Family 6 / Model 22 (Intel
Celeron 540)
Paul E. McKenney (1):
pid: make setpgid() system call use RCU read-side critical section
Paul Fertser (1):
b44: fix carrier detection on bind
Paul Fox (1):
x86, olpc: Don't retry EC commands forever
Paul Mackerras (1):
powerpc/perf: Fix sampling enable for PPC970
Peter Oberparleiter (2):
gcov: fix null-pointer dereference for certain module types
dasd: use correct label location for diag fba disks
Peter Zijlstra (6):
x86, tsc: Fix a preemption leak in restore_sched_clock_state()
sched: Fix TASK_WAKING vs fork deadlock
sched: Optimize task_rq_lock()
sched: Fix nr_uninterruptible count
sched: Fix rq->clock synchronization when migrating tasks
sched: Pre-compute cpumask_weight(sched_domain_span(sd))
Petr Tesarik (1):
Optimize ticket spinlocks in fsys_rt_sigprocmask
Philippe Corbes (1):
USB: cdc-acm: Add pseudo modem without AT command capabilities
Przemo Firszt (1):
USB: Expose vendor-specific ACM channel on Nokia 5230
Rainer Keller (1):
USB: add PID for FTDI based OpenDCC hardware
Rich Mattes (1):
USB: ftdi_sio: Add PID for accesio products
Robert Richter (3):
oprofile: fix crash when accessing freed task structs
oprofile, x86: fix init_sysfs error handling
oprofile, x86: fix init_sysfs() function stub
Robin Holt (1):
sgi-xp: incoming XPC channel messages can come in after the channel's
partition structures have been torn down
Roland McGrath (4):
x86-64, compat: Retruncate rax after ia32 syscall entry tracing
setup_arg_pages: diagnose excessive argument size
execve: improve interactivity with large arguments
execve: make responsive to SIGKILL with large arguments
Ryan Kuester (1):
mptsas: fix hangs caused by ATA pass-through
Salman Qazi (1):
hrtimer: Preserve timer state in remove_hrtimer()
Sergei Shtylyov (2):
usb: musb: gadget: restart request on clearing endpoint halt
usb: musb: blackfin: call gpio_free() on error path in
musb_platform_init()
Simon Guinot (1):
dmaengine: fix interrupt clearing for mv_xor
Stanislaw Gruszka (3):
sched: Fix user time incorrectly accounted as system time on 32-bit
skge: add quirk to limit DMA
r8169: allocate with GFP_KERNEL flag when able to sleep
Stefan Bader (1):
mm: Move vma_stack_continue into mm.h
Steve Wise (1):
RDMA/cxgb3: Turn off RX coalescing for iWARP connections
Steven Rostedt (3):
tracing: Do not allow llseek to set_ftrace_filter
tracing/x86: Don't use mcount in kvmclock.c
ring-buffer: Fix typo of time extends per page
Sunil Mushran (1):
ocfs2: Fix incorrect checksum validation error
Suresh Siddha (3):
x86, tsc, sched: Recompute cyc2ns_offset's during resume from sleep
states
sched: Fix select_idle_sibling() logic in select_task_rq_fair()
x86, intr-remap: Set redirection hint in the IRTE
Takashi Iwai (3):
ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open()
ALSA: hda - Handle missing NID 0x1b on ALC259 codec
ALSA: hda - Handle pin NID 0x1a on ALC259/269
Tejun Heo (3):
libata: skip EH autopsy and recovery during suspend
percpu: fix pcpu_last_unit_cpu
ubd: fix incorrect sector handling during request restart
Tetsuo Handa (1):
UNIX: Do not loop forever at unix_autobind().
Theodore Ts'o (2):
ext4: Avoid crashing on NULL ptr dereference on a filesystem error
ext4: Clear the EXT4_EOFBLOCKS_FL flag only when warranted
Thomas Gleixner (2):
x86, hpet: Fix bogus error check in hpet_assign_irq()
x86, irq: Plug memory leak in sparse irq
Toby Gray (2):
USB: cdc-acm: Adding second ACM channel support for various Nokia and
one Samsung phones
USB: cdc-acm: Fixing crash when ACM probing interfaces with no
endpoint descriptors.
Tom Marshall (1):
tcp: Fix race in tcp_poll
Tony Luck (2):
fix siglock
guard page for stacks that grow upwards
Trond Myklebust (2):
NFS: Fix a typo in nfs_sockaddr_match_ipaddr6
SUNRPC: Fix race corrupting rpc upcall
Ulrich Weber (1):
xfrm4: strip ECN bits from tos field
Vasiliy Kulikov (1):
pcmcia: synclink_cs: fix information leak to userland
Vlad Yasevich (1):
sctp: Do not reset the packet during sctp_packet_config().
Wei Yongjun (1):
sctp: fix append error cause to ERROR chunk correctly
Xiao Guangrong (2):
KVM: MMU: fix direct sp's access corrupted
KVM: MMU: fix conflict access permissions in direct sp
Yegor Yefremov (1):
i2c-pca: Fix waitforcompletion() return value
Yusuke Goda (1):
tmio_mmc: don't clear unhandled pending interrupts
Zachary Amsden (2):
KVM: x86: Fix SVM VMCB reset
KVM: x86: Move TSC reset out of vmcb_init
Zhang Rui (1):
ACPI: Disable Windows Vista compatibility for Toshiba P305D
arch/alpha/kernel/err_marvel.c | 6 +-
arch/arm/kernel/entry-common.S | 2 +
arch/arm/mach-at91/at91sam9g45_devices.c | 2 +-
arch/ia64/include/asm/compat.h | 2 +-
arch/ia64/kernel/fsys.S | 30 ++-
arch/ia64/kernel/msi_ia64.c | 2 +-
arch/ia64/sn/kernel/msi_sn.c | 2 +-
arch/mips/include/asm/atomic.h | 24 +-
arch/mips/include/asm/compat.h | 2 +-
arch/mips/mti-malta/malta-pci.c | 2 +
arch/mips/nxp/pnx8550/common/pci.c | 1 +
arch/mips/nxp/pnx8550/common/setup.c | 2 +-
arch/mips/pci/ops-pmcmsp.c | 1 +
arch/mips/pci/pci-yosemite.c | 1 +
arch/parisc/include/asm/compat.h | 2 +-
arch/powerpc/include/asm/compat.h | 2 +-
arch/powerpc/kernel/head_64.S | 18 +-
arch/powerpc/kernel/ppc970-pmu.c | 2 +
arch/s390/include/asm/compat.h | 2 +-
arch/sparc/include/asm/compat.h | 2 +-
arch/sparc/include/asm/oplib_64.h | 27 +--
arch/sparc/prom/cif.S | 16 +-
arch/sparc/prom/console_64.c | 48 +++-
arch/sparc/prom/devops_64.c | 36 +++-
arch/sparc/prom/misc_64.c | 314 +++++++++++++++++++--------
arch/sparc/prom/p1275.c | 102 +---------
arch/sparc/prom/tree_64.c | 210 +++++++++++++-----
arch/um/drivers/ubd_kern.c | 9 +-
arch/x86/ia32/ia32entry.S | 22 ++-
arch/x86/include/asm/amd_iommu_proto.h | 6 +
arch/x86/include/asm/amd_iommu_types.h | 12 +
arch/x86/include/asm/compat.h | 2 +-
arch/x86/include/asm/cpufeature.h | 2 +-
arch/x86/include/asm/io.h | 1 +
arch/x86/include/asm/kvm_host.h | 24 --
arch/x86/include/asm/smp.h | 9 +-
arch/x86/include/asm/tsc.h | 2 +
arch/x86/kernel/Makefile | 2 +
arch/x86/kernel/amd_iommu.c | 4 +-
arch/x86/kernel/amd_iommu_init.c | 67 ++++--
arch/x86/kernel/apic/io_apic.c | 15 +-
arch/x86/kernel/cpu/common.c | 4 +-
arch/x86/kernel/cpu/cpu.h | 1 +
arch/x86/kernel/cpu/intel.c | 1 +
arch/x86/kernel/cpu/mcheck/mce_amd.c | 9 +-
arch/x86/kernel/cpu/mtrr/cleanup.c | 2 +-
arch/x86/kernel/crash_dump_64.c | 3 +-
arch/x86/kernel/hpet.c | 2 +-
arch/x86/kernel/olpc.c | 5 +-
arch/x86/kernel/reboot.c | 2 +-
arch/x86/kernel/smp.c | 15 +-
arch/x86/kernel/tsc.c | 38 ++++
arch/x86/kvm/paging_tmpl.h | 30 +++-
arch/x86/kvm/svm.c | 17 +-
arch/x86/kvm/vmx.c | 28 +--
arch/x86/kvm/x86.c | 2 +-
arch/x86/oprofile/nmi_int.c | 27 ++-
arch/x86/power/cpu.c | 2 +
arch/x86/xen/enlighten.c | 2 +-
arch/x86/xen/smp.c | 6 +-
block/bsg.c | 2 +-
drivers/acpi/acpica/aclocal.h | 1 +
drivers/acpi/blacklist.c | 16 ++
drivers/acpi/processor_core.c | 6 -
drivers/ata/libata-core.c | 14 +-
drivers/ata/libata-eh.c | 4 +
drivers/ata/sata_mv.c | 44 +++-
drivers/bluetooth/hci_ldisc.c | 7 +
drivers/char/agp/sis-agp.c | 8 -
drivers/char/mem.c | 3 +-
drivers/char/pcmcia/synclink_cs.c | 2 +
drivers/dma/mv_xor.c | 2 +-
drivers/gpu/drm/drm_crtc_helper.c | 4 +-
drivers/gpu/drm/i915/i915_dma.c | 12 +-
drivers/gpu/drm/i915/i915_gem.c | 1 +
drivers/gpu/drm/i915/intel_display.c | 5 +-
drivers/hwmon/f75375s.c | 6 +-
drivers/hwmon/k8temp.c | 35 +++-
drivers/i2c/busses/i2c-pca-isa.c | 12 +-
drivers/i2c/busses/i2c-pca-platform.c | 11 +-
drivers/infiniband/hw/cxgb3/iwch_cm.c | 6 +-
drivers/input/joydev.c | 3 +
drivers/input/serio/i8042.c | 2 +-
drivers/media/video/cx231xx/cx231xx-cards.c | 14 +-
drivers/media/video/v4l2-compat-ioctl32.c | 32 ++-
drivers/message/fusion/mptscsih.c | 2 +
drivers/misc/sgi-xp/xpc_uv.c | 17 ++
drivers/mmc/host/sdhci-s3c.c | 6 +-
drivers/mmc/host/tmio_mmc.c | 7 +-
drivers/mmc/host/tmio_mmc.h | 13 +-
drivers/net/atlx/atl1.c | 5 +-
drivers/net/b44.c | 4 +-
drivers/net/bonding/bond_3ad.c | 3 +
drivers/net/bonding/bond_alb.c | 3 +
drivers/net/cxgb3/cxgb3_main.c | 2 +
drivers/net/eql.c | 2 +
drivers/net/netxen/netxen_nic_init.c | 3 -
drivers/net/r8169.c | 12 +-
drivers/net/skge.c | 18 ++-
drivers/net/tun.c | 3 +-
drivers/net/usb/hso.c | 2 +
drivers/net/wireless/ath/ath5k/base.c | 11 +-
drivers/net/wireless/ath/ath9k/eeprom.h | 2 +-
drivers/net/wireless/ath/regd.h | 1 -
drivers/net/wireless/hostap/hostap_pci.c | 1 +
drivers/net/wireless/p54/eeprom.c | 4 +-
drivers/net/wireless/p54/p54usb.c | 15 ++-
drivers/net/wireless/p54/txrx.c | 2 +-
drivers/oprofile/buffer_sync.c | 27 ++-
drivers/oprofile/cpu_buffer.c | 2 -
drivers/pci/intel-iommu.c | 90 ++++----
drivers/pci/msi.c | 27 +++-
drivers/pci/quirks.c | 20 ++
drivers/power/apm_power.c | 1 +
drivers/scsi/gdth.c | 8 +
drivers/scsi/libsas/sas_ata.c | 1 +
drivers/scsi/scsi_lib.c | 3 +-
drivers/scsi/scsi_sysfs.c | 3 +-
drivers/scsi/sd.c | 15 +-
drivers/staging/hv/RingBuffer.c | 3 +-
drivers/staging/hv/StorVscApi.h | 4 +-
drivers/staging/hv/netvsc_drv.c | 3 +
drivers/staging/hv/storvsc_drv.c | 9 +-
drivers/staging/usbip/usbip_event.c | 16 +-
drivers/staging/usbip/vhci_hcd.c | 2 +
drivers/staging/vt6655/wpactl.c | 11 +-
drivers/usb/class/cdc-acm.c | 24 ++-
drivers/usb/core/file.c | 35 ++--
drivers/usb/core/hub.c | 9 +-
drivers/usb/core/message.c | 15 +-
drivers/usb/gadget/atmel_usba_udc.c | 3 +
drivers/usb/gadget/rndis.c | 10 +-
drivers/usb/host/ehci-ppc-of.c | 12 +-
drivers/usb/musb/blackfin.c | 4 +-
drivers/usb/musb/musb_gadget.c | 22 ++-
drivers/usb/musb/musb_gadget.h | 2 +
drivers/usb/musb/musb_gadget_ep0.c | 9 +
drivers/usb/serial/cp210x.c | 12 +-
drivers/usb/serial/ftdi_sio.c | 43 ++++-
drivers/usb/serial/ftdi_sio_ids.h | 51 +++++-
drivers/usb/serial/mos7720.c | 3 +
drivers/usb/serial/mos7840.c | 35 ++-
drivers/usb/serial/opticon.c | 6 +-
drivers/usb/serial/option.c | 23 ++-
drivers/video/sis/sis_main.c | 3 +
drivers/video/via/ioctl.c | 2 +
drivers/xen/events.c | 21 ++-
fs/aio.c | 3 +
fs/binfmt_misc.c | 2 +-
fs/char_dev.c | 4 +-
fs/cifs/dns_resolve.c | 2 +-
fs/cifs/dns_resolve.h | 2 +-
fs/exec.c | 14 ++
fs/ext4/dir.c | 4 +-
fs/ext4/ext4.h | 129 ++++++++++--
fs/ext4/ext4_jbd2.h | 8 +-
fs/ext4/extents.c | 140 +++++++++----
fs/ext4/file.c | 2 +-
fs/ext4/fsync.c | 33 +++-
fs/ext4/ialloc.c | 89 ++++----
fs/ext4/inode.c | 88 +++++---
fs/ext4/ioctl.c | 25 ++-
fs/ext4/mballoc.c | 108 +++++++---
fs/ext4/migrate.c | 2 +-
fs/ext4/move_extent.c | 4 +-
fs/ext4/namei.c | 12 +-
fs/ext4/super.c | 65 +++---
fs/ext4/xattr.c | 4 +-
fs/fuse/dev.c | 16 +-
fs/nfs/client.c | 2 +-
fs/notify/inotify/inotify_fsnotify.c | 3 +
fs/notify/inotify/inotify_user.c | 7 +-
fs/ocfs2/inode.c | 6 +-
fs/ocfs2/symlink.c | 2 +-
fs/partitions/ibm.c | 13 +-
fs/pipe.c | 2 +-
fs/proc/task_mmu.c | 3 +-
fs/sysfs/file.c | 2 +-
fs/xfs/linux-2.6/xfs_ioctl.c | 2 +
include/drm/drm_pciids.h | 2 +-
include/linux/compat.h | 3 +
include/linux/cpuset.h | 16 +-
include/linux/libata.h | 1 +
include/linux/mm.h | 14 +-
include/linux/mmzone.h | 13 +
include/linux/msi.h | 2 +
include/linux/pci_ids.h | 3 +
include/linux/sched.h | 5 +-
include/linux/socket.h | 2 +-
include/linux/vmstat.h | 22 ++
include/net/tcp.h | 36 +++-
kernel/compat.c | 21 ++
kernel/cpu.c | 18 +-
kernel/cpuset.c | 67 ++++--
kernel/exit.c | 5 +-
kernel/futex.c | 31 ++--
kernel/gcov/fs.c | 244 +++++++++++++++------
kernel/groups.c | 5 +-
kernel/hrtimer.c | 13 +-
kernel/sched.c | 180 +++++++---------
kernel/sched_fair.c | 106 +++++----
kernel/sched_idletask.c | 3 +-
kernel/sched_rt.c | 5 +-
kernel/sys.c | 2 +
kernel/trace/ftrace.c | 19 ++-
kernel/trace/ring_buffer.c | 2 +-
mm/bounce.c | 2 +-
mm/memory.c | 15 +-
mm/memory_hotplug.c | 16 +-
mm/mlock.c | 6 -
mm/mmap.c | 3 -
mm/mmzone.c | 21 ++
mm/page_alloc.c | 33 ++-
mm/percpu.c | 2 +-
mm/vmalloc.c | 9 +
mm/vmstat.c | 15 ++-
net/bridge/br_netfilter.c | 9 +-
net/core/ethtool.c | 4 +-
net/core/iovec.c | 5 +-
net/core/skbuff.c | 6 +-
net/core/stream.c | 8 +-
net/ipv4/ip_output.c | 19 +-
net/ipv4/route.c | 7 +-
net/ipv4/tcp.c | 41 ++--
net/ipv4/tcp_input.c | 2 +
net/ipv4/tcp_timer.c | 8 +-
net/ipv4/xfrm4_policy.c | 2 +-
net/ipv6/ip6_output.c | 18 +-
net/ipv6/route.c | 28 ++-
net/irda/af_irda.c | 4 +-
net/irda/irlan/irlan_common.c | 2 +-
net/llc/af_llc.c | 3 +-
net/phonet/pep.c | 3 +-
net/rds/page.c | 27 +--
net/rds/recv.c | 2 +-
net/rose/af_rose.c | 4 +-
net/sctp/output.c | 1 -
net/sctp/sm_make_chunk.c | 4 +-
net/sunrpc/auth_gss/auth_gss.c | 9 +-
net/sunrpc/rpc_pipe.c | 6 +-
net/unix/af_unix.c | 15 +-
net/wireless/wext-compat.c | 3 +
net/wireless/wext-core.c | 16 ++
net/wireless/wext-priv.c | 2 +-
security/keys/keyctl.c | 6 +-
security/keys/process_keys.c | 6 +-
sound/core/control.c | 5 +
sound/core/rawmidi.c | 4 +-
sound/core/seq/oss/seq_oss_init.c | 9 +-
sound/pci/hda/patch_analog.c | 1 +
sound/pci/hda/patch_realtek.c | 8 +-
sound/pci/oxygen/oxygen.c | 4 +
sound/pci/rme9652/hdsp.c | 1 +
sound/pci/rme9652/hdspm.c | 1 +
tools/perf/util/callchain.h | 1 +
255 files changed, 2861 insertions(+), 1415 deletions(-)
--
1.7.3.3
^ permalink raw reply [flat|nested] 272+ messages in thread
* [34-longterm 001/260] sctp: fix append error cause to ERROR chunk correctly
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
@ 2011-01-02 7:14 ` Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 002/260] KEYS: Return more accurate error codes Paul Gortmaker
` (260 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:14 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Wei Yongjun, David S. Miller, Paul Gortmaker
From: Wei Yongjun <yjwei@cn.fujitsu.com>
commit 2e3219b5c8a2e44e0b83ae6e04f52f20a82ac0f2 upstream.
commit 5fa782c2f5ef6c2e4f04d3e228412c9b4a4c8809
sctp: Fix skb_over_panic resulting from multiple invalid \
parameter errors (CVE-2010-1173) (v4)
cause 'error cause' never be add the the ERROR chunk due to
some typo when check valid length in sctp_init_cause_fixed().
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/sctp/sm_make_chunk.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 30c1767..70d6c10 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -141,7 +141,7 @@ int sctp_init_cause_fixed(struct sctp_chunk *chunk, __be16 cause_code,
len = sizeof(sctp_errhdr_t) + paylen;
err.length = htons(len);
- if (skb_tailroom(chunk->skb) > len)
+ if (skb_tailroom(chunk->skb) < len)
return -ENOSPC;
chunk->subh.err_hdr = sctp_addto_chunk_fixed(chunk,
sizeof(sctp_errhdr_t),
@@ -1421,7 +1421,7 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk,
int len, const void *data)
{
- if (skb_tailroom(chunk->skb) > len)
+ if (skb_tailroom(chunk->skb) >= len)
return sctp_addto_chunk(chunk, len, data);
else
return NULL;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 002/260] KEYS: Return more accurate error codes
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 001/260] sctp: fix append error cause to ERROR chunk correctly Paul Gortmaker
@ 2011-01-02 7:14 ` Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 003/260] ath5k: drop warning on jumbo frames Paul Gortmaker
` (259 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:14 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, David Howells, James Morris,
Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit 4d09ec0f705cf88a12add029c058b53f288cfaa2 upstream.
We were using the wrong variable here so the error codes weren't being returned
properly. The original code returns -ENOKEY.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
security/keys/process_keys.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
index 06c2ccf..20a38fe 100644
--- a/security/keys/process_keys.c
+++ b/security/keys/process_keys.c
@@ -508,7 +508,7 @@ try_again:
ret = install_thread_keyring();
if (ret < 0) {
- key = ERR_PTR(ret);
+ key_ref = ERR_PTR(ret);
goto error;
}
goto reget_creds;
@@ -526,7 +526,7 @@ try_again:
ret = install_process_keyring();
if (ret < 0) {
- key = ERR_PTR(ret);
+ key_ref = ERR_PTR(ret);
goto error;
}
goto reget_creds;
@@ -585,7 +585,7 @@ try_again:
case KEY_SPEC_GROUP_KEYRING:
/* group keyrings are not yet supported */
- key = ERR_PTR(-EINVAL);
+ key_ref = ERR_PTR(-EINVAL);
goto error;
case KEY_SPEC_REQKEY_AUTH_KEY:
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 003/260] ath5k: drop warning on jumbo frames
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 001/260] sctp: fix append error cause to ERROR chunk correctly Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 002/260] KEYS: Return more accurate error codes Paul Gortmaker
@ 2011-01-02 7:14 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 004/260] ext4: check missed return value in ext4_sync_file() Paul Gortmaker
` (258 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:14 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Luis R. Rodriguez, John W. Linville,
Paul Gortmaker
From: Luis R. Rodriguez <lrodriguez@atheros.com>
commit 9637e516d16a58b13f6098cfe899e22963132be3 upstream.
Jumbo frames are not supported, and if they are seen it is likely
a bogus frame so just silently discard them instead of warning on
them all time. Also, instead of dropping them immediately though
move the check *after* we check for all sort of frame errors. This
should enable us to discard these frames if the hardware picks
other bogus items first. Lets see if we still get those jumbo
counters increasing still with this.
Jumbo frames would happen if we tell hardware we can support
a small 802.11 chunks of DMA'd frame, hardware would split RX'd
frames into parts and we'd have to reconstruct them in software.
This is done with USB due to the bulk size but with ath5k we
already provide a good limit to hardware and this should not be
happening.
This is reported quite often and if it fills the logs then this
needs to be addressed and to avoid spurious reports.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/wireless/ath/ath5k/base.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a350147..db84169 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1871,11 +1871,6 @@ ath5k_tasklet_rx(unsigned long data)
return;
}
- if (unlikely(rs.rs_more)) {
- ATH5K_WARN(sc, "unsupported jumbo\n");
- goto next;
- }
-
if (unlikely(rs.rs_status)) {
if (rs.rs_status & AR5K_RXERR_PHY)
goto next;
@@ -1905,6 +1900,8 @@ ath5k_tasklet_rx(unsigned long data)
sc->opmode != NL80211_IFTYPE_MONITOR)
goto next;
}
+ if (unlikely(rs.rs_more))
+ goto next;
accept:
next_skb = ath5k_rx_skb_alloc(sc, &next_skb_addr);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 004/260] ext4: check missed return value in ext4_sync_file()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (2 preceding siblings ...)
2011-01-02 7:14 ` [34-longterm 003/260] ath5k: drop warning on jumbo frames Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 005/260] ext4: fix memory leaks in error path handling of ext4_ext_zeroout() Paul Gortmaker
` (257 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Monakhov, Theodore Ts'o, Paul Gortmaker
From: Dmitry Monakhov <dmonakhov@openvz.org>
commit 0671e704658b9f26f85e78d51176daa861f955c7 upstream.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/fsync.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 0d0c323..42bd94a 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -101,7 +101,7 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
(journal->j_fs_dev != journal->j_dev) &&
(journal->j_flags & JBD2_BARRIER))
blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
- jbd2_log_wait_commit(journal, commit_tid);
+ ret = jbd2_log_wait_commit(journal, commit_tid);
} else if (journal->j_flags & JBD2_BARRIER)
blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
return ret;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 005/260] ext4: fix memory leaks in error path handling of ext4_ext_zeroout()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (3 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 004/260] ext4: check missed return value in ext4_sync_file() Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 006/260] ext4: Remove unnecessary call to ext4_get_group_desc() in mballoc Paul Gortmaker
` (256 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jing Zhang, Theodore Ts'o, Paul Gortmaker
From: Jing Zhang <zj.barak@gmail.com>
commit b720303df7352d4a7a1f61e467e0a124913c0d41 upstream.
When EIO occurs after bio is submitted, there is no memory free
operation for bio, which results in memory leakage. And there is also
no check against bio_alloc() for bio.
Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Jing Zhang <zj.barak@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/extents.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 236b834..228eeaf 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2544,7 +2544,7 @@ static void bi_complete(struct bio *bio, int error)
/* FIXME!! we need to try to merge to left or right after zero-out */
static int ext4_ext_zeroout(struct inode *inode, struct ext4_extent *ex)
{
- int ret = -EIO;
+ int ret;
struct bio *bio;
int blkbits, blocksize;
sector_t ee_pblock;
@@ -2568,6 +2568,9 @@ static int ext4_ext_zeroout(struct inode *inode, struct ext4_extent *ex)
len = ee_len;
bio = bio_alloc(GFP_NOIO, len);
+ if (!bio)
+ return -ENOMEM;
+
bio->bi_sector = ee_pblock;
bio->bi_bdev = inode->i_sb->s_bdev;
@@ -2595,17 +2598,15 @@ static int ext4_ext_zeroout(struct inode *inode, struct ext4_extent *ex)
submit_bio(WRITE, bio);
wait_for_completion(&event);
- if (test_bit(BIO_UPTODATE, &bio->bi_flags))
- ret = 0;
- else {
- ret = -EIO;
- break;
+ if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) {
+ bio_put(bio);
+ return -EIO;
}
bio_put(bio);
ee_len -= done;
ee_pblock += done << (blkbits - 9);
}
- return ret;
+ return 0;
}
#define EXT4_EXT_ZERO_LEN 7
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 006/260] ext4: Remove unnecessary call to ext4_get_group_desc() in mballoc
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (4 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 005/260] ext4: fix memory leaks in error path handling of ext4_ext_zeroout() Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 007/260] ext4: rename ext4_mb_release_desc() to ext4_mb_unload_buddy() Paul Gortmaker
` (255 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jing Zhang, Theodore Ts'o, Paul Gortmaker
From: Jing Zhang <zj.barak@gmail.com>
commit 62e823a2cba18509ee826d775270e8ef9071b5bc upstream.
Signed-off-by: Jing Zhang <zj.barak@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/mballoc.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index b423a36..0550ea3 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2025,7 +2025,6 @@ repeat:
for (i = 0; i < ngroups; group++, i++) {
struct ext4_group_info *grp;
- struct ext4_group_desc *desc;
if (group == ngroups)
group = 0;
@@ -2048,7 +2047,6 @@ repeat:
}
ac->ac_groups_scanned++;
- desc = ext4_get_group_desc(sb, group, NULL);
if (cr == 0)
ext4_mb_simple_scan_group(ac, &e4b);
else if (cr == 1 &&
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 007/260] ext4: rename ext4_mb_release_desc() to ext4_mb_unload_buddy()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (5 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 006/260] ext4: Remove unnecessary call to ext4_get_group_desc() in mballoc Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 008/260] ext4: allow defrag (EXT4_IOC_MOVE_EXT) in 32bit compat mode Paul Gortmaker
` (254 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jing Zhang, Theodore Ts'o, Paul Gortmaker
From: Jing Zhang <zj.barak@gmail.com>
commit e39e07fdfd98be8650385f12a7b81d6adc547510 upstream.
This function cleans up after ext4_mb_load_buddy(), so the renaming
makes the code clearer.
Signed-off-by: Jing Zhang <zj.barak@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/mballoc.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 0550ea3..8639d5a6 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1150,7 +1150,7 @@ err:
return ret;
}
-static void ext4_mb_release_desc(struct ext4_buddy *e4b)
+static void ext4_mb_unload_buddy(struct ext4_buddy *e4b)
{
if (e4b->bd_bitmap_page)
page_cache_release(e4b->bd_bitmap_page);
@@ -1617,7 +1617,7 @@ int ext4_mb_try_best_found(struct ext4_allocation_context *ac,
}
ext4_unlock_group(ac->ac_sb, group);
- ext4_mb_release_desc(e4b);
+ ext4_mb_unload_buddy(e4b);
return 0;
}
@@ -1672,7 +1672,7 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac,
ext4_mb_use_best_found(ac, e4b);
}
ext4_unlock_group(ac->ac_sb, group);
- ext4_mb_release_desc(e4b);
+ ext4_mb_unload_buddy(e4b);
return 0;
}
@@ -2042,7 +2042,7 @@ repeat:
if (!ext4_mb_good_group(ac, group, cr)) {
/* someone did allocation from this group */
ext4_unlock_group(sb, group);
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
continue;
}
@@ -2056,7 +2056,7 @@ repeat:
ext4_mb_complex_scan_group(ac, &e4b);
ext4_unlock_group(sb, group);
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
if (ac->ac_status != AC_STATUS_CONTINUE)
break;
@@ -2146,7 +2146,7 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
ext4_lock_group(sb, group);
memcpy(&sg, ext4_get_group_info(sb, group), i);
ext4_unlock_group(sb, group);
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
seq_printf(seq, "#%-5u: %-5u %-5u %-5u [", group, sg.info.bb_free,
sg.info.bb_fragments, sg.info.bb_first_free);
@@ -2566,7 +2566,7 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn)
}
ext4_unlock_group(sb, entry->group);
kmem_cache_free(ext4_free_ext_cachep, entry);
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
}
mb_debug(1, "freed %u blocks in %u structures\n", count, count2);
@@ -3695,7 +3695,7 @@ out:
ext4_unlock_group(sb, group);
if (ac)
kmem_cache_free(ext4_ac_cachep, ac);
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
put_bh(bitmap_bh);
return free;
}
@@ -3799,7 +3799,7 @@ repeat:
if (bitmap_bh == NULL) {
ext4_error(sb, "Error reading block bitmap for %u",
group);
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
continue;
}
@@ -3808,7 +3808,7 @@ repeat:
ext4_mb_release_inode_pa(&e4b, bitmap_bh, pa, ac);
ext4_unlock_group(sb, group);
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
put_bh(bitmap_bh);
list_del(&pa->u.pa_tmp_list);
@@ -4072,7 +4072,7 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb,
ext4_mb_release_group_pa(&e4b, pa, ac);
ext4_unlock_group(sb, group);
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
list_del(&pa->u.pa_tmp_list);
call_rcu(&(pa)->u.pa_rcu, ext4_mb_pa_callback);
}
@@ -4608,7 +4608,7 @@ do_more:
atomic_add(count, &sbi->s_flex_groups[flex_group].free_blocks);
}
- ext4_mb_release_desc(&e4b);
+ ext4_mb_unload_buddy(&e4b);
freed += count;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 008/260] ext4: allow defrag (EXT4_IOC_MOVE_EXT) in 32bit compat mode
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (6 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 007/260] ext4: rename ext4_mb_release_desc() to ext4_mb_unload_buddy() Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 009/260] ext4: fix quota accounting in case of fallocate Paul Gortmaker
` (253 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Christian Borntraeger, Theodore Ts'o,
Akira Fujita, Paul Gortmaker
From: Christian Borntraeger <borntraeger@de.ibm.com>
commit b684b2ee9409f2890a8b3aea98525bbe5f84e276 upstream.
I have an x86_64 kernel with i386 userspace. e4defrag fails on the
EXT4_IOC_MOVE_EXT ioctl because it is not wired up for the compat
case. It seems that struct move_extent is compat save, only types
with fixed widths are used:
{
__u32 reserved; /* should be zero */
__u32 donor_fd; /* donor file descriptor */
__u64 orig_start; /* logical start offset in block for orig */
__u64 donor_start; /* logical start offset in block for donor */
__u64 len; /* block length to be moved */
__u64 moved_len; /* moved block length */
};
Lets just wire up EXT4_IOC_MOVE_EXT for the compat case.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
CC: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/ioctl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 016d024..66fa0b0 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -375,6 +375,8 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
case EXT4_IOC_GROUP_ADD:
break;
+ case EXT4_IOC_MOVE_EXT:
+ break;
default:
return -ENOIOCTLCMD;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 009/260] ext4: fix quota accounting in case of fallocate
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (7 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 008/260] ext4: allow defrag (EXT4_IOC_MOVE_EXT) in 32bit compat mode Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 010/260] ext4: don't return to userspace after freezing the fs with a mutex held Paul Gortmaker
` (252 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Monakhov, Theodore Ts'o, Paul Gortmaker
From: Dmitry Monakhov <dmonakhov@openvz.org>
commit 35121c9860316d7799cea0fbc359a9186e7c2747 upstream.
allocated_meta_data is already included in 'used' variable.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/inode.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 81d6054..55bfcd9 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1126,7 +1126,8 @@ void ext4_da_update_reserve_space(struct inode *inode,
*/
if (allocated_meta_blocks)
dquot_claim_block(inode, allocated_meta_blocks);
- dquot_release_reservation_block(inode, mdb_free + used);
+ dquot_release_reservation_block(inode, mdb_free + used -
+ allocated_meta_blocks);
}
/*
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 010/260] ext4: don't return to userspace after freezing the fs with a mutex held
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (8 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 009/260] ext4: fix quota accounting in case of fallocate Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 011/260] ext4: stop issuing discards if not supported by device Paul Gortmaker
` (251 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Sandeen, Theodore Ts'o, Paul Gortmaker
From: Eric Sandeen <sandeen@redhat.com>
commit 6b0310fbf087ad6e9e3b8392adca97cd77184084 upstream.
ext4_freeze() used jbd2_journal_lock_updates() which takes
the j_barrier mutex, and then returns to userspace. The
kernel does not like this:
================================================
[ BUG: lock held when returning to user space! ]
------------------------------------------------
lvcreate/1075 is leaving the kernel with locks still held!
1 lock held by lvcreate/1075:
#0: (&journal->j_barrier){+.+...}, at: [<ffffffff811c6214>]
jbd2_journal_lock_updates+0xe1/0xf0
Use vfs_check_frozen() added to ext4_journal_start_sb() and
ext4_force_commit() instead.
Addresses-Red-Hat-Bugzilla: #568503
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/super.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e14d22c..00d09f5 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -241,6 +241,7 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
if (sb->s_flags & MS_RDONLY)
return ERR_PTR(-EROFS);
+ vfs_check_frozen(sb, SB_FREEZE_WRITE);
/* Special case here: if the journal has aborted behind our
* backs (eg. EIO in the commit thread), then we still need to
* take the FS itself readonly cleanly. */
@@ -3485,8 +3486,10 @@ int ext4_force_commit(struct super_block *sb)
return 0;
journal = EXT4_SB(sb)->s_journal;
- if (journal)
+ if (journal) {
+ vfs_check_frozen(sb, SB_FREEZE_WRITE);
ret = ext4_journal_force_commit(journal);
+ }
return ret;
}
@@ -3535,18 +3538,16 @@ static int ext4_freeze(struct super_block *sb)
* the journal.
*/
error = jbd2_journal_flush(journal);
- if (error < 0) {
- out:
- jbd2_journal_unlock_updates(journal);
- return error;
- }
+ if (error < 0)
+ goto out;
/* Journal blocked and flushed, clear needs_recovery flag. */
EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
error = ext4_commit_super(sb, 1);
- if (error)
- goto out;
- return 0;
+out:
+ /* we rely on s_frozen to stop further updates */
+ jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
+ return error;
}
/*
@@ -3563,7 +3564,6 @@ static int ext4_unfreeze(struct super_block *sb)
EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
ext4_commit_super(sb, 1);
unlock_super(sb);
- jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
return 0;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 011/260] ext4: stop issuing discards if not supported by device
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (9 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 010/260] ext4: don't return to userspace after freezing the fs with a mutex held Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 012/260] ext4: don't scan/accumulate more pages than mballoc will allocate Paul Gortmaker
` (250 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Sandeen, Theodore Ts'o, Paul Gortmaker
From: Eric Sandeen <sandeen@redhat.com>
commit a30eec2a8650a77f754e84b2e15f062fe652baa7 upstream.
Turn off issuance of discard requests if the device does
not support it - similar to the action we take for barriers.
This will save a little computation time if a non-discardable
device is mounted with -o discard, and also makes it obvious
that it's not doing what was asked at mount time ...
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/mballoc.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 8639d5a6..4f2d3a9 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2534,6 +2534,7 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn)
entry->count, entry->group, entry);
if (test_opt(sb, DISCARD)) {
+ int ret;
ext4_fsblk_t discard_block;
discard_block = entry->start_blk +
@@ -2541,7 +2542,12 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn)
trace_ext4_discard_blocks(sb,
(unsigned long long)discard_block,
entry->count);
- sb_issue_discard(sb, discard_block, entry->count);
+ ret = sb_issue_discard(sb, discard_block, entry->count);
+ if (ret == EOPNOTSUPP) {
+ ext4_warning(sb,
+ "discard not supported, disabling");
+ clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD);
+ }
}
err = ext4_mb_load_buddy(sb, entry->group, &e4b);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 012/260] ext4: don't scan/accumulate more pages than mballoc will allocate
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (10 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 011/260] ext4: stop issuing discards if not supported by device Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 013/260] ext4: Do not zero out uninitialized extents beyond i_size Paul Gortmaker
` (249 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Sandeen, Theodore Ts'o, Paul Gortmaker
From: Eric Sandeen <sandeen@redhat.com>
commit c445e3e0a5c2804524dec6e55f66d63f6bc5bc3e upstream.
There was a bug reported on RHEL5 that a 10G dd on a 12G box
had a very, very slow sync after that.
At issue was the loop in write_cache_pages scanning all the way
to the end of the 10G file, even though the subsequent call
to mpage_da_submit_io would only actually write a smallish amt; then
we went back to the write_cache_pages loop ... wasting tons of time
in calling __mpage_da_writepage for thousands of pages we would
just revisit (many times) later.
Upstream it's not such a big issue for sys_sync because we get
to the loop with a much smaller nr_to_write, which limits the loop.
However, talking with Aneesh he realized that fsync upstream still
gets here with a very large nr_to_write and we face the same problem.
This patch makes mpage_add_bh_to_extent stop the loop after we've
accumulated 2048 pages, by setting mpd->io_done = 1; which ultimately
causes the write_cache_pages loop to break.
Repeating the test with a dirty_ratio of 80 (to leave something for
fsync to do), I don't see huge IO performance gains, but the reduction
in cpu usage is striking: 80% usage with stock, and 2% with the
below patch. Instrumenting the loop in write_cache_pages clearly
shows that we are wasting time here.
Eventually we need to change mpage_da_map_pages() also submit its I/O
to the block layer, subsuming mpage_da_submit_io(), and then change it
call ext4_get_blocks() multiple times.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/inode.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 55bfcd9..89a31e8 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2350,6 +2350,15 @@ static void mpage_add_bh_to_extent(struct mpage_da_data *mpd,
sector_t next;
int nrblocks = mpd->b_size >> mpd->inode->i_blkbits;
+ /*
+ * XXX Don't go larger than mballoc is willing to allocate
+ * This is a stopgap solution. We eventually need to fold
+ * mpage_da_submit_io() into this function and then call
+ * ext4_get_blocks() multiple times in a loop
+ */
+ if (nrblocks >= 8*1024*1024/mpd->inode->i_sb->s_blocksize)
+ goto flush_it;
+
/* check if thereserved journal credits might overflow */
if (!(EXT4_I(mpd->inode)->i_flags & EXT4_EXTENTS_FL)) {
if (nrblocks >= EXT4_MAX_TRANS_DATA) {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 013/260] ext4: Do not zero out uninitialized extents beyond i_size
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (11 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 012/260] ext4: don't scan/accumulate more pages than mballoc will allocate Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 014/260] ext4: clean up inode bitmaps manipulation in ext4_free_inode Paul Gortmaker
` (248 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Monakhov, Theodore Ts'o, Paul Gortmaker
From: Dmitry Monakhov <dmonakhov@openvz.org>
commit 21ca087a3891efab4d45488db8febee474d26c68 upstream.
The extents code will sometimes zero out blocks and mark them as
initialized instead of splitting an extent into several smaller ones.
This optimization however, causes problems if the extent is beyond
i_size because fsck will complain if there are uninitialized blocks
after i_size as this can not be distinguished from an inode that has
an incorrect i_size field.
https://bugzilla.kernel.org/show_bug.cgi?id=15742
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/extents.c | 67 ++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 51 insertions(+), 16 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 228eeaf..ee611da 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2631,11 +2631,21 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
struct ext4_extent *ex2 = NULL;
struct ext4_extent *ex3 = NULL;
struct ext4_extent_header *eh;
- ext4_lblk_t ee_block;
+ ext4_lblk_t ee_block, eof_block;
unsigned int allocated, ee_len, depth;
ext4_fsblk_t newblock;
int err = 0;
int ret = 0;
+ int may_zeroout;
+
+ ext_debug("ext4_ext_convert_to_initialized: inode %lu, logical"
+ "block %llu, max_blocks %u\n", inode->i_ino,
+ (unsigned long long)iblock, max_blocks);
+
+ eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
+ inode->i_sb->s_blocksize_bits;
+ if (eof_block < iblock + max_blocks)
+ eof_block = iblock + max_blocks;
depth = ext_depth(inode);
eh = path[depth].p_hdr;
@@ -2644,16 +2654,23 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
ee_len = ext4_ext_get_actual_len(ex);
allocated = ee_len - (iblock - ee_block);
newblock = iblock - ee_block + ext_pblock(ex);
+
ex2 = ex;
orig_ex.ee_block = ex->ee_block;
orig_ex.ee_len = cpu_to_le16(ee_len);
ext4_ext_store_pblock(&orig_ex, ext_pblock(ex));
+ /*
+ * It is safe to convert extent to initialized via explicit
+ * zeroout only if extent is fully insde i_size or new_size.
+ */
+ may_zeroout = ee_block + ee_len <= eof_block;
+
err = ext4_ext_get_access(handle, inode, path + depth);
if (err)
goto out;
/* If extent has less than 2*EXT4_EXT_ZERO_LEN zerout directly */
- if (ee_len <= 2*EXT4_EXT_ZERO_LEN) {
+ if (ee_len <= 2*EXT4_EXT_ZERO_LEN && may_zeroout) {
err = ext4_ext_zeroout(inode, &orig_ex);
if (err)
goto fix_extent_len;
@@ -2684,7 +2701,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
if (allocated > max_blocks) {
unsigned int newdepth;
/* If extent has less than EXT4_EXT_ZERO_LEN zerout directly */
- if (allocated <= EXT4_EXT_ZERO_LEN) {
+ if (allocated <= EXT4_EXT_ZERO_LEN && may_zeroout) {
/*
* iblock == ee_block is handled by the zerouout
* at the beginning.
@@ -2760,7 +2777,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
ex3->ee_len = cpu_to_le16(allocated - max_blocks);
ext4_ext_mark_uninitialized(ex3);
err = ext4_ext_insert_extent(handle, inode, path, ex3, 0);
- if (err == -ENOSPC) {
+ if (err == -ENOSPC && may_zeroout) {
err = ext4_ext_zeroout(inode, &orig_ex);
if (err)
goto fix_extent_len;
@@ -2784,8 +2801,10 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
* update the extent length after successful insert of the
* split extent
*/
- orig_ex.ee_len = cpu_to_le16(ee_len -
- ext4_ext_get_actual_len(ex3));
+ ee_len -= ext4_ext_get_actual_len(ex3);
+ orig_ex.ee_len = cpu_to_le16(ee_len);
+ may_zeroout = ee_block + ee_len <= eof_block;
+
depth = newdepth;
ext4_ext_drop_refs(path);
path = ext4_ext_find_extent(inode, iblock, path);
@@ -2809,7 +2828,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
* otherwise give the extent a chance to merge to left
*/
if (le16_to_cpu(orig_ex.ee_len) <= EXT4_EXT_ZERO_LEN &&
- iblock != ee_block) {
+ iblock != ee_block && may_zeroout) {
err = ext4_ext_zeroout(inode, &orig_ex);
if (err)
goto fix_extent_len;
@@ -2878,7 +2897,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
goto out;
insert:
err = ext4_ext_insert_extent(handle, inode, path, &newex, 0);
- if (err == -ENOSPC) {
+ if (err == -ENOSPC && may_zeroout) {
err = ext4_ext_zeroout(inode, &orig_ex);
if (err)
goto fix_extent_len;
@@ -2938,14 +2957,21 @@ static int ext4_split_unwritten_extents(handle_t *handle,
struct ext4_extent *ex2 = NULL;
struct ext4_extent *ex3 = NULL;
struct ext4_extent_header *eh;
- ext4_lblk_t ee_block;
+ ext4_lblk_t ee_block, eof_block;
unsigned int allocated, ee_len, depth;
ext4_fsblk_t newblock;
int err = 0;
+ int may_zeroout;
+
+ ext_debug("ext4_split_unwritten_extents: inode %lu, logical"
+ "block %llu, max_blocks %u\n", inode->i_ino,
+ (unsigned long long)iblock, max_blocks);
+
+ eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
+ inode->i_sb->s_blocksize_bits;
+ if (eof_block < iblock + max_blocks)
+ eof_block = iblock + max_blocks;
- ext_debug("ext4_split_unwritten_extents: inode %lu,"
- "iblock %llu, max_blocks %u\n", inode->i_ino,
- (unsigned long long)iblock, max_blocks);
depth = ext_depth(inode);
eh = path[depth].p_hdr;
ex = path[depth].p_ext;
@@ -2953,12 +2979,19 @@ static int ext4_split_unwritten_extents(handle_t *handle,
ee_len = ext4_ext_get_actual_len(ex);
allocated = ee_len - (iblock - ee_block);
newblock = iblock - ee_block + ext_pblock(ex);
+
ex2 = ex;
orig_ex.ee_block = ex->ee_block;
orig_ex.ee_len = cpu_to_le16(ee_len);
ext4_ext_store_pblock(&orig_ex, ext_pblock(ex));
/*
+ * It is safe to convert extent to initialized via explicit
+ * zeroout only if extent is fully insde i_size or new_size.
+ */
+ may_zeroout = ee_block + ee_len <= eof_block;
+
+ /*
* If the uninitialized extent begins at the same logical
* block where the write begins, and the write completely
* covers the extent, then we don't need to split it.
@@ -2992,7 +3025,7 @@ static int ext4_split_unwritten_extents(handle_t *handle,
ex3->ee_len = cpu_to_le16(allocated - max_blocks);
ext4_ext_mark_uninitialized(ex3);
err = ext4_ext_insert_extent(handle, inode, path, ex3, flags);
- if (err == -ENOSPC) {
+ if (err == -ENOSPC && may_zeroout) {
err = ext4_ext_zeroout(inode, &orig_ex);
if (err)
goto fix_extent_len;
@@ -3016,8 +3049,10 @@ static int ext4_split_unwritten_extents(handle_t *handle,
* update the extent length after successful insert of the
* split extent
*/
- orig_ex.ee_len = cpu_to_le16(ee_len -
- ext4_ext_get_actual_len(ex3));
+ ee_len -= ext4_ext_get_actual_len(ex3);
+ orig_ex.ee_len = cpu_to_le16(ee_len);
+ may_zeroout = ee_block + ee_len <= eof_block;
+
depth = newdepth;
ext4_ext_drop_refs(path);
path = ext4_ext_find_extent(inode, iblock, path);
@@ -3063,7 +3098,7 @@ static int ext4_split_unwritten_extents(handle_t *handle,
goto out;
insert:
err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
- if (err == -ENOSPC) {
+ if (err == -ENOSPC && may_zeroout) {
err = ext4_ext_zeroout(inode, &orig_ex);
if (err)
goto fix_extent_len;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 014/260] ext4: clean up inode bitmaps manipulation in ext4_free_inode
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (12 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 013/260] ext4: Do not zero out uninitialized extents beyond i_size Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 015/260] ext4: init statistics after journal recovery Paul Gortmaker
` (247 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Monakhov, Theodore Ts'o, Paul Gortmaker
From: Dmitry Monakhov <dmonakhov@openvz.org>
commit d17413c08cd2b1dd2bf2cfdbb0f7b736b2b2b15c upstream.
- Reorganize locking scheme to batch two atomic operation in to one.
This also allow us to state what healthy group must obey following rule
ext4_free_inodes_count(sb, gdp) == ext4_count_free(inode_bitmap, NUM);
- Fix possible undefined pointer dereference.
- Even if group descriptor stats aren't accessible we have to update
inode bitmaps.
- Move non-group members update out of group_lock.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/ialloc.c | 81 ++++++++++++++++++++++++-----------------------------
1 files changed, 37 insertions(+), 44 deletions(-)
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 57f6eef..52618d5 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -240,56 +240,49 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
if (fatal)
goto error_return;
- /* Ok, now we can actually update the inode bitmaps.. */
- cleared = ext4_clear_bit_atomic(ext4_group_lock_ptr(sb, block_group),
- bit, bitmap_bh->b_data);
- if (!cleared)
- ext4_error(sb, "bit already cleared for inode %lu", ino);
- else {
- gdp = ext4_get_group_desc(sb, block_group, &bh2);
-
+ fatal = -ESRCH;
+ gdp = ext4_get_group_desc(sb, block_group, &bh2);
+ if (gdp) {
BUFFER_TRACE(bh2, "get_write_access");
fatal = ext4_journal_get_write_access(handle, bh2);
- if (fatal) goto error_return;
-
- if (gdp) {
- ext4_lock_group(sb, block_group);
- count = ext4_free_inodes_count(sb, gdp) + 1;
- ext4_free_inodes_set(sb, gdp, count);
- if (is_directory) {
- count = ext4_used_dirs_count(sb, gdp) - 1;
- ext4_used_dirs_set(sb, gdp, count);
- if (sbi->s_log_groups_per_flex) {
- ext4_group_t f;
-
- f = ext4_flex_group(sbi, block_group);
- atomic_dec(&sbi->s_flex_groups[f].used_dirs);
- }
+ }
+ ext4_lock_group(sb, block_group);
+ cleared = ext4_clear_bit(bit, bitmap_bh->b_data);
+ if (fatal || !cleared) {
+ ext4_unlock_group(sb, block_group);
+ goto out;
+ }
- }
- gdp->bg_checksum = ext4_group_desc_csum(sbi,
- block_group, gdp);
- ext4_unlock_group(sb, block_group);
- percpu_counter_inc(&sbi->s_freeinodes_counter);
- if (is_directory)
- percpu_counter_dec(&sbi->s_dirs_counter);
-
- if (sbi->s_log_groups_per_flex) {
- ext4_group_t f;
-
- f = ext4_flex_group(sbi, block_group);
- atomic_inc(&sbi->s_flex_groups[f].free_inodes);
- }
- }
- BUFFER_TRACE(bh2, "call ext4_handle_dirty_metadata");
- err = ext4_handle_dirty_metadata(handle, NULL, bh2);
- if (!fatal) fatal = err;
+ count = ext4_free_inodes_count(sb, gdp) + 1;
+ ext4_free_inodes_set(sb, gdp, count);
+ if (is_directory) {
+ count = ext4_used_dirs_count(sb, gdp) - 1;
+ ext4_used_dirs_set(sb, gdp, count);
+ percpu_counter_dec(&sbi->s_dirs_counter);
}
- BUFFER_TRACE(bitmap_bh, "call ext4_handle_dirty_metadata");
- err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
- if (!fatal)
- fatal = err;
- sb->s_dirt = 1;
+ gdp->bg_checksum = ext4_group_desc_csum(sbi, block_group, gdp);
+ ext4_unlock_group(sb, block_group);
+
+ percpu_counter_inc(&sbi->s_freeinodes_counter);
+ if (sbi->s_log_groups_per_flex) {
+ ext4_group_t f = ext4_flex_group(sbi, block_group);
+
+ atomic_inc(&sbi->s_flex_groups[f].free_inodes);
+ if (is_directory)
+ atomic_dec(&sbi->s_flex_groups[f].used_dirs);
+ }
+ BUFFER_TRACE(bh2, "call ext4_handle_dirty_metadata");
+ fatal = ext4_handle_dirty_metadata(handle, NULL, bh2);
+out:
+ if (cleared) {
+ BUFFER_TRACE(bitmap_bh, "call ext4_handle_dirty_metadata");
+ err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
+ if (!fatal)
+ fatal = err;
+ sb->s_dirt = 1;
+ } else
+ ext4_error(sb, "bit already cleared for inode %lu", ino);
+
error_return:
brelse(bitmap_bh);
ext4_std_error(sb, fatal);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 015/260] ext4: init statistics after journal recovery
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (13 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 014/260] ext4: clean up inode bitmaps manipulation in ext4_free_inode Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 016/260] ext4: Remove extraneous newlines in ext4_msg() calls Paul Gortmaker
` (246 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Monakhov, Theodore Ts'o, Paul Gortmaker
From: Dmitry Monakhov <dmonakhov@openvz.org>
commit 84061e07c5fbbbf9dc8aef8fb750fc3a2dfc31f3 upstream.
Currently block/inode/dir counters initialized before journal was
recovered. In fact after journal recovery this info will probably
change. And freeblocks it critical for correct delalloc mode
accounting.
https://bugzilla.kernel.org/show_bug.cgi?id=15768
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/super.c | 40 ++++++++++++++++++----------------------
1 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 00d09f5..d83cdcb 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2794,24 +2794,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
get_random_bytes(&sbi->s_next_generation, sizeof(u32));
spin_lock_init(&sbi->s_next_gen_lock);
- err = percpu_counter_init(&sbi->s_freeblocks_counter,
- ext4_count_free_blocks(sb));
- if (!err) {
- err = percpu_counter_init(&sbi->s_freeinodes_counter,
- ext4_count_free_inodes(sb));
- }
- if (!err) {
- err = percpu_counter_init(&sbi->s_dirs_counter,
- ext4_count_dirs(sb));
- }
- if (!err) {
- err = percpu_counter_init(&sbi->s_dirtyblocks_counter, 0);
- }
- if (err) {
- ext4_msg(sb, KERN_ERR, "insufficient memory");
- goto failed_mount3;
- }
-
sbi->s_stripe = ext4_get_stripe_size(sbi);
sbi->s_max_writeback_mb_bump = 128;
@@ -2911,6 +2893,20 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
set_task_ioprio(sbi->s_journal->j_task, journal_ioprio);
no_journal:
+ err = percpu_counter_init(&sbi->s_freeblocks_counter,
+ ext4_count_free_blocks(sb));
+ if (!err)
+ err = percpu_counter_init(&sbi->s_freeinodes_counter,
+ ext4_count_free_inodes(sb));
+ if (!err)
+ err = percpu_counter_init(&sbi->s_dirs_counter,
+ ext4_count_dirs(sb));
+ if (!err)
+ err = percpu_counter_init(&sbi->s_dirtyblocks_counter, 0);
+ if (err) {
+ ext4_msg(sb, KERN_ERR, "insufficient memory");
+ goto failed_mount_wq;
+ }
if (test_opt(sb, NOBH)) {
if (!(test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)) {
ext4_msg(sb, KERN_WARNING, "Ignoring nobh option - "
@@ -3060,6 +3056,10 @@ failed_mount_wq:
jbd2_journal_destroy(sbi->s_journal);
sbi->s_journal = NULL;
}
+ percpu_counter_destroy(&sbi->s_freeblocks_counter);
+ percpu_counter_destroy(&sbi->s_freeinodes_counter);
+ percpu_counter_destroy(&sbi->s_dirs_counter);
+ percpu_counter_destroy(&sbi->s_dirtyblocks_counter);
failed_mount3:
if (sbi->s_flex_groups) {
if (is_vmalloc_addr(sbi->s_flex_groups))
@@ -3067,10 +3067,6 @@ failed_mount3:
else
kfree(sbi->s_flex_groups);
}
- percpu_counter_destroy(&sbi->s_freeblocks_counter);
- percpu_counter_destroy(&sbi->s_freeinodes_counter);
- percpu_counter_destroy(&sbi->s_dirs_counter);
- percpu_counter_destroy(&sbi->s_dirtyblocks_counter);
failed_mount2:
for (i = 0; i < db_count; i++)
brelse(sbi->s_group_desc[i]);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 016/260] ext4: Remove extraneous newlines in ext4_msg() calls
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (14 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 015/260] ext4: init statistics after journal recovery Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 017/260] ext4: Prevent creation of files larger than RLIMIT_FSIZE using fallocate Paul Gortmaker
` (245 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Curt Wohlgemuth, Theodore Ts'o, Paul Gortmaker
From: Curt Wohlgemuth <curtw@google.com>
commit fbe845ddf368f77f86aa7500f8fd2690f54c66a8 upstream.
Addresses-Google-Bug: #2562325
Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/inode.c | 6 +++---
fs/ext4/super.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 89a31e8..3c479ef 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2283,7 +2283,7 @@ static int mpage_da_map_blocks(struct mpage_da_data *mpd)
ext4_msg(mpd->inode->i_sb, KERN_CRIT,
"delayed block allocation failed for inode %lu at "
"logical offset %llu with max blocks %zd with "
- "error %d\n", mpd->inode->i_ino,
+ "error %d", mpd->inode->i_ino,
(unsigned long long) next,
mpd->b_size >> mpd->inode->i_blkbits, err);
printk(KERN_CRIT "This should not happen!! "
@@ -2951,7 +2951,7 @@ retry:
if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
ext4_msg(inode->i_sb, KERN_CRIT, "%s: jbd2_start: "
- "%ld pages, ino %lu; err %d\n", __func__,
+ "%ld pages, ino %lu; err %d", __func__,
wbc->nr_to_write, inode->i_ino, ret);
goto out_writepages;
}
@@ -3026,7 +3026,7 @@ retry:
if (pages_skipped != wbc->pages_skipped)
ext4_msg(inode->i_sb, KERN_CRIT,
"This should not happen leaving %s "
- "with nr_to_write = %ld ret = %d\n",
+ "with nr_to_write = %ld ret = %d",
__func__, wbc->nr_to_write, ret);
/* Update index */
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d83cdcb..f9e57e1 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2998,7 +2998,7 @@ no_journal:
err = ext4_setup_system_zone(sb);
if (err) {
ext4_msg(sb, KERN_ERR, "failed to initialize system "
- "zone (%d)\n", err);
+ "zone (%d)", err);
goto failed_mount4;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 017/260] ext4: Prevent creation of files larger than RLIMIT_FSIZE using fallocate
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (15 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 016/260] ext4: Remove extraneous newlines in ext4_msg() calls Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 018/260] ext4: check for a good block group before loading buddy pages Paul Gortmaker
` (244 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Nikanth Karthikesan, Amit Arora, Theodore Ts'o,
Paul Gortmaker
From: Nikanth Karthikesan <knikanth@suse.de>
commit 6d19c42b7cf81c39632b6d4dbc514e8449bcd346 upstream.
Currently using posix_fallocate one can bypass an RLIMIT_FSIZE limit
and create a file larger than the limit. Add a check for that.
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Amit Arora <aarora@in.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/extents.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index ee611da..8a8f9f0 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3708,6 +3708,11 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len)
*/
credits = ext4_chunk_trans_blocks(inode, max_blocks);
mutex_lock(&inode->i_mutex);
+ ret = inode_newsize_ok(inode, (len + offset));
+ if (ret) {
+ mutex_unlock(&inode->i_mutex);
+ return ret;
+ }
retry:
while (ret >= 0 && ret < max_blocks) {
block = block + ret;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 018/260] ext4: check for a good block group before loading buddy pages
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (16 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 017/260] ext4: Prevent creation of files larger than RLIMIT_FSIZE using fallocate Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 019/260] ext4: Show journal_checksum option Paul Gortmaker
` (243 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Curt Wohlgemuth, Theodore Ts'o, Paul Gortmaker
From: Curt Wohlgemuth <curtw@google.com>
commit 8a57d9d61a6e361c7bb159dda797672c1df1a691 upstream.
This adds a new field in ext4_group_info to cache the largest available
block range in a block group; and don't load the buddy pages until *after*
we've done a sanity check on the block group.
With large allocation requests (e.g., fallocate(), 8MiB) and relatively full
partitions, it's easy to have no block groups with a block extent large
enough to satisfy the input request length. This currently causes the loop
during cr == 0 in ext4_mb_regular_allocator() to load the buddy bitmap pages
for EVERY block group. That can be a lot of pages. The patch below allows
us to call ext4_mb_good_group() BEFORE we load the buddy pages (although we
have check again after we lock the block group).
Addresses-Google-Bug: #2578108
Addresses-Google-Bug: #2704453
Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/ext4.h | 1 +
fs/ext4/mballoc.c | 70 +++++++++++++++++++++++++++++++++++++++++++----------
2 files changed, 58 insertions(+), 13 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index bf938cf..d266003 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1678,6 +1678,7 @@ struct ext4_group_info {
ext4_grpblk_t bb_first_free; /* first free block */
ext4_grpblk_t bb_free; /* total free blocks */
ext4_grpblk_t bb_fragments; /* nr of freespace fragments */
+ ext4_grpblk_t bb_largest_free_order;/* order of largest frag in BG */
struct list_head bb_prealloc_list;
#ifdef DOUBLE_CHECK
void *bb_bitmap;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 4f2d3a9..aa499fe 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -658,6 +658,27 @@ static void ext4_mb_mark_free_simple(struct super_block *sb,
}
}
+/*
+ * Cache the order of the largest free extent we have available in this block
+ * group.
+ */
+static void
+mb_set_largest_free_order(struct super_block *sb, struct ext4_group_info *grp)
+{
+ int i;
+ int bits;
+
+ grp->bb_largest_free_order = -1; /* uninit */
+
+ bits = sb->s_blocksize_bits + 1;
+ for (i = bits; i >= 0; i--) {
+ if (grp->bb_counters[i] > 0) {
+ grp->bb_largest_free_order = i;
+ break;
+ }
+ }
+}
+
static noinline_for_stack
void ext4_mb_generate_buddy(struct super_block *sb,
void *buddy, void *bitmap, ext4_group_t group)
@@ -700,6 +721,7 @@ void ext4_mb_generate_buddy(struct super_block *sb,
*/
grp->bb_free = free;
}
+ mb_set_largest_free_order(sb, grp);
clear_bit(EXT4_GROUP_INFO_NEED_INIT_BIT, &(grp->bb_state));
@@ -725,6 +747,9 @@ void ext4_mb_generate_buddy(struct super_block *sb,
* contain blocks_per_page (PAGE_CACHE_SIZE / blocksize) blocks.
* So it can have information regarding groups_per_page which
* is blocks_per_page/2
+ *
+ * Locking note: This routine takes the block group lock of all groups
+ * for this page; do not hold this lock when calling this routine!
*/
static int ext4_mb_init_cache(struct page *page, char *incore)
@@ -910,6 +935,11 @@ out:
return err;
}
+/*
+ * Locking note: This routine calls ext4_mb_init_cache(), which takes the
+ * block group lock of all groups for this page; do not hold the BG lock when
+ * calling this routine!
+ */
static noinline_for_stack
int ext4_mb_init_group(struct super_block *sb, ext4_group_t group)
{
@@ -1004,6 +1034,11 @@ err:
return ret;
}
+/*
+ * Locking note: This routine calls ext4_mb_init_cache(), which takes the
+ * block group lock of all groups for this page; do not hold the BG lock when
+ * calling this routine!
+ */
static noinline_for_stack int
ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group,
struct ext4_buddy *e4b)
@@ -1299,6 +1334,7 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
buddy = buddy2;
} while (1);
}
+ mb_set_largest_free_order(sb, e4b->bd_info);
mb_check_buddy(e4b);
}
@@ -1427,6 +1463,7 @@ static int mb_mark_used(struct ext4_buddy *e4b, struct ext4_free_extent *ex)
e4b->bd_info->bb_counters[ord]++;
e4b->bd_info->bb_counters[ord]++;
}
+ mb_set_largest_free_order(e4b->bd_sb, e4b->bd_info);
mb_set_bits(EXT4_MB_BITMAP(e4b), ex->fe_start, len0);
mb_check_buddy(e4b);
@@ -1821,16 +1858,22 @@ void ext4_mb_scan_aligned(struct ext4_allocation_context *ac,
}
}
+/* This is now called BEFORE we load the buddy bitmap. */
static int ext4_mb_good_group(struct ext4_allocation_context *ac,
ext4_group_t group, int cr)
{
unsigned free, fragments;
- unsigned i, bits;
int flex_size = ext4_flex_bg_size(EXT4_SB(ac->ac_sb));
struct ext4_group_info *grp = ext4_get_group_info(ac->ac_sb, group);
BUG_ON(cr < 0 || cr >= 4);
- BUG_ON(EXT4_MB_GRP_NEED_INIT(grp));
+
+ /* We only do this if the grp has never been initialized */
+ if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
+ int ret = ext4_mb_init_group(ac->ac_sb, group);
+ if (ret)
+ return 0;
+ }
free = grp->bb_free;
fragments = grp->bb_fragments;
@@ -1843,17 +1886,16 @@ static int ext4_mb_good_group(struct ext4_allocation_context *ac,
case 0:
BUG_ON(ac->ac_2order == 0);
+ if (grp->bb_largest_free_order < ac->ac_2order)
+ return 0;
+
/* Avoid using the first bg of a flexgroup for data files */
if ((ac->ac_flags & EXT4_MB_HINT_DATA) &&
(flex_size >= EXT4_FLEX_SIZE_DIR_ALLOC_SCHEME) &&
((group % flex_size) == 0))
return 0;
- bits = ac->ac_sb->s_blocksize_bits + 1;
- for (i = ac->ac_2order; i <= bits; i++)
- if (grp->bb_counters[i] > 0)
- return 1;
- break;
+ return 1;
case 1:
if ((free / fragments) >= ac->ac_g_ex.fe_len)
return 1;
@@ -2024,14 +2066,11 @@ repeat:
group = ac->ac_g_ex.fe_group;
for (i = 0; i < ngroups; group++, i++) {
- struct ext4_group_info *grp;
-
if (group == ngroups)
group = 0;
- /* quick check to skip empty groups */
- grp = ext4_get_group_info(sb, group);
- if (grp->bb_free == 0)
+ /* This now checks without needing the buddy page */
+ if (!ext4_mb_good_group(ac, group, cr))
continue;
err = ext4_mb_load_buddy(sb, group, &e4b);
@@ -2039,8 +2078,12 @@ repeat:
goto out;
ext4_lock_group(sb, group);
+
+ /*
+ * We need to check again after locking the
+ * block group
+ */
if (!ext4_mb_good_group(ac, group, cr)) {
- /* someone did allocation from this group */
ext4_unlock_group(sb, group);
ext4_mb_unload_buddy(&e4b);
continue;
@@ -2253,6 +2296,7 @@ int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group,
INIT_LIST_HEAD(&meta_group_info[i]->bb_prealloc_list);
init_rwsem(&meta_group_info[i]->alloc_sem);
meta_group_info[i]->bb_free_root = RB_ROOT;
+ meta_group_info[i]->bb_largest_free_order = -1; /* uninit */
#ifdef DOUBLE_CHECK
{
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 019/260] ext4: Show journal_checksum option
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (17 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 018/260] ext4: check for a good block group before loading buddy pages Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 020/260] ext4: Use bitops to read/modify i_flags in struct ext4_inode_info Paul Gortmaker
` (242 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jan Kara, Theodore Ts'o, Paul Gortmaker
From: Jan Kara <jack@suse.cz>
commit 39a4bade8c1826b658316d66ee81c09b0a4d7d42 upstream.
We failed to show journal_checksum option in /proc/mounts. Fix it.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/super.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f9e57e1..aa947e0 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -942,6 +942,8 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
seq_puts(seq, test_opt(sb, BARRIER) ? "1" : "0");
if (test_opt(sb, JOURNAL_ASYNC_COMMIT))
seq_puts(seq, ",journal_async_commit");
+ else if (test_opt(sb, JOURNAL_CHECKSUM))
+ seq_puts(seq, ",journal_checksum");
if (test_opt(sb, NOBH))
seq_puts(seq, ",nobh");
if (test_opt(sb, I_VERSION))
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 020/260] ext4: Use bitops to read/modify i_flags in struct ext4_inode_info
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (18 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 019/260] ext4: Show journal_checksum option Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 021/260] ext4: Avoid crashing on NULL ptr dereference on a filesystem error Paul Gortmaker
` (241 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Monakhov, Theodore Ts'o, Paul Gortmaker
From: Dmitry Monakhov <dmonakhov@openvz.org>
commit 12e9b892002d9af057655d35b44db8ee9243b0dc upstream.
At several places we modify EXT4_I(inode)->i_flags without holding
i_mutex (ext4_do_update_inode, ...). These modifications are racy and
we can lose updates to i_flags. So convert handling of i_flags to use
bitops which are atomic.
https://bugzilla.kernel.org/show_bug.cgi?id=15792
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/dir.c | 4 +-
fs/ext4/ext4.h | 109 ++++++++++++++++++++++++++++++++++++++++++-------
fs/ext4/ext4_jbd2.h | 8 ++--
fs/ext4/extents.c | 10 ++--
fs/ext4/file.c | 2 +-
fs/ext4/ialloc.c | 4 +-
fs/ext4/inode.c | 30 +++++++-------
fs/ext4/mballoc.c | 4 +-
fs/ext4/migrate.c | 2 +-
fs/ext4/move_extent.c | 4 +-
fs/ext4/namei.c | 10 ++--
fs/ext4/super.c | 1 +
fs/ext4/xattr.c | 4 +-
13 files changed, 136 insertions(+), 56 deletions(-)
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 86cb6d8..e7ce97b 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -111,7 +111,7 @@ static int ext4_readdir(struct file *filp,
if (EXT4_HAS_COMPAT_FEATURE(inode->i_sb,
EXT4_FEATURE_COMPAT_DIR_INDEX) &&
- ((EXT4_I(inode)->i_flags & EXT4_INDEX_FL) ||
+ ((ext4_test_inode_flag(inode, EXT4_INODE_INDEX)) ||
((inode->i_size >> sb->s_blocksize_bits) == 1))) {
err = ext4_dx_readdir(filp, dirent, filldir);
if (err != ERR_BAD_DX_DIR) {
@@ -122,7 +122,7 @@ static int ext4_readdir(struct file *filp,
* We don't set the inode dirty flag since it's not
* critical that it get flushed back to the disk.
*/
- EXT4_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT4_INDEX_FL;
+ ext4_clear_inode_flag(filp->f_path.dentry->d_inode, EXT4_INODE_INDEX);
}
stored = 0;
offset = filp->f_pos & (sb->s_blocksize - 1);
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index d266003..7fe80c5 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -321,6 +321,83 @@ static inline __u32 ext4_mask_flags(umode_t mode, __u32 flags)
return flags & EXT4_OTHER_FLMASK;
}
+/*
+ * Inode flags used for atomic set/get
+ */
+enum {
+ EXT4_INODE_SECRM = 0, /* Secure deletion */
+ EXT4_INODE_UNRM = 1, /* Undelete */
+ EXT4_INODE_COMPR = 2, /* Compress file */
+ EXT4_INODE_SYNC = 3, /* Synchronous updates */
+ EXT4_INODE_IMMUTABLE = 4, /* Immutable file */
+ EXT4_INODE_APPEND = 5, /* writes to file may only append */
+ EXT4_INODE_NODUMP = 6, /* do not dump file */
+ EXT4_INODE_NOATIME = 7, /* do not update atime */
+/* Reserved for compression usage... */
+ EXT4_INODE_DIRTY = 8,
+ EXT4_INODE_COMPRBLK = 9, /* One or more compressed clusters */
+ EXT4_INODE_NOCOMPR = 10, /* Don't compress */
+ EXT4_INODE_ECOMPR = 11, /* Compression error */
+/* End compression flags --- maybe not all used */
+ EXT4_INODE_INDEX = 12, /* hash-indexed directory */
+ EXT4_INODE_IMAGIC = 13, /* AFS directory */
+ EXT4_INODE_JOURNAL_DATA = 14, /* file data should be journaled */
+ EXT4_INODE_NOTAIL = 15, /* file tail should not be merged */
+ EXT4_INODE_DIRSYNC = 16, /* dirsync behaviour (directories only) */
+ EXT4_INODE_TOPDIR = 17, /* Top of directory hierarchies*/
+ EXT4_INODE_HUGE_FILE = 18, /* Set to each huge file */
+ EXT4_INODE_EXTENTS = 19, /* Inode uses extents */
+ EXT4_INODE_EA_INODE = 21, /* Inode used for large EA */
+ EXT4_INODE_EOFBLOCKS = 22, /* Blocks allocated beyond EOF */
+ EXT4_INODE_RESERVED = 31, /* reserved for ext4 lib */
+};
+
+#define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1 << EXT4_INODE_##FLAG))
+#define CHECK_FLAG_VALUE(FLAG) if (!TEST_FLAG_VALUE(FLAG)) { \
+ printk(KERN_EMERG "EXT4 flag fail: " #FLAG ": %d %d\n", \
+ EXT4_##FLAG##_FL, EXT4_INODE_##FLAG); BUG_ON(1); }
+
+/*
+ * Since it's pretty easy to mix up bit numbers and hex values, and we
+ * can't do a compile-time test for ENUM values, we use a run-time
+ * test to make sure that EXT4_XXX_FL is consistent with respect to
+ * EXT4_INODE_XXX. If all is well the printk and BUG_ON will all drop
+ * out so it won't cost any extra space in the compiled kernel image.
+ * But it's important that these values are the same, since we are
+ * using EXT4_INODE_XXX to test for the flag values, but EXT4_XX_FL
+ * must be consistent with the values of FS_XXX_FL defined in
+ * include/linux/fs.h and the on-disk values found in ext2, ext3, and
+ * ext4 filesystems, and of course the values defined in e2fsprogs.
+ *
+ * It's not paranoia if the Murphy's Law really *is* out to get you. :-)
+ */
+static inline void ext4_check_flag_values(void)
+{
+ CHECK_FLAG_VALUE(SECRM);
+ CHECK_FLAG_VALUE(UNRM);
+ CHECK_FLAG_VALUE(COMPR);
+ CHECK_FLAG_VALUE(SYNC);
+ CHECK_FLAG_VALUE(IMMUTABLE);
+ CHECK_FLAG_VALUE(APPEND);
+ CHECK_FLAG_VALUE(NODUMP);
+ CHECK_FLAG_VALUE(NOATIME);
+ CHECK_FLAG_VALUE(DIRTY);
+ CHECK_FLAG_VALUE(COMPRBLK);
+ CHECK_FLAG_VALUE(NOCOMPR);
+ CHECK_FLAG_VALUE(ECOMPR);
+ CHECK_FLAG_VALUE(INDEX);
+ CHECK_FLAG_VALUE(IMAGIC);
+ CHECK_FLAG_VALUE(JOURNAL_DATA);
+ CHECK_FLAG_VALUE(NOTAIL);
+ CHECK_FLAG_VALUE(DIRSYNC);
+ CHECK_FLAG_VALUE(TOPDIR);
+ CHECK_FLAG_VALUE(HUGE_FILE);
+ CHECK_FLAG_VALUE(EXTENTS);
+ CHECK_FLAG_VALUE(EA_INODE);
+ CHECK_FLAG_VALUE(EOFBLOCKS);
+ CHECK_FLAG_VALUE(RESERVED);
+}
+
/* Used to pass group descriptor data when online resize is done */
struct ext4_new_group_input {
__u32 group; /* Group number for this data */
@@ -616,9 +693,8 @@ struct ext4_ext_cache {
*/
struct ext4_inode_info {
__le32 i_data[15]; /* unconverted */
- __u32 i_flags;
- ext4_fsblk_t i_file_acl;
__u32 i_dtime;
+ ext4_fsblk_t i_file_acl;
/*
* i_block_group is the number of the block group which contains
@@ -629,6 +705,7 @@ struct ext4_inode_info {
*/
ext4_group_t i_block_group;
unsigned long i_state_flags; /* Dynamic state flags */
+ unsigned long i_flags;
ext4_lblk_t i_dir_start_lookup;
#ifdef CONFIG_EXT4_FS_XATTR
@@ -1064,20 +1141,22 @@ enum {
EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/
};
-static inline int ext4_test_inode_state(struct inode *inode, int bit)
-{
- return test_bit(bit, &EXT4_I(inode)->i_state_flags);
+#define EXT4_INODE_BIT_FNS(name, field) \
+static inline int ext4_test_inode_##name(struct inode *inode, int bit) \
+{ \
+ return test_bit(bit, &EXT4_I(inode)->i_##field); \
+} \
+static inline void ext4_set_inode_##name(struct inode *inode, int bit) \
+{ \
+ set_bit(bit, &EXT4_I(inode)->i_##field); \
+} \
+static inline void ext4_clear_inode_##name(struct inode *inode, int bit) \
+{ \
+ clear_bit(bit, &EXT4_I(inode)->i_##field); \
}
-static inline void ext4_set_inode_state(struct inode *inode, int bit)
-{
- set_bit(bit, &EXT4_I(inode)->i_state_flags);
-}
-
-static inline void ext4_clear_inode_state(struct inode *inode, int bit)
-{
- clear_bit(bit, &EXT4_I(inode)->i_state_flags);
-}
+EXT4_INODE_BIT_FNS(flag, flags)
+EXT4_INODE_BIT_FNS(state, state_flags)
#else
/* Assume that user mode programs are passing in an ext4fs superblock, not
* a kernel struct super_block. This will allow us to call the feature-test
@@ -1264,7 +1343,7 @@ struct ext4_dir_entry_2 {
#define is_dx(dir) (EXT4_HAS_COMPAT_FEATURE(dir->i_sb, \
EXT4_FEATURE_COMPAT_DIR_INDEX) && \
- (EXT4_I(dir)->i_flags & EXT4_INDEX_FL))
+ ext4_test_inode_flag((dir), EXT4_INODE_INDEX))
#define EXT4_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT4_LINK_MAX)
#define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
index b79ad51..dade0c0 100644
--- a/fs/ext4/ext4_jbd2.h
+++ b/fs/ext4/ext4_jbd2.h
@@ -273,7 +273,7 @@ static inline int ext4_should_journal_data(struct inode *inode)
return 1;
if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
return 1;
- if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL)
+ if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA))
return 1;
return 0;
}
@@ -284,7 +284,7 @@ static inline int ext4_should_order_data(struct inode *inode)
return 0;
if (!S_ISREG(inode->i_mode))
return 0;
- if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL)
+ if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA))
return 0;
if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
return 1;
@@ -297,7 +297,7 @@ static inline int ext4_should_writeback_data(struct inode *inode)
return 0;
if (EXT4_JOURNAL(inode) == NULL)
return 1;
- if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL)
+ if (ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA))
return 0;
if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)
return 1;
@@ -321,7 +321,7 @@ static inline int ext4_should_dioread_nolock(struct inode *inode)
return 0;
if (!S_ISREG(inode->i_mode))
return 0;
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return 0;
if (ext4_should_journal_data(inode))
return 0;
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 8a8f9f0..a1d3f7c 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3509,7 +3509,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
set_buffer_uninit(bh_result);
}
- if (unlikely(EXT4_I(inode)->i_flags & EXT4_EOFBLOCKS_FL)) {
+ if (unlikely(ext4_test_inode_flag(inode, EXT4_INODE_EOFBLOCKS))) {
if (unlikely(!eh->eh_entries)) {
EXT4_ERROR_INODE(inode,
"eh->eh_entries == 0 ee_block %d",
@@ -3520,7 +3520,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
last_ex = EXT_LAST_EXTENT(eh);
if (iblock + ar.len > le32_to_cpu(last_ex->ee_block)
+ ext4_ext_get_actual_len(last_ex))
- EXT4_I(inode)->i_flags &= ~EXT4_EOFBLOCKS_FL;
+ ext4_clear_inode_flag(inode, EXT4_INODE_EOFBLOCKS);
}
err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
if (err) {
@@ -3661,7 +3661,7 @@ static void ext4_falloc_update_inode(struct inode *inode,
* can proceed even if the new size is the same as i_size.
*/
if (new_size > i_size_read(inode))
- EXT4_I(inode)->i_flags |= EXT4_EOFBLOCKS_FL;
+ ext4_set_inode_flag(inode, EXT4_INODE_EOFBLOCKS);
}
}
@@ -3689,7 +3689,7 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len)
* currently supporting (pre)allocate mode for extent-based
* files _only_
*/
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return -EOPNOTSUPP;
/* preallocation to directories is currently not supported */
@@ -3939,7 +3939,7 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
int error = 0;
/* fallback to generic here if not in extents fmt */
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return generic_block_fiemap(inode, fieinfo, start, len,
ext4_get_block);
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index d0776e4..5313ae4 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -66,7 +66,7 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
* is smaller than s_maxbytes, which is for extent-mapped files.
*/
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) {
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
size_t length = iov_length(iov, nr_segs);
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 52618d5..7f6b582 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -492,7 +492,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent,
if (S_ISDIR(mode) &&
((parent == sb->s_root->d_inode) ||
- (EXT4_I(parent)->i_flags & EXT4_TOPDIR_FL))) {
+ (ext4_test_inode_flag(parent, EXT4_INODE_TOPDIR)))) {
int best_ndir = inodes_per_group;
int ret = -1;
@@ -1038,7 +1038,7 @@ got:
if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
/* set extent flag only for directory, file and normal symlink*/
if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) {
- EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL;
+ ext4_set_inode_flag(inode, EXT4_INODE_EXTENTS);
ext4_ext_tree_init(handle, inode);
}
}
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 3c479ef..3fd683f 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -933,7 +933,7 @@ static int ext4_ind_get_blocks(handle_t *handle, struct inode *inode,
int count = 0;
ext4_fsblk_t first_block = 0;
- J_ASSERT(!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL));
+ J_ASSERT(!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)));
J_ASSERT(handle != NULL || (flags & EXT4_GET_BLOCKS_CREATE) == 0);
depth = ext4_block_to_path(inode, iblock, offsets,
&blocks_to_boundary);
@@ -1061,7 +1061,7 @@ static int ext4_indirect_calc_metadata_amount(struct inode *inode,
*/
static int ext4_calc_metadata_amount(struct inode *inode, sector_t lblock)
{
- if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)
+ if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
return ext4_ext_calc_metadata_amount(inode, lblock);
return ext4_indirect_calc_metadata_amount(inode, lblock);
@@ -1251,7 +1251,7 @@ int ext4_get_blocks(handle_t *handle, struct inode *inode, sector_t block,
* file system block.
*/
down_read((&EXT4_I(inode)->i_data_sem));
- if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) {
+ if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
retval = ext4_ext_get_blocks(handle, inode, block, max_blocks,
bh, 0);
} else {
@@ -1313,7 +1313,7 @@ int ext4_get_blocks(handle_t *handle, struct inode *inode, sector_t block,
* We need to check for EXT4 here because migrate
* could have changed the inode type in between
*/
- if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) {
+ if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
retval = ext4_ext_get_blocks(handle, inode, block, max_blocks,
bh, flags);
} else {
@@ -2360,7 +2360,7 @@ static void mpage_add_bh_to_extent(struct mpage_da_data *mpd,
goto flush_it;
/* check if thereserved journal credits might overflow */
- if (!(EXT4_I(mpd->inode)->i_flags & EXT4_EXTENTS_FL)) {
+ if (!(ext4_test_inode_flag(mpd->inode, EXT4_INODE_EXTENTS))) {
if (nrblocks >= EXT4_MAX_TRANS_DATA) {
/*
* With non-extent format we are limited by the journal
@@ -2831,7 +2831,7 @@ static int ext4_da_writepages_trans_blocks(struct inode *inode)
* number of contiguous block. So we will limit
* number of contiguous block to a sane value
*/
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) &&
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) &&
(max_blocks > EXT4_MAX_TRANS_DATA))
max_blocks = EXT4_MAX_TRANS_DATA;
@@ -3983,7 +3983,7 @@ static ssize_t ext4_direct_IO(int rw, struct kiocb *iocb,
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
- if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)
+ if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
return ext4_ext_direct_IO(rw, iocb, iov, offset, nr_segs);
return ext4_ind_direct_IO(rw, iocb, iov, offset, nr_segs);
@@ -4622,12 +4622,12 @@ void ext4_truncate(struct inode *inode)
if (!ext4_can_truncate(inode))
return;
- EXT4_I(inode)->i_flags &= ~EXT4_EOFBLOCKS_FL;
+ ext4_clear_inode_flag(inode, EXT4_INODE_EOFBLOCKS);
if (inode->i_size == 0 && !test_opt(inode->i_sb, NO_AUTO_DA_ALLOC))
ext4_set_inode_state(inode, EXT4_STATE_DA_ALLOC_CLOSE);
- if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) {
+ if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
ext4_ext_truncate(inode);
return;
}
@@ -5465,7 +5465,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
}
if (attr->ia_valid & ATTR_SIZE) {
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) {
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
if (attr->ia_size > sbi->s_bitmap_maxbytes) {
@@ -5478,7 +5478,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
if (S_ISREG(inode->i_mode) &&
attr->ia_valid & ATTR_SIZE &&
(attr->ia_size < inode->i_size ||
- (EXT4_I(inode)->i_flags & EXT4_EOFBLOCKS_FL))) {
+ (ext4_test_inode_flag(inode, EXT4_INODE_EOFBLOCKS)))) {
handle_t *handle;
handle = ext4_journal_start(inode, 3);
@@ -5510,7 +5510,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
}
}
/* ext4_truncate will clear the flag */
- if ((EXT4_I(inode)->i_flags & EXT4_EOFBLOCKS_FL))
+ if ((ext4_test_inode_flag(inode, EXT4_INODE_EOFBLOCKS)))
ext4_truncate(inode);
}
@@ -5586,7 +5586,7 @@ static int ext4_indirect_trans_blocks(struct inode *inode, int nrblocks,
static int ext4_index_trans_blocks(struct inode *inode, int nrblocks, int chunk)
{
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return ext4_indirect_trans_blocks(inode, nrblocks, chunk);
return ext4_ext_index_trans_blocks(inode, nrblocks, chunk);
}
@@ -5921,9 +5921,9 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val)
*/
if (val)
- EXT4_I(inode)->i_flags |= EXT4_JOURNAL_DATA_FL;
+ ext4_set_inode_flag(inode, EXT4_INODE_JOURNAL_DATA);
else
- EXT4_I(inode)->i_flags &= ~EXT4_JOURNAL_DATA_FL;
+ ext4_clear_inode_flag(inode, EXT4_INODE_JOURNAL_DATA);
ext4_set_aops(inode);
jbd2_journal_unlock_updates(journal);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index aa499fe..917fe78 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2006,7 +2006,7 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
sbi = EXT4_SB(sb);
ngroups = ext4_get_groups_count(sb);
/* non-extent files are limited to low blocks/groups */
- if (!(EXT4_I(ac->ac_inode)->i_flags & EXT4_EXTENTS_FL))
+ if (!(ext4_test_inode_flag(ac->ac_inode, EXT4_INODE_EXTENTS)))
ngroups = sbi->s_blockfile_groups;
BUG_ON(ac->ac_status == AC_STATUS_FOUND);
@@ -3171,7 +3171,7 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac)
continue;
/* non-extent files can't have physical blocks past 2^32 */
- if (!(EXT4_I(ac->ac_inode)->i_flags & EXT4_EXTENTS_FL) &&
+ if (!(ext4_test_inode_flag(ac->ac_inode, EXT4_INODE_EXTENTS)) &&
pa->pa_pstart + pa->pa_len > EXT4_MAX_BLOCK_FILE_PHYS)
continue;
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 34dcfc5..6f3a27e 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -475,7 +475,7 @@ int ext4_ext_migrate(struct inode *inode)
*/
if (!EXT4_HAS_INCOMPAT_FEATURE(inode->i_sb,
EXT4_FEATURE_INCOMPAT_EXTENTS) ||
- (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
+ (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
return -EINVAL;
if (S_ISLNK(inode->i_mode) && inode->i_blocks == 0)
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index d3d6a64..deff4a5 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -979,11 +979,11 @@ mext_check_arguments(struct inode *orig_inode,
}
/* Ext4 move extent supports only extent based file */
- if (!(EXT4_I(orig_inode)->i_flags & EXT4_EXTENTS_FL)) {
+ if (!(ext4_test_inode_flag(orig_inode, EXT4_INODE_EXTENTS))) {
ext4_debug("ext4 move extent: orig file is not extents "
"based file [ino:orig %lu]\n", orig_inode->i_ino);
return -EOPNOTSUPP;
- } else if (!(EXT4_I(donor_inode)->i_flags & EXT4_EXTENTS_FL)) {
+ } else if (!(ext4_test_inode_flag(donor_inode, EXT4_INODE_EXTENTS))) {
ext4_debug("ext4 move extent: donor file is not extents "
"based file [ino:donor %lu]\n", donor_inode->i_ino);
return -EOPNOTSUPP;
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 0c070fa..efab592 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -656,7 +656,7 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
dxtrace(printk(KERN_DEBUG "In htree_fill_tree, start hash: %x:%x\n",
start_hash, start_minor_hash));
dir = dir_file->f_path.dentry->d_inode;
- if (!(EXT4_I(dir)->i_flags & EXT4_INDEX_FL)) {
+ if (!(ext4_test_inode_flag(dir, EXT4_INODE_INDEX))) {
hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version;
if (hinfo.hash_version <= DX_HASH_TEA)
hinfo.hash_version +=
@@ -801,7 +801,7 @@ static void ext4_update_dx_flag(struct inode *inode)
{
if (!EXT4_HAS_COMPAT_FEATURE(inode->i_sb,
EXT4_FEATURE_COMPAT_DIR_INDEX))
- EXT4_I(inode)->i_flags &= ~EXT4_INDEX_FL;
+ ext4_clear_inode_flag(inode, EXT4_INODE_INDEX);
}
/*
@@ -1418,7 +1418,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
brelse(bh);
return retval;
}
- EXT4_I(dir)->i_flags |= EXT4_INDEX_FL;
+ ext4_set_inode_flag(dir, EXT4_INODE_INDEX);
data1 = bh2->b_data;
memcpy (data1, de, len);
@@ -1491,7 +1491,7 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
retval = ext4_dx_add_entry(handle, dentry, inode);
if (!retval || (retval != ERR_BAD_DX_DIR))
return retval;
- EXT4_I(dir)->i_flags &= ~EXT4_INDEX_FL;
+ ext4_clear_inode_flag(dir, EXT4_INODE_INDEX);
dx_fallback++;
ext4_mark_inode_dirty(handle, dir);
}
@@ -2297,7 +2297,7 @@ retry:
}
} else {
/* clear the extent format for fast symlink */
- EXT4_I(inode)->i_flags &= ~EXT4_EXTENTS_FL;
+ ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS);
inode->i_op = &ext4_fast_symlink_inode_operations;
memcpy((char *)&EXT4_I(inode)->i_data, symname, l);
inode->i_size = l-1;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index aa947e0..2aa9314 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4139,6 +4139,7 @@ static int __init init_ext4_fs(void)
{
int err;
+ ext4_check_flag_values();
err = init_ext4_system_zone();
if (err)
return err;
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index b4c5aa8..58f8bb6 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -820,7 +820,7 @@ inserted:
EXT4_I(inode)->i_block_group);
/* non-extent files can't have physical blocks past 2^32 */
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
goal = goal & EXT4_MAX_BLOCK_FILE_PHYS;
block = ext4_new_meta_blocks(handle, inode,
@@ -828,7 +828,7 @@ inserted:
if (error)
goto cleanup;
- if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
BUG_ON(block > EXT4_MAX_BLOCK_FILE_PHYS);
ea_idebug(inode, "creating block %d", block);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 021/260] ext4: Avoid crashing on NULL ptr dereference on a filesystem error
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (19 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 020/260] ext4: Use bitops to read/modify i_flags in struct ext4_inode_info Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 022/260] ext4: Clear the EXT4_EOFBLOCKS_FL flag only when warranted Paul Gortmaker
` (240 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Theodore Ts'o, Paul Gortmaker
From: Theodore Ts'o <tytso@mit.edu>
commit f70f362b4a6fe47c239dbfb3efc0cc2c10e4f09c upstream.
If the EOFBLOCK_FL flag is set when it should not be and the inode is
zero length, then eh_entries is zero, and ex is NULL, so dereferencing
ex to print ex->ee_block causes a kernel OOPS in
ext4_ext_map_blocks().
On top of that, the error message which is printed isn't very helpful.
So we fix this by printing something more explanatory which doesn't
involve trying to print ex->ee_block.
Addresses-Google-Bug: #2655740
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/extents.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index a1d3f7c..8e8a7a4 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3381,8 +3381,9 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
*/
if (unlikely(path[depth].p_ext == NULL && depth != 0)) {
EXT4_ERROR_INODE(inode, "bad extent address "
- "iblock: %d, depth: %d pblock %lld",
- iblock, depth, path[depth].p_block);
+ "iblock: %lu, depth: %d pblock %lld",
+ (unsigned long) iblock, depth,
+ path[depth].p_block);
err = -EIO;
goto out2;
}
@@ -3512,8 +3513,8 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
if (unlikely(ext4_test_inode_flag(inode, EXT4_INODE_EOFBLOCKS))) {
if (unlikely(!eh->eh_entries)) {
EXT4_ERROR_INODE(inode,
- "eh->eh_entries == 0 ee_block %d",
- ex->ee_block);
+ "eh->eh_entries == 0 and "
+ "EOFBLOCKS_FL set");
err = -EIO;
goto out2;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 022/260] ext4: Clear the EXT4_EOFBLOCKS_FL flag only when warranted
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (20 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 021/260] ext4: Avoid crashing on NULL ptr dereference on a filesystem error Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 023/260] ext4: restart ext4_ext_remove_space() after transaction restart Paul Gortmaker
` (239 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Theodore Ts'o, Paul Gortmaker
From: Theodore Ts'o <tytso@mit.edu>
commit 786ec7915e530936b9eb2e3d12274145cab7aa7d upstream.
Dimitry Monakhov discovered an edge case where it was possible for the
EXT4_EOFBLOCKS_FL flag could get cleared unnecessarily. This is true;
I have a test case that can be exercised via downloading and
decompressing the file:
wget ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/ext4-testcases/eofblocks-fl-test-case.img.bz2
bunzip2 eofblocks-fl-test-case.img
dd if=/dev/zero of=eofblocks-fl-test-case.img bs=1k seek=17925 bs=1k count=1 conv=notrunc
However, triggering it in real life is highly unlikely since it
requires an extremely fragmented sparse file with a hole in exactly
the right place in the extent tree. (It actually took quite a bit of
work to generate this test case.) Still, it's nice to get even
extreme corner cases to be correct, so this patch makes sure that we
don't clear the EXT4_EOFBLOCKS_FL incorrectly even in this corner
case.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/extents.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 8e8a7a4..5e663a7 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3329,7 +3329,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
struct ext4_extent_header *eh;
struct ext4_extent newex, *ex, *last_ex;
ext4_fsblk_t newblock;
- int err = 0, depth, ret, cache_type;
+ int i, err = 0, depth, ret, cache_type;
unsigned int allocated = 0;
struct ext4_allocation_request ar;
ext4_io_end_t *io = EXT4_I(inode)->cur_aio_dio;
@@ -3519,8 +3519,20 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
goto out2;
}
last_ex = EXT_LAST_EXTENT(eh);
- if (iblock + ar.len > le32_to_cpu(last_ex->ee_block)
- + ext4_ext_get_actual_len(last_ex))
+ /*
+ * If the current leaf block was reached by looking at
+ * the last index block all the way down the tree, and
+ * we are extending the inode beyond the last extent
+ * in the current leaf block, then clear the
+ * EOFBLOCKS_FL flag.
+ */
+ for (i = depth-1; i >= 0; i--) {
+ if (path[i].p_idx != EXT_LAST_INDEX(path[i].p_hdr))
+ break;
+ }
+ if ((i < 0) &&
+ (iblock + ar.len > le32_to_cpu(last_ex->ee_block) +
+ ext4_ext_get_actual_len(last_ex)))
ext4_clear_inode_flag(inode, EXT4_INODE_EOFBLOCKS);
}
err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 023/260] ext4: restart ext4_ext_remove_space() after transaction restart
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (21 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 022/260] ext4: Clear the EXT4_EOFBLOCKS_FL flag only when warranted Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 024/260] ext4: Conditionally define compat ioctl numbers Paul Gortmaker
` (238 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Monakhov, Theodore Ts'o, Paul Gortmaker
From: Dmitry Monakhov <dmonakhov@openvz.org>
commit 0617b83fa239db9743a18ce6cc0e556f4d0fd567 upstream.
If i_data_sem was internally dropped due to transaction restart, it is
necessary to restart path look-up because extents tree was possibly
modified by ext4_get_block().
https://bugzilla.kernel.org/show_bug.cgi?id=15827
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/extents.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 5e663a7..bb03109 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -107,11 +107,8 @@ static int ext4_ext_truncate_extend_restart(handle_t *handle,
if (err <= 0)
return err;
err = ext4_truncate_restart_trans(handle, inode, needed);
- /*
- * We have dropped i_data_sem so someone might have cached again
- * an extent we are going to truncate.
- */
- ext4_ext_invalidate_cache(inode);
+ if (err == 0)
+ err = -EAGAIN;
return err;
}
@@ -2361,7 +2358,7 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start)
int depth = ext_depth(inode);
struct ext4_ext_path *path;
handle_t *handle;
- int i = 0, err = 0;
+ int i, err;
ext_debug("truncate since %u\n", start);
@@ -2370,23 +2367,26 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start)
if (IS_ERR(handle))
return PTR_ERR(handle);
+again:
ext4_ext_invalidate_cache(inode);
/*
* We start scanning from right side, freeing all the blocks
* after i_size and walking into the tree depth-wise.
*/
+ depth = ext_depth(inode);
path = kzalloc(sizeof(struct ext4_ext_path) * (depth + 1), GFP_NOFS);
if (path == NULL) {
ext4_journal_stop(handle);
return -ENOMEM;
}
+ path[0].p_depth = depth;
path[0].p_hdr = ext_inode_hdr(inode);
if (ext4_ext_check(inode, path[0].p_hdr, depth)) {
err = -EIO;
goto out;
}
- path[0].p_depth = depth;
+ i = err = 0;
while (i >= 0 && err == 0) {
if (i == depth) {
@@ -2480,6 +2480,8 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start)
out:
ext4_ext_drop_refs(path);
kfree(path);
+ if (err == -EAGAIN)
+ goto again;
ext4_journal_stop(handle);
return err;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 024/260] ext4: Conditionally define compat ioctl numbers
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (22 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 023/260] ext4: restart ext4_ext_remove_space() after transaction restart Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 025/260] ext4: Fix compat EXT4_IOC_ADD_GROUP Paul Gortmaker
` (237 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ben Hutchings, Theodore Ts'o, Paul Gortmaker
From: Ben Hutchings <ben@decadent.org.uk>
commit 899ad0cea6ad7ff4ba24b16318edbc3cbbe03fad upstream.
It is unnecessary, and in general impossible, to define the compat
ioctl numbers except when building the filesystem with CONFIG_COMPAT
defined.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/ext4.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 7fe80c5..0419018 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -475,6 +475,7 @@ struct ext4_new_group_data {
#define EXT4_IOC_ALLOC_DA_BLKS _IO('f', 12)
#define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent)
+#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
/*
* ioctl commands in 32 bit emulation
*/
@@ -490,6 +491,7 @@ struct ext4_new_group_data {
#endif
#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
#define EXT4_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
+#endif
/*
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 025/260] ext4: Fix compat EXT4_IOC_ADD_GROUP
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (23 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 024/260] ext4: Conditionally define compat ioctl numbers Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 026/260] ext4: Make fsync sync new parent directories in no-journal mode Paul Gortmaker
` (236 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ben Hutchings, Theodore Ts'o, Paul Gortmaker
From: Ben Hutchings <ben@decadent.org.uk>
commit 4d92dc0f00a775dc2e1267b0e00befb783902fe7 upstream.
struct ext4_new_group_input needs to be converted because u64 has
only 32-bit alignment on some 32-bit architectures, notably i386.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/ext4.h | 16 ++++++++++++++++
fs/ext4/ioctl.c | 25 +++++++++++++++++++++++--
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 0419018..2e31640 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -29,6 +29,9 @@
#include <linux/wait.h>
#include <linux/blockgroup_lock.h>
#include <linux/percpu_counter.h>
+#ifdef __KERNEL__
+#include <linux/compat.h>
+#endif
/*
* The fourth extended filesystem constants/structures
@@ -409,6 +412,18 @@ struct ext4_new_group_input {
__u16 unused;
};
+#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
+struct compat_ext4_new_group_input {
+ u32 group;
+ compat_u64 block_bitmap;
+ compat_u64 inode_bitmap;
+ compat_u64 inode_table;
+ u32 blocks_count;
+ u16 reserved_blocks;
+ u16 unused;
+};
+#endif
+
/* The struct ext4_new_group_input in kernel space, with free_blocks_count */
struct ext4_new_group_data {
__u32 group;
@@ -486,6 +501,7 @@ struct ext4_new_group_data {
#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
+#define EXT4_IOC32_GROUP_ADD _IOW('f', 8, struct compat_ext4_new_group_input)
#ifdef CONFIG_JBD2_DEBUG
#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
#endif
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 66fa0b0..6ddec84 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -373,8 +373,29 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case EXT4_IOC32_SETRSVSZ:
cmd = EXT4_IOC_SETRSVSZ;
break;
- case EXT4_IOC_GROUP_ADD:
- break;
+ case EXT4_IOC32_GROUP_ADD: {
+ struct compat_ext4_new_group_input __user *uinput;
+ struct ext4_new_group_input input;
+ mm_segment_t old_fs;
+ int err;
+
+ uinput = compat_ptr(arg);
+ err = get_user(input.group, &uinput->group);
+ err |= get_user(input.block_bitmap, &uinput->block_bitmap);
+ err |= get_user(input.inode_bitmap, &uinput->inode_bitmap);
+ err |= get_user(input.inode_table, &uinput->inode_table);
+ err |= get_user(input.blocks_count, &uinput->blocks_count);
+ err |= get_user(input.reserved_blocks,
+ &uinput->reserved_blocks);
+ if (err)
+ return -EFAULT;
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ err = ext4_ioctl(file, EXT4_IOC_GROUP_ADD,
+ (unsigned long) &input);
+ set_fs(old_fs);
+ return err;
+ }
case EXT4_IOC_MOVE_EXT:
break;
default:
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 026/260] ext4: Make fsync sync new parent directories in no-journal mode
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (24 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 025/260] ext4: Fix compat EXT4_IOC_ADD_GROUP Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 027/260] CIFS: Remove __exit mark from cifs_exit_dns_resolver() Paul Gortmaker
` (235 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Frank Mayhar, Theodore Ts'o, Paul Gortmaker
From: Frank Mayhar <fmayhar@google.com>
commit 14ece1028b3ed53ffec1b1213ffc6acaf79ad77c upstream.
Add a new ext4 state to tell us when a file has been newly created; use
that state in ext4_sync_file in no-journal mode to tell us when we need
to sync the parent directory as well as the inode and data itself. This
fixes a problem in which a panic or power failure may lose the entire
file even when using fsync, since the parent directory entry is lost.
Addresses-Google-Bug: #2480057
Signed-off-by: Frank Mayhar <fmayhar@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/ext4.h | 1 +
fs/ext4/fsync.c | 31 +++++++++++++++++++++++++++++--
fs/ext4/namei.c | 2 ++
3 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 2e31640..650ef37 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1157,6 +1157,7 @@ enum {
EXT4_STATE_DA_ALLOC_CLOSE, /* Alloc DA blks on close */
EXT4_STATE_EXT_MIGRATE, /* Inode is migrating */
EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/
+ EXT4_STATE_NEWENTRY, /* File just added to dir */
};
#define EXT4_INODE_BIT_FNS(name, field) \
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 42bd94a..6f25f9f 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -35,6 +35,29 @@
#include <trace/events/ext4.h>
/*
+ * If we're not journaling and this is a just-created file, we have to
+ * sync our parent directory (if it was freshly created) since
+ * otherwise it will only be written by writeback, leaving a huge
+ * window during which a crash may lose the file. This may apply for
+ * the parent directory's parent as well, and so on recursively, if
+ * they are also freshly created.
+ */
+static void ext4_sync_parent(struct inode *inode)
+{
+ struct dentry *dentry = NULL;
+
+ while (inode && ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) {
+ ext4_clear_inode_state(inode, EXT4_STATE_NEWENTRY);
+ dentry = list_entry(inode->i_dentry.next,
+ struct dentry, d_alias);
+ if (!dentry || !dentry->d_parent || !dentry->d_parent->d_inode)
+ break;
+ inode = dentry->d_parent->d_inode;
+ sync_mapping_buffers(inode->i_mapping);
+ }
+}
+
+/*
* akpm: A new design for ext4_sync_file().
*
* This is only called from sys_fsync(), sys_fdatasync() and sys_msync().
@@ -67,8 +90,12 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
if (ret < 0)
return ret;
- if (!journal)
- return simple_fsync(file, dentry, datasync);
+ if (!journal) {
+ ret = simple_fsync(file, dentry, datasync);
+ if (!ret && !list_empty(&inode->i_dentry))
+ ext4_sync_parent(inode);
+ return ret;
+ }
/*
* data=writeback,ordered:
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index efab592..2f31631 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1519,6 +1519,8 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
de->rec_len = ext4_rec_len_to_disk(blocksize, blocksize);
retval = add_dirent_to_buf(handle, dentry, inode, de, bh);
brelse(bh);
+ if (retval == 0)
+ ext4_set_inode_state(inode, EXT4_STATE_NEWENTRY);
return retval;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 027/260] CIFS: Remove __exit mark from cifs_exit_dns_resolver()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (25 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 026/260] ext4: Make fsync sync new parent directories in no-journal mode Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 028/260] ext4: fix freeze deadlock under IO Paul Gortmaker
` (234 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, David Howells, Linus Torvalds, Paul Gortmaker
From: David Howells <dhowells@redhat.com>
commit 51c20fcced5badee0e2021c6c89f44aa3cbd72aa upstream.
Remove the __exit mark from cifs_exit_dns_resolver() as it's called by the
module init routine in case of error, and so may have been discarded during
linkage.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/cifs/dns_resolve.c | 2 +-
fs/cifs/dns_resolve.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c
index 4a4bbde..56316ae 100644
--- a/fs/cifs/dns_resolve.c
+++ b/fs/cifs/dns_resolve.c
@@ -227,7 +227,7 @@ failed_put_cred:
return ret;
}
-void __exit cifs_exit_dns_resolver(void)
+void cifs_exit_dns_resolver(void)
{
key_revoke(dns_resolver_cache->thread_keyring);
unregister_key_type(&key_type_dns_resolver);
diff --git a/fs/cifs/dns_resolve.h b/fs/cifs/dns_resolve.h
index 26b9eaa..5d7f291 100644
--- a/fs/cifs/dns_resolve.h
+++ b/fs/cifs/dns_resolve.h
@@ -25,7 +25,7 @@
#ifdef __KERNEL__
extern int __init cifs_init_dns_resolver(void);
-extern void __exit cifs_exit_dns_resolver(void);
+extern void cifs_exit_dns_resolver(void);
extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr);
#endif /* KERNEL */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 028/260] ext4: fix freeze deadlock under IO
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (26 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 027/260] CIFS: Remove __exit mark from cifs_exit_dns_resolver() Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 029/260] hwmon: (k8temp) Differentiate between AM2 and ASB1 Paul Gortmaker
` (233 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Sandeen, Eric Sandeen, Theodore Ts'o,
Paul Gortmaker
From: Eric Sandeen <sandeen@sandeen.net>
commit 437f88cc031ffe7f37f3e705367f4fe1f4be8b0f upstream.
[The 6b0310fb below references the mainline version of what
has also been cherry picked into this 34-stable branch]
Commit 6b0310fbf087ad6 caused a regression resulting in deadlocks
when freezing a filesystem which had active IO; the vfs_check_frozen
level (SB_FREEZE_WRITE) did not let the freeze-related IO syncing
through. Duh.
Changing the test to FREEZE_TRANS should let the normal freeze
syncing get through the fs, but still block any transactions from
starting once the fs is completely frozen.
I tested this by running fsstress in the background while periodically
snapshotting the fs and running fsck on the result. I ran into
occasional deadlocks, but different ones. I think this is a
fine fix for the problem at hand, and the other deadlocky things
will need more investigation.
Reported-by: Phillip Susi <psusi@cfl.rr.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/super.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2aa9314..cd35e34 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -241,7 +241,7 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
if (sb->s_flags & MS_RDONLY)
return ERR_PTR(-EROFS);
- vfs_check_frozen(sb, SB_FREEZE_WRITE);
+ vfs_check_frozen(sb, SB_FREEZE_TRANS);
/* Special case here: if the journal has aborted behind our
* backs (eg. EIO in the commit thread), then we still need to
* take the FS itself readonly cleanly. */
@@ -3485,7 +3485,7 @@ int ext4_force_commit(struct super_block *sb)
journal = EXT4_SB(sb)->s_journal;
if (journal) {
- vfs_check_frozen(sb, SB_FREEZE_WRITE);
+ vfs_check_frozen(sb, SB_FREEZE_TRANS);
ret = ext4_journal_force_commit(journal);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 029/260] hwmon: (k8temp) Differentiate between AM2 and ASB1
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (27 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 028/260] ext4: fix freeze deadlock under IO Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 030/260] xen: handle events as edge-triggered Paul Gortmaker
` (232 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Andreas Herrmann, Rudolf Marek, Jean Delvare,
Paul Gortmaker
From: Andreas Herrmann <andreas.herrmann3@amd.com>
commit a05e93f3b3fc2f53c1d0de3b17019e207c482349 upstream.
Commit 8bf0223ed515be24de0c671eedaff49e78bebc9c (hwmon, k8temp: Fix
temperature reporting for ASB1 processor revisions) fixed temperature
reporting for ASB1 CPUs. But those CPU models (model 0x6b, 0x6f, 0x7f)
were packaged both as AM2 (desktop) and ASB1 (mobile). Thus the commit
leads to wrong temperature reporting for AM2 CPU parts.
The solution is to determine the package type for models 0x6b, 0x6f,
0x7f.
This is done using BrandId from CPUID Fn8000_0001_EBX[15:0]. See
"Constructing the processor Name String" in "Revision Guide for AMD
NPT Family 0Fh Processors" (Rev. 3.46).
Cc: Rudolf Marek <r.marek@assembler.cz>
Reported-by: Vladislav Guberinic <neosisani@gmail.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/hwmon/k8temp.c | 35 ++++++++++++++++++++++++++++++++---
1 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
index 8bdf80d..8364932 100644
--- a/drivers/hwmon/k8temp.c
+++ b/drivers/hwmon/k8temp.c
@@ -143,6 +143,37 @@ static const struct pci_device_id k8temp_ids[] = {
MODULE_DEVICE_TABLE(pci, k8temp_ids);
+static int __devinit is_rev_g_desktop(u8 model)
+{
+ u32 brandidx;
+
+ if (model < 0x69)
+ return 0;
+
+ if (model == 0xc1 || model == 0x6c || model == 0x7c)
+ return 0;
+
+ /*
+ * Differentiate between AM2 and ASB1.
+ * See "Constructing the processor Name String" in "Revision
+ * Guide for AMD NPT Family 0Fh Processors" (33610).
+ */
+ brandidx = cpuid_ebx(0x80000001);
+ brandidx = (brandidx >> 9) & 0x1f;
+
+ /* Single core */
+ if ((model == 0x6f || model == 0x7f) &&
+ (brandidx == 0x7 || brandidx == 0x9 || brandidx == 0xc))
+ return 0;
+
+ /* Dual core */
+ if (model == 0x6b &&
+ (brandidx == 0xb || brandidx == 0xc))
+ return 0;
+
+ return 1;
+}
+
static int __devinit k8temp_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
@@ -179,9 +210,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
"wrong - check erratum #141\n");
}
- if ((model >= 0x69) &&
- !(model == 0xc1 || model == 0x6c || model == 0x7c ||
- model == 0x6b || model == 0x6f || model == 0x7f)) {
+ if (is_rev_g_desktop(model)) {
/*
* RevG desktop CPUs (i.e. no socket S1G1 or
* ASB1 parts) need additional offset,
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 030/260] xen: handle events as edge-triggered
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (28 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 029/260] hwmon: (k8temp) Differentiate between AM2 and ASB1 Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 031/260] xen: use percpu interrupts for IPIs and VIRQs Paul Gortmaker
` (231 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jeremy Fitzhardinge, Tom Kopec, Daniel Stodden,
Paul Gortmaker
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
commit dffe2e1e1a1ddb566a76266136c312801c66dcf7 upstream.
Xen events are logically edge triggered, as Xen only calls the event
upcall when an event is newly set, but not continuously as it remains set.
As a result, use handle_edge_irq rather than handle_level_irq.
This has the important side-effect of fixing a long-standing bug of
events getting lost if:
- an event's interrupt handler is running
- the event is migrated to a different vcpu
- the event is re-triggered
The most noticable symptom of these lost events is occasional lockups
of blkfront.
Many thanks to Tom Kopec and Daniel Stodden in tracking this down.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Tom Kopec <tek@acm.org>
Cc: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/xen/events.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 28f133a..cc72dad 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -363,7 +363,7 @@ int bind_evtchn_to_irq(unsigned int evtchn)
irq = find_unbound_irq();
set_irq_chip_and_handler_name(irq, &xen_dynamic_chip,
- handle_level_irq, "event");
+ handle_edge_irq, "event");
evtchn_to_irq[evtchn] = irq;
irq_info[irq] = mk_evtchn_info(evtchn);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 031/260] xen: use percpu interrupts for IPIs and VIRQs
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (29 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 030/260] xen: handle events as edge-triggered Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 032/260] ALSA: hda - Rename iMic to Int Mic on Lenovo NB0763 Paul Gortmaker
` (230 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Jeremy Fitzhardinge, Paul Gortmaker
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
commit aaca49642b92c8a57d3ca5029a5a94019c7af69f upstream.
IPIs and VIRQs are inherently per-cpu event types, so treat them as such:
- use a specific percpu irq_chip implementation, and
- handle them with handle_percpu_irq
This makes the path for delivering these interrupts more efficient
(no masking/unmasking, no locks), and it avoid problems with attempts
to migrate them.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/xen/events.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index cc72dad..6830a4d 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -107,6 +107,7 @@ static inline unsigned long *cpu_evtchn_mask(int cpu)
#define VALID_EVTCHN(chn) ((chn) != 0)
static struct irq_chip xen_dynamic_chip;
+static struct irq_chip xen_percpu_chip;
/* Constructor for packed IRQ information. */
static struct irq_info mk_unbound_info(void)
@@ -389,8 +390,8 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
if (irq < 0)
goto out;
- set_irq_chip_and_handler_name(irq, &xen_dynamic_chip,
- handle_level_irq, "ipi");
+ set_irq_chip_and_handler_name(irq, &xen_percpu_chip,
+ handle_percpu_irq, "ipi");
bind_ipi.vcpu = cpu;
if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
@@ -430,8 +431,8 @@ static int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
irq = find_unbound_irq();
- set_irq_chip_and_handler_name(irq, &xen_dynamic_chip,
- handle_level_irq, "virq");
+ set_irq_chip_and_handler_name(irq, &xen_percpu_chip,
+ handle_percpu_irq, "virq");
evtchn_to_irq[evtchn] = irq;
irq_info[irq] = mk_virq_info(evtchn, virq);
@@ -934,6 +935,16 @@ static struct irq_chip xen_dynamic_chip __read_mostly = {
.retrigger = retrigger_dynirq,
};
+static struct irq_chip xen_percpu_chip __read_mostly = {
+ .name = "xen-percpu",
+
+ .disable = disable_dynirq,
+ .mask = disable_dynirq,
+ .unmask = enable_dynirq,
+
+ .ack = ack_dynirq,
+};
+
void __init xen_init_IRQ(void)
{
int i;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 032/260] ALSA: hda - Rename iMic to Int Mic on Lenovo NB0763
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (30 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 031/260] xen: use percpu interrupts for IPIs and VIRQs Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 033/260] sata_mv: fix broken DSM/TRIM support (v2) Paul Gortmaker
` (229 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, David Henningsson, Takashi Iwai, Paul Gortmaker
From: David Henningsson <david.henningsson@canonical.com>
commit 150b432f448281d5518f5229d240923f9a9c5459 upstream.
The non-standard name "iMic" makes PulseAudio ignore the microphone.
BugLink: https://launchpad.net/bugs/605101
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/pci/hda/patch_realtek.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index aa93b0b..f310f3c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6898,7 +6898,7 @@ static struct hda_input_mux alc883_lenovo_nb0763_capture_source = {
.num_items = 4,
.items = {
{ "Mic", 0x0 },
- { "iMic", 0x1 },
+ { "Int Mic", 0x1 },
{ "Line", 0x2 },
{ "CD", 0x4 },
},
@@ -8473,8 +8473,8 @@ static struct snd_kcontrol_new alc883_lenovo_nb0763_mixer[] = {
HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
- HDA_CODEC_VOLUME("iMic Playback Volume", 0x0b, 0x1, HDA_INPUT),
- HDA_CODEC_MUTE("iMic Playback Switch", 0x0b, 0x1, HDA_INPUT),
+ HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
+ HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
{ } /* end */
};
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 033/260] sata_mv: fix broken DSM/TRIM support (v2)
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (31 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 032/260] ALSA: hda - Rename iMic to Int Mic on Lenovo NB0763 Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 034/260] x86, tsc, sched: Recompute cyc2ns_offset's during resume from sleep states Paul Gortmaker
` (228 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Mark Lord, Mark Lord, Jeff Garzik, Paul Gortmaker
From: Mark Lord <kernel@teksavvy.com>
commit 44b733809a5aba7f6b15a548d31a56d25bf3851c upstream.
Fix DSM/TRIM commands in sata_mv (v2).
These need to be issued using old-school "BM DMA",
rather than via the EDMA host queue.
Since the chips don't have proper BM DMA status,
we need to be more careful with setting the ATA_DMA_INTR bit,
since DSM/TRIM often has a long delay between "DMA complete"
and "command complete".
GEN_I chips don't have BM DMA, so no TRIM for them.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/ata/sata_mv.c | 44 +++++++++++++++++++++++++++++++++++++-------
1 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 71cc0d4..39af57a 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1886,19 +1886,25 @@ static void mv_bmdma_start(struct ata_queued_cmd *qc)
* LOCKING:
* Inherited from caller.
*/
-static void mv_bmdma_stop(struct ata_queued_cmd *qc)
+static void mv_bmdma_stop_ap(struct ata_port *ap)
{
- struct ata_port *ap = qc->ap;
void __iomem *port_mmio = mv_ap_base(ap);
u32 cmd;
/* clear start/stop bit */
cmd = readl(port_mmio + BMDMA_CMD);
- cmd &= ~ATA_DMA_START;
- writelfl(cmd, port_mmio + BMDMA_CMD);
+ if (cmd & ATA_DMA_START) {
+ cmd &= ~ATA_DMA_START;
+ writelfl(cmd, port_mmio + BMDMA_CMD);
+
+ /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
+ ata_sff_dma_pause(ap);
+ }
+}
- /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
- ata_sff_dma_pause(ap);
+static void mv_bmdma_stop(struct ata_queued_cmd *qc)
+{
+ mv_bmdma_stop_ap(qc->ap);
}
/**
@@ -1922,8 +1928,21 @@ static u8 mv_bmdma_status(struct ata_port *ap)
reg = readl(port_mmio + BMDMA_STATUS);
if (reg & ATA_DMA_ACTIVE)
status = ATA_DMA_ACTIVE;
- else
+ else if (reg & ATA_DMA_ERR)
status = (reg & ATA_DMA_ERR) | ATA_DMA_INTR;
+ else {
+ /*
+ * Just because DMA_ACTIVE is 0 (DMA completed),
+ * this does _not_ mean the device is "done".
+ * So we should not yet be signalling ATA_DMA_INTR
+ * in some cases. Eg. DSM/TRIM, and perhaps others.
+ */
+ mv_bmdma_stop_ap(ap);
+ if (ioread8(ap->ioaddr.altstatus_addr) & ATA_BUSY)
+ status = 0;
+ else
+ status = ATA_DMA_INTR;
+ }
return status;
}
@@ -1983,6 +2002,9 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
switch (tf->protocol) {
case ATA_PROT_DMA:
+ if (tf->command == ATA_CMD_DSM)
+ return;
+ /* fall-thru */
case ATA_PROT_NCQ:
break; /* continue below */
case ATA_PROT_PIO:
@@ -2082,6 +2104,8 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)
if ((tf->protocol != ATA_PROT_DMA) &&
(tf->protocol != ATA_PROT_NCQ))
return;
+ if (tf->command == ATA_CMD_DSM)
+ return; /* use bmdma for this */
/* Fill in Gen IIE command request block */
if (!(tf->flags & ATA_TFLAG_WRITE))
@@ -2277,6 +2301,12 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
switch (qc->tf.protocol) {
case ATA_PROT_DMA:
+ if (qc->tf.command == ATA_CMD_DSM) {
+ if (!ap->ops->bmdma_setup) /* no bmdma on GEN_I */
+ return AC_ERR_OTHER;
+ break; /* use bmdma for this */
+ }
+ /* fall thru */
case ATA_PROT_NCQ:
mv_start_edma(ap, port_mmio, pp, qc->tf.protocol);
pp->req_idx = (pp->req_idx + 1) & MV_MAX_Q_DEPTH_MASK;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 034/260] x86, tsc, sched: Recompute cyc2ns_offset's during resume from sleep states
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (32 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 033/260] sata_mv: fix broken DSM/TRIM support (v2) Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 035/260] PCI: MSI: Remove unsafe and unnecessary hardware access Paul Gortmaker
` (227 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Suresh Siddha, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Suresh Siddha <suresh.b.siddha@intel.com>
commit cd7240c0b900eb6d690ccee088a6c9b46dae815a upstream.
TSC's get reset after suspend/resume (even on cpu's with invariant TSC
which runs at a constant rate across ACPI P-, C- and T-states). And in
some systems BIOS seem to reinit TSC to arbitrary large value (still
sync'd across cpu's) during resume.
This leads to a scenario of scheduler rq->clock (sched_clock_cpu()) less
than rq->age_stamp (introduced in 2.6.32). This leads to a big value
returned by scale_rt_power() and the resulting big group power set by the
update_group_power() is causing improper load balancing between busy and
idle cpu's after suspend/resume.
This resulted in multi-threaded workloads (like kernel-compilation) go
slower after suspend/resume cycle on core i5 laptops.
Fix this by recomputing cyc2ns_offset's during resume, so that
sched_clock() continues from the point where it was left off during
suspend.
Reported-by: Florian Pritz <flo@xssn.at>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1282262618.2675.24.camel@sbsiddha-MOBL3.sc.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/include/asm/tsc.h | 2 ++
arch/x86/kernel/tsc.c | 38 ++++++++++++++++++++++++++++++++++++++
arch/x86/power/cpu.c | 2 ++
3 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index c042729..1ca132f 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -59,5 +59,7 @@ extern void check_tsc_sync_source(int cpu);
extern void check_tsc_sync_target(void);
extern int notsc_setup(char *);
+extern void save_sched_clock_state(void);
+extern void restore_sched_clock_state(void);
#endif /* _ASM_X86_TSC_H */
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 9faf91a..c65f741 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -626,6 +626,44 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu)
local_irq_restore(flags);
}
+static unsigned long long cyc2ns_suspend;
+
+void save_sched_clock_state(void)
+{
+ if (!sched_clock_stable)
+ return;
+
+ cyc2ns_suspend = sched_clock();
+}
+
+/*
+ * Even on processors with invariant TSC, TSC gets reset in some the
+ * ACPI system sleep states. And in some systems BIOS seem to reinit TSC to
+ * arbitrary value (still sync'd across cpu's) during resume from such sleep
+ * states. To cope up with this, recompute the cyc2ns_offset for each cpu so
+ * that sched_clock() continues from the point where it was left off during
+ * suspend.
+ */
+void restore_sched_clock_state(void)
+{
+ unsigned long long offset;
+ unsigned long flags;
+ int cpu;
+
+ if (!sched_clock_stable)
+ return;
+
+ local_irq_save(flags);
+
+ get_cpu_var(cyc2ns_offset) = 0;
+ offset = cyc2ns_suspend - sched_clock();
+
+ for_each_possible_cpu(cpu)
+ per_cpu(cyc2ns_offset, cpu) = offset;
+
+ local_irq_restore(flags);
+}
+
#ifdef CONFIG_CPU_FREQ
/* Frequency scaling support. Adjust the TSC based timer when the cpu frequency
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index 1290ba5..9c57cb1 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -113,6 +113,7 @@ static void __save_processor_state(struct saved_context *ctxt)
void save_processor_state(void)
{
__save_processor_state(&saved_context);
+ save_sched_clock_state();
}
#ifdef CONFIG_X86_32
EXPORT_SYMBOL(save_processor_state);
@@ -229,6 +230,7 @@ static void __restore_processor_state(struct saved_context *ctxt)
void restore_processor_state(void)
{
__restore_processor_state(&saved_context);
+ restore_sched_clock_state();
}
#ifdef CONFIG_X86_32
EXPORT_SYMBOL(restore_processor_state);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 035/260] PCI: MSI: Remove unsafe and unnecessary hardware access
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (33 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 034/260] x86, tsc, sched: Recompute cyc2ns_offset's during resume from sleep states Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 036/260] PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc() Paul Gortmaker
` (226 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ben Hutchings, Jesse Barnes, Paul Gortmaker
From: Ben Hutchings <bhutchings@solarflare.com>
commit fcd097f31a6ee207cc0c3da9cccd2a86d4334785 upstream.
During suspend on an SMP system, {read,write}_msi_msg_desc() may be
called to mask and unmask interrupts on a device that is already in a
reduced power state. At this point memory-mapped registers including
MSI-X tables are not accessible, and config space may not be fully
functional either.
While a device is in a reduced power state its interrupts are
effectively masked and its MSI(-X) state will be restored when it is
brought back to D0. Therefore these functions can simply read and
write msi_desc::msg for devices not in D0.
Further, read_msi_msg_desc() should only ever be used to update a
previously written message, so it can always read msi_desc::msg
and never needs to touch the hardware.
Tested-by: "Michael Chan" <mchan@broadcom.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/msi.c | 34 +++++++++++-----------------------
1 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 77b68ea..03f04dc 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -196,30 +196,15 @@ void unmask_msi_irq(unsigned int irq)
void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
{
struct msi_desc *entry = get_irq_desc_msi(desc);
- if (entry->msi_attrib.is_msix) {
- void __iomem *base = entry->mask_base +
- entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
- msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR);
- msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR);
- msg->data = readl(base + PCI_MSIX_ENTRY_DATA);
- } else {
- struct pci_dev *dev = entry->dev;
- int pos = entry->msi_attrib.pos;
- u16 data;
+ /* We do not touch the hardware (which may not even be
+ * accessible at the moment) but return the last message
+ * written. Assert that this is valid, assuming that
+ * valid messages are not all-zeroes. */
+ BUG_ON(!(entry->msg.address_hi | entry->msg.address_lo |
+ entry->msg.data));
- pci_read_config_dword(dev, msi_lower_address_reg(pos),
- &msg->address_lo);
- if (entry->msi_attrib.is_64) {
- pci_read_config_dword(dev, msi_upper_address_reg(pos),
- &msg->address_hi);
- pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
- } else {
- msg->address_hi = 0;
- pci_read_config_word(dev, msi_data_reg(pos, 0), &data);
- }
- msg->data = data;
- }
+ *msg = entry->msg;
}
void read_msi_msg(unsigned int irq, struct msi_msg *msg)
@@ -232,7 +217,10 @@ void read_msi_msg(unsigned int irq, struct msi_msg *msg)
void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
{
struct msi_desc *entry = get_irq_desc_msi(desc);
- if (entry->msi_attrib.is_msix) {
+
+ if (entry->dev->current_state != PCI_D0) {
+ /* Don't touch the hardware now */
+ } else if (entry->msi_attrib.is_msix) {
void __iomem *base;
base = entry->mask_base +
entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 036/260] PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (34 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 035/260] PCI: MSI: Remove unsafe and unnecessary hardware access Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 037/260] staging: hv: Fix missing functions for net_device_ops Paul Gortmaker
` (225 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ben Hutchings, Jesse Barnes, Paul Gortmaker
From: Ben Hutchings <bhutchings@solarflare.com>
commit 30da55242818a8ca08583188ebcbaccd283ad4d9 upstream.
commit 2ca1af9aa3285c6a5f103ed31ad09f7399fc65d7 "PCI: MSI: Remove
unsafe and unnecessary hardware access" changed read_msi_msg_desc() to
return the last MSI message written instead of reading it from the
device, since it may be called while the device is in a reduced
power state.
However, the pSeries platform code really does need to read messages
from the device, since they are initially written by firmware.
Therefore:
- Restore the previous behaviour of read_msi_msg_desc()
- Add new functions get_cached_msi_msg{,_desc}() which return the
last MSI message written
- Use the new functions where appropriate
Acked-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/ia64/kernel/msi_ia64.c | 2 +-
arch/ia64/sn/kernel/msi_sn.c | 2 +-
arch/x86/kernel/apic/io_apic.c | 2 +-
drivers/pci/msi.c | 47 +++++++++++++++++++++++++++++++++++----
include/linux/msi.h | 2 +
5 files changed, 47 insertions(+), 8 deletions(-)
diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c
index 6c89228..4a746ea 100644
--- a/arch/ia64/kernel/msi_ia64.c
+++ b/arch/ia64/kernel/msi_ia64.c
@@ -25,7 +25,7 @@ static int ia64_set_msi_irq_affinity(unsigned int irq,
if (irq_prepare_move(irq, cpu))
return -1;
- read_msi_msg(irq, &msg);
+ get_cached_msi_msg(irq, &msg);
addr = msg.address_lo;
addr &= MSI_ADDR_DEST_ID_MASK;
diff --git a/arch/ia64/sn/kernel/msi_sn.c b/arch/ia64/sn/kernel/msi_sn.c
index ebfdd6a..0c72dd4 100644
--- a/arch/ia64/sn/kernel/msi_sn.c
+++ b/arch/ia64/sn/kernel/msi_sn.c
@@ -175,7 +175,7 @@ static int sn_set_msi_irq_affinity(unsigned int irq,
* Release XIO resources for the old MSI PCI address
*/
- read_msi_msg(irq, &msg);
+ get_cached_msi_msg(irq, &msg);
sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
pdev = sn_pdev->pdi_linux_pcidev;
provider = SN_PCIDEV_BUSPROVIDER(pdev);
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index c64499c..abb136a 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3415,7 +3415,7 @@ static int set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask)
cfg = desc->chip_data;
- read_msi_msg_desc(desc, &msg);
+ get_cached_msi_msg_desc(desc, &msg);
msg.data &= ~MSI_DATA_VECTOR_MASK;
msg.data |= MSI_DATA_VECTOR(cfg->vector);
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 03f04dc..cd22d69 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -197,9 +197,46 @@ void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
{
struct msi_desc *entry = get_irq_desc_msi(desc);
- /* We do not touch the hardware (which may not even be
- * accessible at the moment) but return the last message
- * written. Assert that this is valid, assuming that
+ BUG_ON(entry->dev->current_state != PCI_D0);
+
+ if (entry->msi_attrib.is_msix) {
+ void __iomem *base = entry->mask_base +
+ entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
+
+ msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR);
+ msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR);
+ msg->data = readl(base + PCI_MSIX_ENTRY_DATA);
+ } else {
+ struct pci_dev *dev = entry->dev;
+ int pos = entry->msi_attrib.pos;
+ u16 data;
+
+ pci_read_config_dword(dev, msi_lower_address_reg(pos),
+ &msg->address_lo);
+ if (entry->msi_attrib.is_64) {
+ pci_read_config_dword(dev, msi_upper_address_reg(pos),
+ &msg->address_hi);
+ pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
+ } else {
+ msg->address_hi = 0;
+ pci_read_config_word(dev, msi_data_reg(pos, 0), &data);
+ }
+ msg->data = data;
+ }
+}
+
+void read_msi_msg(unsigned int irq, struct msi_msg *msg)
+{
+ struct irq_desc *desc = irq_to_desc(irq);
+
+ read_msi_msg_desc(desc, msg);
+}
+
+void get_cached_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
+{
+ struct msi_desc *entry = get_irq_desc_msi(desc);
+
+ /* Assert that the cache is valid, assuming that
* valid messages are not all-zeroes. */
BUG_ON(!(entry->msg.address_hi | entry->msg.address_lo |
entry->msg.data));
@@ -207,11 +244,11 @@ void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
*msg = entry->msg;
}
-void read_msi_msg(unsigned int irq, struct msi_msg *msg)
+void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg)
{
struct irq_desc *desc = irq_to_desc(irq);
- read_msi_msg_desc(desc, msg);
+ get_cached_msi_msg_desc(desc, msg);
}
void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 6991ab5..91b05c1 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -14,8 +14,10 @@ struct irq_desc;
extern void mask_msi_irq(unsigned int irq);
extern void unmask_msi_irq(unsigned int irq);
extern void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg);
+extern void get_cached_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg);
extern void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg);
extern void read_msi_msg(unsigned int irq, struct msi_msg *msg);
+extern void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg);
extern void write_msi_msg(unsigned int irq, struct msi_msg *msg);
struct msi_desc {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 037/260] staging: hv: Fix missing functions for net_device_ops
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (35 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 036/260] PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc() Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 038/260] staging: hv: Fixed bounce kmap problem by using correct index Paul Gortmaker
` (224 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Haiyang Zhang, Hank Janssen, Greg Kroah-Hartman,
Paul Gortmaker
From: Haiyang Zhang <haiyangz@microsoft.com>
commit b681b5886bb5d1f5b6750a0ed7c62846da7ccea4 upstream.
Fix missing functions for net_device_ops.
It's a bug when porting the drivers from 2.6.27 to 2.6.32. In 2.6.27,
the default functions for Ethernet, like eth_change_mtu(), were assigned
by ether_setup(). But in 2.6.32, these function pointers moved to
net_device_ops structure and no longer be assigned in ether_setup(). So
we need to set these functions in our driver code. It will ensure the
MTU won't be set beyond 1500. Otherwise, this can cause an error on the
server side, because the HyperV linux driver doesn't support jumbo frame
yet.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/staging/hv/netvsc_drv.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index ab27d9a..91e413e 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -382,6 +382,9 @@ static const struct net_device_ops device_ops = {
.ndo_start_xmit = netvsc_start_xmit,
.ndo_get_stats = netvsc_get_stats,
.ndo_set_multicast_list = netvsc_set_multicast_list,
+ .ndo_change_mtu = eth_change_mtu,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_mac_address = eth_mac_addr,
};
static int netvsc_probe(struct device *device)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 038/260] staging: hv: Fixed bounce kmap problem by using correct index
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (36 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 037/260] staging: hv: Fix missing functions for net_device_ops Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 039/260] staging: hv: Fixed the value of the 64bit-hole inside ring buffer Paul Gortmaker
` (223 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Hank Janssen, Greg Kroah-Hartman, Paul Gortmaker
From: Hank Janssen <hjanssen@microsoft.com>
commit 0c47a70a9a8a6d1ec37a53d2f9cb82f8b8ef8aa2 upstream.
Fixed bounce offset kmap problem by using correct index.
The symptom of the problem is that in some NAS appliances this problem
represents Itself by a unresponsive VM under a load with many clients writing
small files.
Signed-off-by:Hank Janssen <hjanssen@microsoft.com>
Signed-off-by:Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/staging/hv/storvsc_drv.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 8a58272..060da9e 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -524,7 +524,7 @@ static unsigned int copy_to_bounce_buffer(struct scatterlist *orig_sgl,
ASSERT(orig_sgl[i].offset + orig_sgl[i].length <= PAGE_SIZE);
- if (j == 0)
+ if (bounce_addr == 0)
bounce_addr = (unsigned long)kmap_atomic(sg_page((&bounce_sgl[j])), KM_IRQ0);
while (srclen) {
@@ -585,7 +585,7 @@ static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl,
destlen = orig_sgl[i].length;
ASSERT(orig_sgl[i].offset + orig_sgl[i].length <= PAGE_SIZE);
- if (j == 0)
+ if (bounce_addr == 0)
bounce_addr = (unsigned long)kmap_atomic(sg_page((&bounce_sgl[j])), KM_IRQ0);
while (destlen) {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 039/260] staging: hv: Fixed the value of the 64bit-hole inside ring buffer
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (37 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 038/260] staging: hv: Fixed bounce kmap problem by using correct index Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 040/260] staging: hv: Increased storvsc ringbuffer and max_io_requests Paul Gortmaker
` (222 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Haiyang Zhang, Greg Kroah-Hartman, Paul Gortmaker
From: Haiyang Zhang <haiyangz@microsoft.com>
commit e5fa721d1c2a54261a37eb59686e18dee34b6af6 upstream.
Fixed the value of the 64bit-hole inside ring buffer, this
caused a problem on Hyper-V when running checked Windows builds.
Checked builds of Windows are used internally and given to external
system integrators at times. They are builds that for example that all
elements in a structure follow the definition of that Structure. The bug
this fixed was for a field that we did not fill in at all (Because we do
Not use it on the Linux side), and the checked build of windows gives
errors on it internally to the Windows logs.
This fixes that error.
Signed-off-by:Hank Janssen <hjanssen@microsoft.com>
Signed-off-by:Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/staging/hv/RingBuffer.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/RingBuffer.c b/drivers/staging/hv/RingBuffer.c
index 80b8a2c..512b5fd 100644
--- a/drivers/staging/hv/RingBuffer.c
+++ b/drivers/staging/hv/RingBuffer.c
@@ -192,8 +192,7 @@ Description:
static inline u64
GetRingBufferIndices(RING_BUFFER_INFO *RingInfo)
{
- return ((u64)RingInfo->RingBuffer->WriteIndex << 32)
- || RingInfo->RingBuffer->ReadIndex;
+ return (u64)RingInfo->RingBuffer->WriteIndex << 32;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 040/260] staging: hv: Increased storvsc ringbuffer and max_io_requests
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (38 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 039/260] staging: hv: Fixed the value of the 64bit-hole inside ring buffer Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 041/260] staging: hv: Fixed lockup problem with bounce_buffer scatter list Paul Gortmaker
` (221 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Hank Janssen, Haiyang Zhang, Greg Kroah-Hartman,
Paul Gortmaker
From: Hank Janssen <hjanssen@microsoft.com>
commit 15dd1c9f53b31cdc84b8072a88c23fa09527c596 upstream.
Increased storvsc ringbuffer and max_io_requests. This now more
closely mimics the numbers on Hyper-V. And will allow more IO requests
to take place for the SCSI driver.
Max_IO is set to double from what it was before, Hyper-V allows it and
we have had appliance builder requests to see if it was a problem to
increase the number.
Ringbuffer size for storvsc is now increased because I have seen A few buffer
problems on extremely busy systems. They were Set pretty low before.
And since max_io_requests is increased I Really needed to increase the buffer
as well.
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/staging/hv/StorVscApi.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/StorVscApi.h b/drivers/staging/hv/StorVscApi.h
index 126a858..aad90bd 100644
--- a/drivers/staging/hv/StorVscApi.h
+++ b/drivers/staging/hv/StorVscApi.h
@@ -28,10 +28,10 @@
#include "VmbusApi.h"
/* Defines */
-#define STORVSC_RING_BUFFER_SIZE (10*PAGE_SIZE)
+#define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
#define BLKVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
-#define STORVSC_MAX_IO_REQUESTS 64
+#define STORVSC_MAX_IO_REQUESTS 128
/*
* In Hyper-V, each port/path/target maps to 1 scsi host adapter. In
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 041/260] staging: hv: Fixed lockup problem with bounce_buffer scatter list
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (39 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 040/260] staging: hv: Increased storvsc ringbuffer and max_io_requests Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 042/260] fuse: flush background queue on connection close Paul Gortmaker
` (220 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Hank Janssen, Haiyang Zhang, Greg Kroah-Hartman,
Paul Gortmaker
From: Hank Janssen <hjanssen@microsoft.com>
commit 77c5ceaff31645ea049c6706b99e699eae81fb88 upstream.
Fixed lockup problem with bounce_buffer scatter list which caused
crashes in heavy loads. And minor code indentation cleanup in effected
area.
Removed whitespace and noted minor indentation changes in description as
pointed out by Joe Perches. (Thanks for reviewing Joe)
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/staging/hv/storvsc_drv.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 060da9e..5504e19 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -644,6 +644,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
unsigned int request_size = 0;
int i;
struct scatterlist *sgl;
+ unsigned int sg_count = 0;
DPRINT_ENTER(STORVSC_DRV);
@@ -728,6 +729,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
request->DataBuffer.Length = scsi_bufflen(scmnd);
if (scsi_sg_count(scmnd)) {
sgl = (struct scatterlist *)scsi_sglist(scmnd);
+ sg_count = scsi_sg_count(scmnd);
/* check if we need to bounce the sgl */
if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) {
@@ -762,11 +764,12 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
scsi_sg_count(scmnd));
sgl = cmd_request->bounce_sgl;
+ sg_count = cmd_request->bounce_sgl_count;
}
request->DataBuffer.Offset = sgl[0].offset;
- for (i = 0; i < scsi_sg_count(scmnd); i++) {
+ for (i = 0; i < sg_count; i++) {
DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d \n",
i, sgl[i].length, sgl[i].offset);
request->DataBuffer.PfnArray[i] =
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 042/260] fuse: flush background queue on connection close
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (40 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 041/260] staging: hv: Fixed lockup problem with bounce_buffer scatter list Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 043/260] ath9k_hw: fix parsing of HT40 5 GHz CTLs Paul Gortmaker
` (219 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Miklos Szeredi, Paul Gortmaker
From: Miklos Szeredi <mszeredi@suse.cz>
commit 595afaf9e6ee1b48e13ec4b8bcc8c7dee888161a upstream.
David Bartly reported that fuse can hang in fuse_get_req_nofail() when
the connection to the filesystem server is no longer active.
If bg_queue is not empty then flush_bg_queue() called from
request_end() can put more requests on to the pending queue. If this
happens while ending requests on the processing queue then those
background requests will be queued to the pending list and never
ended.
Another problem is that fuse_dev_release() didn't wake up processes
sleeping on blocked_waitq.
Solve this by:
a) flushing the background queue before calling end_requests() on the
pending and processing queues
b) setting blocked = 0 and waking up processes waiting on
blocked_waitq()
Thanks to David for an excellent bug report.
Reported-by: David Bartley <andareed@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/fuse/dev.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index eb7e942..c235afc 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1158,6 +1158,14 @@ __acquires(&fc->lock)
}
}
+static void end_queued_requests(struct fuse_conn *fc)
+{
+ fc->max_background = UINT_MAX;
+ flush_bg_queue(fc);
+ end_requests(fc, &fc->pending);
+ end_requests(fc, &fc->processing);
+}
+
/*
* Abort all requests.
*
@@ -1184,8 +1192,7 @@ void fuse_abort_conn(struct fuse_conn *fc)
fc->connected = 0;
fc->blocked = 0;
end_io_requests(fc);
- end_requests(fc, &fc->pending);
- end_requests(fc, &fc->processing);
+ end_queued_requests(fc);
wake_up_all(&fc->waitq);
wake_up_all(&fc->blocked_waitq);
kill_fasync(&fc->fasync, SIGIO, POLL_IN);
@@ -1200,8 +1207,9 @@ int fuse_dev_release(struct inode *inode, struct file *file)
if (fc) {
spin_lock(&fc->lock);
fc->connected = 0;
- end_requests(fc, &fc->pending);
- end_requests(fc, &fc->processing);
+ fc->blocked = 0;
+ end_queued_requests(fc);
+ wake_up_all(&fc->blocked_waitq);
spin_unlock(&fc->lock);
fuse_conn_put(fc);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 043/260] ath9k_hw: fix parsing of HT40 5 GHz CTLs
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (41 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 042/260] fuse: flush background queue on connection close Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 044/260] ocfs2: Fix incorrect checksum validation error Paul Gortmaker
` (218 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Luis R. Rodriguez, John W. Linville,
Paul Gortmaker
From: Luis R. Rodriguez <lrodriguez@atheros.com>
commit 904879748d7439a6dabdc6be9aad983e216b027d upstream.
The 5 GHz CTL indexes were not being read for all hardware
devices due to the masking out through the CTL_MODE_M mask
being one bit too short. Without this the calibrated regulatory
maximum values were not being picked up when devices operate
on 5 GHz in HT40 mode. The final output power used for Atheros
devices is the minimum between the calibrated CTL values and
what CRDA provides.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/wireless/ath/ath9k/eeprom.h | 2 +-
drivers/net/wireless/ath/regd.h | 1 -
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index 2f2993b..104e3ea 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -61,7 +61,7 @@
#define SD_NO_CTL 0xE0
#define NO_CTL 0xff
-#define CTL_MODE_M 7
+#define CTL_MODE_M 0xf
#define CTL_11A 0
#define CTL_11B 1
#define CTL_11G 2
diff --git a/drivers/net/wireless/ath/regd.h b/drivers/net/wireless/ath/regd.h
index a1c3952..345dd97 100644
--- a/drivers/net/wireless/ath/regd.h
+++ b/drivers/net/wireless/ath/regd.h
@@ -31,7 +31,6 @@ enum ctl_group {
#define NO_CTL 0xff
#define SD_NO_CTL 0xE0
#define NO_CTL 0xff
-#define CTL_MODE_M 7
#define CTL_11A 0
#define CTL_11B 1
#define CTL_11G 2
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 044/260] ocfs2: Fix incorrect checksum validation error
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (42 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 043/260] ath9k_hw: fix parsing of HT40 5 GHz CTLs Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 045/260] USB: ehci-ppc-of: problems in unwind Paul Gortmaker
` (217 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Sunil Mushran, Paul Gortmaker
From: Sunil Mushran <sunil.mushran@oracle.com>
commit f5ce5a08a40f2086435858ddc80cb40394b082eb upstream.
For local mounts, ocfs2_read_locked_inode() calls ocfs2_read_blocks_sync() to
read the inode off the disk. The latter first checks to see if that block is
cached in the journal, and, if so, returns that block. That is ok.
But ocfs2_read_locked_inode() goes wrong when it tries to validate the checksum
of such blocks. Blocks that are cached in the journal may not have had their
checksum computed as yet. We should not validate the checksums of such blocks.
Fixes ossbz#1282
http://oss.oracle.com/bugzilla/show_bug.cgi?id=1282
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Singed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ocfs2/inode.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index af18988..bbecb19 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -484,7 +484,11 @@ static int ocfs2_read_locked_inode(struct inode *inode,
OCFS2_BH_IGNORE_CACHE);
} else {
status = ocfs2_read_blocks_sync(osb, args->fi_blkno, 1, &bh);
- if (!status)
+ /*
+ * If buffer is in jbd, then its checksum may not have been
+ * computed as yet.
+ */
+ if (!status && !buffer_jbd(bh))
status = ocfs2_validate_inode_block(osb->sb, bh);
}
if (status < 0) {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 045/260] USB: ehci-ppc-of: problems in unwind
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (43 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 044/260] ocfs2: Fix incorrect checksum validation error Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 046/260] USB: Fix kernel oops with g_ether and Windows Paul Gortmaker
` (216 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, Greg Kroah-Hartman, Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit 08a3b3b1c2e622e378d9086aee9e2e42ce37591d upstream.
The iounmap(ehci->ohci_hcctrl_reg); should be the first thing we do
because the ioremap() was the last thing we did. Also if we hit any of
the goto statements in the original code then it would have led to a
NULL dereference of "ehci". This bug was introduced in: 796bcae7361c
"USB: powerpc: Workaround for the PPC440EPX USBH_23 errata [take 3]"
I modified the few lines in front a little so that my code didn't
obscure the return success code path.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/host/ehci-ppc-of.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c
index 8df33b8..5c2fbd1 100644
--- a/drivers/usb/host/ehci-ppc-of.c
+++ b/drivers/usb/host/ehci-ppc-of.c
@@ -192,17 +192,19 @@ ehci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
}
rv = usb_add_hcd(hcd, irq, 0);
- if (rv == 0)
- return 0;
+ if (rv)
+ goto err_ehci;
+
+ return 0;
+err_ehci:
+ if (ehci->has_amcc_usb23)
+ iounmap(ehci->ohci_hcctrl_reg);
iounmap(hcd->regs);
err_ioremap:
irq_dispose_mapping(irq);
err_irq:
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
-
- if (ehci->has_amcc_usb23)
- iounmap(ehci->ohci_hcctrl_reg);
err_rmr:
usb_put_hcd(hcd);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 046/260] USB: Fix kernel oops with g_ether and Windows
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (44 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 045/260] USB: ehci-ppc-of: problems in unwind Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 047/260] USB: CP210x Add new device ID Paul Gortmaker
` (215 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Maxim Osipov, Greg Kroah-Hartman, Paul Gortmaker
From: Maxim Osipov <maxim.osipov@gmail.com>
commit 037d3656adbd7e8cb848f01cf5dec423ed76bbe7 upstream.
Please find attached patch for
https://bugzilla.kernel.org/show_bug.cgi?id=16023 problem.
Signed-off-by: Maxim Osipov <maxim.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/gadget/rndis.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 5c0d06c..1043da1 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -292,9 +292,13 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */
case OID_GEN_VENDOR_DESCRIPTION:
pr_debug("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__);
- length = strlen (rndis_per_dev_params [configNr].vendorDescr);
- memcpy (outbuf,
- rndis_per_dev_params [configNr].vendorDescr, length);
+ if ( rndis_per_dev_params [configNr].vendorDescr ) {
+ length = strlen (rndis_per_dev_params [configNr].vendorDescr);
+ memcpy (outbuf,
+ rndis_per_dev_params [configNr].vendorDescr, length);
+ } else {
+ outbuf[0] = 0;
+ }
retval = 0;
break;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 047/260] USB: CP210x Add new device ID
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (45 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 046/260] USB: Fix kernel oops with g_ether and Windows Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 048/260] USB: cp210x: Add B&G H3000 link cable ID Paul Gortmaker
` (214 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Craig Shelley, Greg Kroah-Hartman, Paul Gortmaker
From: Craig Shelley <craig@microtron.org.uk>
commit 541e05ec3add5ab5bcf238d60161b53480280b20 upstream.
New device ID added for Balluff RFID reader.
Signed-off-by: Craig Shelley <craig@microtron.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/cp210x.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 2d36ed2..3521aa6 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -111,6 +111,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */
{ USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */
{ USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
+ { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */
{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
{ USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
@@ -124,14 +125,14 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
{ USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
{ USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
- { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
- { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
- { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
- { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
{ USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */
{ USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */
{ USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */
{ USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */
+ { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
+ { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
+ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
+ { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
{ } /* Terminating Entry */
};
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 048/260] USB: cp210x: Add B&G H3000 link cable ID
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (46 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 047/260] USB: CP210x Add new device ID Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 049/260] USB: ftdi_sio: Added custom PIDs for ChamSys products Paul Gortmaker
` (213 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jason Detring, Greg Kroah-Hartman, Paul Gortmaker
From: Jason Detring <jason.detring@navico.com>
commit 0bf7a81c5d447c21db434be35363c44c0a30f598 upstream.
This is the cable between an H3000 navigation unit and a multi-function display.
http://www.bandg.com/en/Products/H3000/Spares-and-Accessories/Cables/H3000-CPU-USB-Cable-Pack/
Signed-off-by: Jason Detring <jason.detring@navico.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/cp210x.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 3521aa6..c39349f 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -90,6 +90,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */
{ USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
{ USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
+ { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */
{ USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
{ USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */
{ USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 049/260] USB: ftdi_sio: Added custom PIDs for ChamSys products
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (47 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 048/260] USB: cp210x: Add B&G H3000 link cable ID Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 050/260] usb: serial: mos7840: Add USB ID to support the B&B Electronics USOPTL4-2P Paul Gortmaker
` (212 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Luke Lowrey, Greg Kroah-Hartman, Paul Gortmaker
From: Luke Lowrey <luke@chamsys.co.uk>
commit 657373883417b2618023fd4135d251ba06a2c30a upstream.
Added the 0xDAF8 to 0xDAFF PID range for ChamSys limited USB interface/wing products
Signed-off-by: Luke Lowrey <luke@chamsys.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/ftdi_sio.c | 8 ++++++++
drivers/usb/serial/ftdi_sio_ids.h | 12 ++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index ce929e4..fd5c874 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -759,6 +759,14 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) },
{ USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+ { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) },
{ }, /* Optional parameter entry */
{ } /* Terminating entry */
};
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 792f005..6eb1592 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -135,6 +135,18 @@
#define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */
/*
+ * ChamSys Limited (www.chamsys.co.uk) USB wing/interface product IDs
+ */
+#define FTDI_CHAMSYS_24_MASTER_WING_PID 0xDAF8
+#define FTDI_CHAMSYS_PC_WING_PID 0xDAF9
+#define FTDI_CHAMSYS_USB_DMX_PID 0xDAFA
+#define FTDI_CHAMSYS_MIDI_TIMECODE_PID 0xDAFB
+#define FTDI_CHAMSYS_MINI_WING_PID 0xDAFC
+#define FTDI_CHAMSYS_MAXI_WING_PID 0xDAFD
+#define FTDI_CHAMSYS_MEDIA_WING_PID 0xDAFE
+#define FTDI_CHAMSYS_WING_PID 0xDAFF
+
+/*
* Westrex International devices submitted by Cory Lee
*/
#define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 050/260] usb: serial: mos7840: Add USB ID to support the B&B Electronics USOPTL4-2P.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (48 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 049/260] USB: ftdi_sio: Added custom PIDs for ChamSys products Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 051/260] usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485 converters Paul Gortmaker
` (211 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dave Ludlow, Greg Kroah-Hartman, Paul Gortmaker
From: Dave Ludlow <dave.ludlow@bay.ws>
commit caf3a636a9f809fdca5fa746e6687096457accb1 upstream.
Add the USB ID needed to support B&B Electronic's 2-port, optically-isolated,
powered, USB to RS485 converter.
Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/mos7840.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 68f6a1d..0fffcee 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -130,6 +130,7 @@
#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42
#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
#define BANDB_DEVICE_ID_USOPTL2_4 0xAC24
+#define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02
/* This driver also supports
* ATEN UC2324 device using Moschip MCS7840
@@ -193,6 +194,7 @@ static const struct usb_device_id moschip_port_id_table[] = {
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4P)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
{} /* terminating entry */
@@ -210,6 +212,7 @@ static const struct usb_device_id moschip_id_table_combined[] __devinitconst = {
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4P)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
{} /* terminating entry */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 051/260] usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485 converters.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (49 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 050/260] usb: serial: mos7840: Add USB ID to support the B&B Electronics USOPTL4-2P Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 052/260] USB: Expose vendor-specific ACM channel on Nokia 5230 Paul Gortmaker
` (210 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dave Ludlow, Greg Kroah-Hartman, Paul Gortmaker
From: Dave Ludlow <dave.ludlow@bay.ws>
commit 870408c8291015872a7a0b583673a9e56b3e73f4 upstream.
Add the USB IDs needed to support the B&B USOPTL4-4P, USO9ML2-2P, and
USO9ML2-4P. This patch expands and corrects a typo in the patch sent
on 08-31-2010.
Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/mos7840.c | 35 ++++++++++++++++++++++-------------
1 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 0fffcee..a73f2f5 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -120,17 +120,20 @@
* by making a change here, in moschip_port_id_table, and in
* moschip_id_table_combined
*/
-#define USB_VENDOR_ID_BANDB 0x0856
-#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22
-#define BANDB_DEVICE_ID_USO9ML2_4 0xAC24
-#define BANDB_DEVICE_ID_US9ML2_2 0xAC29
-#define BANDB_DEVICE_ID_US9ML2_4 0xAC30
-#define BANDB_DEVICE_ID_USPTL4_2 0xAC31
-#define BANDB_DEVICE_ID_USPTL4_4 0xAC32
-#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42
-#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
-#define BANDB_DEVICE_ID_USOPTL2_4 0xAC24
-#define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02
+#define USB_VENDOR_ID_BANDB 0x0856
+#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22
+#define BANDB_DEVICE_ID_USO9ML2_2P 0xBC00
+#define BANDB_DEVICE_ID_USO9ML2_4 0xAC24
+#define BANDB_DEVICE_ID_USO9ML2_4P 0xBC01
+#define BANDB_DEVICE_ID_US9ML2_2 0xAC29
+#define BANDB_DEVICE_ID_US9ML2_4 0xAC30
+#define BANDB_DEVICE_ID_USPTL4_2 0xAC31
+#define BANDB_DEVICE_ID_USPTL4_4 0xAC32
+#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42
+#define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02
+#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
+#define BANDB_DEVICE_ID_USOPTL4_4P 0xBC03
+#define BANDB_DEVICE_ID_USOPTL2_4 0xAC24
/* This driver also supports
* ATEN UC2324 device using Moschip MCS7840
@@ -186,15 +189,18 @@ static const struct usb_device_id moschip_port_id_table[] = {
{USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
{USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)},
- {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4P)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
{} /* terminating entry */
@@ -204,15 +210,18 @@ static const struct usb_device_id moschip_id_table_combined[] __devinitconst = {
{USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
{USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)},
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)},
- {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4P)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
{} /* terminating entry */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 052/260] USB: Expose vendor-specific ACM channel on Nokia 5230
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (50 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 051/260] usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485 converters Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 053/260] USB: cdc-acm: Adding second ACM channel support for various Nokia and one Samsung phones Paul Gortmaker
` (209 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Przemo Firszt, Greg Kroah-Hartman, Paul Gortmaker
From: Przemo Firszt <przemo@firszt.eu>
commit 83a4eae9aeed4a69e89e323a105e653ae06e7c1f upstream.
Nokia S60 phones expose two ACM channels. The first is
a modem, the second is 'vendor-specific' but is treated
as a serial device at the S60 end, so we want to expose
it on Linux too.
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/class/cdc-acm.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 3c73add..bbcdabe 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1596,6 +1596,7 @@ static const struct usb_device_id acm_ids[] = {
{ NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */
{ NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */
{ NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */
+ { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */
/* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 053/260] USB: cdc-acm: Adding second ACM channel support for various Nokia and one Samsung phones
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (51 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 052/260] USB: Expose vendor-specific ACM channel on Nokia 5230 Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 054/260] USB: cdc-acm: Add pseudo modem without AT command capabilities Paul Gortmaker
` (208 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Toby Gray, Oliver Neukum, Greg Kroah-Hartman,
Paul Gortmaker
From: Toby Gray <toby.gray@realvnc.com>
commit 4035e45632c2a8bb4edae83c20447051bd9a9604 upstream.
S60 phones from Nokia and Samsung expose two ACM channels. The first is a modem
with a standard AT-command interface, which is picked up correctly by CDC-ACM.
The second ACM port is marked as having a vendor-specific protocol. This means
that the ACM driver will not claim the second channel by default.
This adds support for the second ACM channel for the following devices:
Nokia E63
Nokia E75
Nokia 6760 Slide
Nokia E52
Nokia E55
Nokia E72
Nokia X6
Nokia N97 Mini
Nokia 5800 Xpressmusic
Nokia E90
Samsung GTi8510 (INNOV8)
Signed-off-by: Toby Gray <toby.gray@realvnc.com>
Cc: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/class/cdc-acm.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index bbcdabe..8c388f8 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1487,6 +1487,11 @@ static int acm_reset_resume(struct usb_interface *intf)
USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, \
USB_CDC_ACM_PROTO_VENDOR)
+#define SAMSUNG_PCSUITE_ACM_INFO(x) \
+ USB_DEVICE_AND_INTERFACE_INFO(0x04e7, x, \
+ USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, \
+ USB_CDC_ACM_PROTO_VENDOR)
+
/*
* USB driver structure.
*/
@@ -1597,6 +1602,17 @@ static const struct usb_device_id acm_ids[] = {
{ NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */
{ NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */
{ NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */
+ { NOKIA_PCSUITE_ACM_INFO(0x0178), }, /* Nokia E63 */
+ { NOKIA_PCSUITE_ACM_INFO(0x010e), }, /* Nokia E75 */
+ { NOKIA_PCSUITE_ACM_INFO(0x02d9), }, /* Nokia 6760 Slide */
+ { NOKIA_PCSUITE_ACM_INFO(0x01d0), }, /* Nokia E52 */
+ { NOKIA_PCSUITE_ACM_INFO(0x0223), }, /* Nokia E72 */
+ { NOKIA_PCSUITE_ACM_INFO(0x0275), }, /* Nokia X6 */
+ { NOKIA_PCSUITE_ACM_INFO(0x026c), }, /* Nokia N97 Mini */
+ { NOKIA_PCSUITE_ACM_INFO(0x0154), }, /* Nokia 5800 XpressMusic */
+ { NOKIA_PCSUITE_ACM_INFO(0x04ce), }, /* Nokia E90 */
+ { NOKIA_PCSUITE_ACM_INFO(0x01d4), }, /* Nokia E55 */
+ { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */
/* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 054/260] USB: cdc-acm: Add pseudo modem without AT command capabilities
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (52 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 053/260] USB: cdc-acm: Adding second ACM channel support for various Nokia and one Samsung phones Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 055/260] USB: cdc-acm: Fixing crash when ACM probing interfaces with no endpoint descriptors Paul Gortmaker
` (207 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Philippe Corbes, Greg Kroah-Hartman,
Paul Gortmaker
From: Philippe Corbes <philippe.corbes@gmail.com>
commit 5b239f0aebd4dd6f85b13decf5e18e86e35d57f0 upstream.
cdc-acm.c : Manage pseudo-modem without AT commands capabilities
Enable to drive electronic simple gadgets based on microcontrolers.
The Interface descriptor is like this:
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 0 None
Signed-off-by: Philippe Corbes <philippe.corbes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/class/cdc-acm.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 8c388f8..ffbf1aa 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1621,6 +1621,10 @@ static const struct usb_device_id acm_ids[] = {
.driver_info = NOT_A_MODEM,
},
+ /* control interfaces without any protocol set */
+ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
+ USB_CDC_PROTO_NONE) },
+
/* control interfaces with various AT-command sets */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
USB_CDC_ACM_PROTO_AT_V25TER) },
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 055/260] USB: cdc-acm: Fixing crash when ACM probing interfaces with no endpoint descriptors.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (53 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 054/260] USB: cdc-acm: Add pseudo modem without AT command capabilities Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 056/260] ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open() Paul Gortmaker
` (206 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Toby Gray, Oliver Neukum, Greg Kroah-Hartman,
Paul Gortmaker
From: Toby Gray <toby.gray@realvnc.com>
commit 577045c0a76e34294f902a7d5d60e90b04d094d0 upstream.
Certain USB devices, such as the Nokia X6 mobile phone, don't expose any
endpoint descriptors on some of their interfaces. If the ACM driver is forced
to probe all interfaces on a device the a NULL pointer dereference will occur
when the ACM driver attempts to use the endpoint of the alternative settings.
One way to get the ACM driver to probe all the interfaces is by using the
/sys/bus/usb/drivers/cdc_acm/new_id interface.
This patch checks that the endpoint pointer for the current alternate settings
is non-NULL before using it.
Signed-off-by: Toby Gray <toby.gray@realvnc.com>
Cc: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/class/cdc-acm.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index ffbf1aa..f1accc8 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -971,7 +971,8 @@ static int acm_probe(struct usb_interface *intf,
}
if (!buflen) {
- if (intf->cur_altsetting->endpoint->extralen &&
+ if (intf->cur_altsetting->endpoint &&
+ intf->cur_altsetting->endpoint->extralen &&
intf->cur_altsetting->endpoint->extra) {
dev_dbg(&intf->dev,
"Seeking extra descriptors on endpoint\n");
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 056/260] ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (54 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 055/260] USB: cdc-acm: Fixing crash when ACM probing interfaces with no endpoint descriptors Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 057/260] sysfs: checking for NULL instead of ERR_PTR Paul Gortmaker
` (205 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Takashi Iwai, Paul Gortmaker
From: Takashi Iwai <tiwai@suse.de>
commit 27f7ad53829f79e799a253285318bff79ece15bd upstream.
The error handling in snd_seq_oss_open() has several bad codes that
do dereferecing released pointers and double-free of kmalloc'ed data.
The object dp is release in free_devinfo() that is called via
private_free callback. The rest shouldn't touch this object any more.
The patch changes delete_port() to call kfree() in any case, and gets
rid of unnecessary calls of destructors in snd_seq_oss_open().
Fixes CVE-2010-3080.
Reported-and-tested-by: Tavis Ormandy <taviso@cmpxchg8b.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/core/seq/oss/seq_oss_init.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c
index 6857122..69cd7b3 100644
--- a/sound/core/seq/oss/seq_oss_init.c
+++ b/sound/core/seq/oss/seq_oss_init.c
@@ -281,13 +281,10 @@ snd_seq_oss_open(struct file *file, int level)
return 0;
_error:
- snd_seq_oss_writeq_delete(dp->writeq);
- snd_seq_oss_readq_delete(dp->readq);
snd_seq_oss_synth_cleanup(dp);
snd_seq_oss_midi_cleanup(dp);
- delete_port(dp);
delete_seq_queue(dp->queue);
- kfree(dp);
+ delete_port(dp);
return rc;
}
@@ -350,8 +347,10 @@ create_port(struct seq_oss_devinfo *dp)
static int
delete_port(struct seq_oss_devinfo *dp)
{
- if (dp->port < 0)
+ if (dp->port < 0) {
+ kfree(dp);
return 0;
+ }
debug_printk(("delete_port %i\n", dp->port));
return snd_seq_event_port_detach(dp->cseq, dp->port);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 057/260] sysfs: checking for NULL instead of ERR_PTR
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (55 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 056/260] ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open() Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 058/260] oprofile: fix crash when accessing freed task structs Paul Gortmaker
` (204 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, Greg Kroah-Hartman, Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit 57f9bdac2510cd7fda58e4a111d250861eb1ebeb upstream.
d_path() returns an ERR_PTR and it doesn't return NULL.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/sysfs/file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index e222b25..0831b88 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -340,7 +340,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
char *p;
p = d_path(&file->f_path, last_sysfs_file, sizeof(last_sysfs_file));
- if (p)
+ if (!IS_ERR(p))
memmove(last_sysfs_file, p, strlen(p) + 1);
/* need attr_sd for attr and ops, its parent for kobj */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 058/260] oprofile: fix crash when accessing freed task structs
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (56 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 057/260] sysfs: checking for NULL instead of ERR_PTR Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 059/260] oprofile, x86: fix init_sysfs error handling Paul Gortmaker
` (203 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Robert Richter, Paul Gortmaker
From: Robert Richter <robert.richter@amd.com>
commit 750d857c682f4db60d14722d430c7ccc35070962 upstream.
This patch fixes a crash during shutdown reported below. The crash is
caused by accessing already freed task structs. The fix changes the
order for registering and unregistering notifier callbacks.
All notifiers must be initialized before buffers start working. To
stop buffer synchronization we cancel all workqueues, unregister the
notifier callback and then flush all buffers. After all of this we
finally can free all tasks listed.
This should avoid accessing freed tasks.
On 22.07.10 01:14:40, Benjamin Herrenschmidt wrote:
> So the initial observation is a spinlock bad magic followed by a crash
> in the spinlock debug code:
>
> [ 1541.586531] BUG: spinlock bad magic on CPU#5, events/5/136
> [ 1541.597564] Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6b6d03
>
> Backtrace looks like:
>
> spin_bug+0x74/0xd4
> ._raw_spin_lock+0x48/0x184
> ._spin_lock+0x10/0x24
> .get_task_mm+0x28/0x8c
> .sync_buffer+0x1b4/0x598
> .wq_sync_buffer+0xa0/0xdc
> .worker_thread+0x1d8/0x2a8
> .kthread+0xa8/0xb4
> .kernel_thread+0x54/0x70
>
> So we are accessing a freed task struct in the work queue when
> processing the samples.
Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/oprofile/buffer_sync.c | 27 ++++++++++++++-------------
drivers/oprofile/cpu_buffer.c | 2 --
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index a9352b2..b7e755f 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -141,16 +141,6 @@ static struct notifier_block module_load_nb = {
.notifier_call = module_load_notify,
};
-
-static void end_sync(void)
-{
- end_cpu_work();
- /* make sure we don't leak task structs */
- process_task_mortuary();
- process_task_mortuary();
-}
-
-
int sync_start(void)
{
int err;
@@ -158,7 +148,7 @@ int sync_start(void)
if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL))
return -ENOMEM;
- start_cpu_work();
+ mutex_lock(&buffer_mutex);
err = task_handoff_register(&task_free_nb);
if (err)
@@ -173,7 +163,10 @@ int sync_start(void)
if (err)
goto out4;
+ start_cpu_work();
+
out:
+ mutex_unlock(&buffer_mutex);
return err;
out4:
profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
@@ -182,7 +175,6 @@ out3:
out2:
task_handoff_unregister(&task_free_nb);
out1:
- end_sync();
free_cpumask_var(marked_cpus);
goto out;
}
@@ -190,11 +182,20 @@ out1:
void sync_stop(void)
{
+ /* flush buffers */
+ mutex_lock(&buffer_mutex);
+ end_cpu_work();
unregister_module_notifier(&module_load_nb);
profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
task_handoff_unregister(&task_free_nb);
- end_sync();
+ mutex_unlock(&buffer_mutex);
+ flush_scheduled_work();
+
+ /* make sure we don't leak task structs */
+ process_task_mortuary();
+ process_task_mortuary();
+
free_cpumask_var(marked_cpus);
}
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index de82183..6931f1b 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -120,8 +120,6 @@ void end_cpu_work(void)
cancel_delayed_work(&b->work);
}
-
- flush_scheduled_work();
}
/*
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 059/260] oprofile, x86: fix init_sysfs error handling
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (57 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 058/260] oprofile: fix crash when accessing freed task structs Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 060/260] oprofile, x86: fix init_sysfs() function stub Paul Gortmaker
` (202 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Robert Richter, Paul Gortmaker
From: Robert Richter <robert.richter@amd.com>
commit 10f0412f57f2a76a90eff4376f59cbb0a39e4e18 upstream.
On failure init_sysfs() might not properly free resources. The error
code of the function is not checked. And, when reinitializing the exit
function might be called twice. This patch fixes all this.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/oprofile/nmi_int.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index c41ad50..41b7228 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -518,8 +518,13 @@ static int __init init_sysfs(void)
int error;
error = sysdev_class_register(&oprofile_sysclass);
- if (!error)
- error = sysdev_register(&device_oprofile);
+ if (error)
+ return error;
+
+ error = sysdev_register(&device_oprofile);
+ if (error)
+ sysdev_class_unregister(&oprofile_sysclass);
+
return error;
}
@@ -645,6 +650,8 @@ int __init op_nmi_init(struct oprofile_operations *ops)
char *cpu_type = NULL;
int ret = 0;
+ using_nmi = 0;
+
if (!cpu_has_apic)
return -ENODEV;
@@ -727,7 +734,10 @@ int __init op_nmi_init(struct oprofile_operations *ops)
mux_init(ops);
- init_sysfs();
+ ret = init_sysfs();
+ if (ret)
+ return ret;
+
using_nmi = 1;
printk(KERN_INFO "oprofile: using NMI interrupt.\n");
return 0;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 060/260] oprofile, x86: fix init_sysfs() function stub
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (58 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 059/260] oprofile, x86: fix init_sysfs error handling Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 061/260] libata: skip EH autopsy and recovery during suspend Paul Gortmaker
` (201 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Robert Richter, Paul Gortmaker
From: Robert Richter <robert.richter@amd.com>
commit 269f45c25028c75fe10e6d9be86e7202ab461fbc upstream.
The use of the return value of init_sysfs() with commit
10f0412 oprofile, x86: fix init_sysfs error handling
discovered the following build error for !CONFIG_PM:
.../linux/arch/x86/oprofile/nmi_int.c: In function ‘op_nmi_init’:
.../linux/arch/x86/oprofile/nmi_int.c:784: error: expected expression before ‘do’
make[2]: *** [arch/x86/oprofile/nmi_int.o] Error 1
make[1]: *** [arch/x86/oprofile] Error 2
This patch fixes this.
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/oprofile/nmi_int.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 41b7228..3130a4b 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -535,8 +535,10 @@ static void exit_sysfs(void)
}
#else
-#define init_sysfs() do { } while (0)
-#define exit_sysfs() do { } while (0)
+
+static inline int init_sysfs(void) { return 0; }
+static inline void exit_sysfs(void) { }
+
#endif /* CONFIG_PM */
static int __init p4_init(char **cpu_type)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 061/260] libata: skip EH autopsy and recovery during suspend
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (59 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 060/260] oprofile, x86: fix init_sysfs() function stub Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 062/260] tracing: Fix a race in function profile Paul Gortmaker
` (200 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Tejun Heo, Tejun Heo, Jeff Garzik, Paul Gortmaker
From: Tejun Heo <htejun@gmail.com>
commit e2f3d75fc0e4a0d03c61872bad39ffa2e74a04ff upstream.
For some mysterious reason, certain hardware reacts badly to usual EH
actions while the system is going for suspend. As the devices won't
be needed until the system is resumed, ask EH to skip usual autopsy
and recovery and proceed directly to suspend.
Signed-off-by: Tejun Heo <tj@kernel.org>
Tested-by: Stephan Diestelhorst <stephan.diestelhorst@amd.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/ata/libata-core.c | 14 +++++++++++++-
drivers/ata/libata-eh.c | 4 ++++
include/linux/libata.h | 1 +
3 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 5abab5d..5405b36 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5526,6 +5526,7 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg,
*/
int ata_host_suspend(struct ata_host *host, pm_message_t mesg)
{
+ unsigned int ehi_flags = ATA_EHI_QUIET;
int rc;
/*
@@ -5534,7 +5535,18 @@ int ata_host_suspend(struct ata_host *host, pm_message_t mesg)
*/
ata_lpm_enable(host);
- rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1);
+ /*
+ * On some hardware, device fails to respond after spun down
+ * for suspend. As the device won't be used before being
+ * resumed, we don't need to touch the device. Ask EH to skip
+ * the usual stuff and proceed directly to suspend.
+ *
+ * http://thread.gmane.org/gmane.linux.ide/46764
+ */
+ if (mesg.event == PM_EVENT_SUSPEND)
+ ehi_flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_NO_RECOVERY;
+
+ rc = ata_host_request_pm(host, mesg, 0, ehi_flags, 1);
if (rc == 0)
host->dev->power.power_state = mesg;
return rc;
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 228740f..1cf0bff 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -3234,6 +3234,10 @@ static int ata_eh_skip_recovery(struct ata_link *link)
if (link->flags & ATA_LFLAG_DISABLED)
return 1;
+ /* skip if explicitly requested */
+ if (ehc->i.flags & ATA_EHI_NO_RECOVERY)
+ return 1;
+
/* thaw frozen port and recover failed devices */
if ((ap->pflags & ATA_PFLAG_FROZEN) || ata_link_nr_enabled(link))
return 0;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b2f2003..79878c2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -340,6 +340,7 @@ enum {
ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */
ATA_EHI_QUIET = (1 << 3), /* be quiet */
+ ATA_EHI_NO_RECOVERY = (1 << 4), /* no recovery */
ATA_EHI_DID_SOFTRESET = (1 << 16), /* already soft-reset this port */
ATA_EHI_DID_HARDRESET = (1 << 17), /* already soft-reset this port */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 062/260] tracing: Fix a race in function profile
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (60 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 061/260] libata: skip EH autopsy and recovery during suspend Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 063/260] tracing: Do not allow llseek to set_ftrace_filter Paul Gortmaker
` (199 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Li Zefan, Steven Rostedt, Paul Gortmaker
From: Li Zefan <lizf@cn.fujitsu.com>
commit 3aaba20f26f58843e8f20611e5c0b1c06954310f upstream.
While we are reading trace_stat/functionX and someone just
disabled function_profile at that time, we can trigger this:
divide error: 0000 [#1] PREEMPT SMP
...
EIP is at function_stat_show+0x90/0x230
...
This fix just takes the ftrace_profile_lock and checks if
rec->counter is 0. If it's 0, we know the profile buffer
has been reset.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4C723644.4040708@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/trace/ftrace.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 2404b59..ed676ba 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -380,11 +380,18 @@ static int function_stat_show(struct seq_file *m, void *v)
{
struct ftrace_profile *rec = v;
char str[KSYM_SYMBOL_LEN];
+ int ret = 0;
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
- static DEFINE_MUTEX(mutex);
static struct trace_seq s;
unsigned long long avg;
#endif
+ mutex_lock(&ftrace_profile_lock);
+
+ /* we raced with function_profile_reset() */
+ if (unlikely(rec->counter == 0)) {
+ ret = -EBUSY;
+ goto out;
+ }
kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
seq_printf(m, " %-30.30s %10lu", str, rec->counter);
@@ -394,17 +401,17 @@ static int function_stat_show(struct seq_file *m, void *v)
avg = rec->time;
do_div(avg, rec->counter);
- mutex_lock(&mutex);
trace_seq_init(&s);
trace_print_graph_duration(rec->time, &s);
trace_seq_puts(&s, " ");
trace_print_graph_duration(avg, &s);
trace_print_seq(m, &s);
- mutex_unlock(&mutex);
#endif
seq_putc(m, '\n');
+out:
+ mutex_unlock(&ftrace_profile_lock);
- return 0;
+ return ret;
}
static void ftrace_profile_reset(struct ftrace_profile_stat *stat)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 063/260] tracing: Do not allow llseek to set_ftrace_filter
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (61 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 062/260] tracing: Fix a race in function profile Paul Gortmaker
@ 2011-01-02 7:15 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 064/260] tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread Paul Gortmaker
` (198 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:15 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Steven Rostedt, Chris Wright, Tavis Ormandy,
Eugene Teo, vendor-sec, Steven Rostedt, Paul Gortmaker
From: Steven Rostedt <srostedt@redhat.com>
commit 9c55cb12c1c172e2d51e85fbb5a4796ca86b77e7 upstream.
Reading the file set_ftrace_filter does three things.
1) shows whether or not filters are set for the function tracer
2) shows what functions are set for the function tracer
3) shows what triggers are set on any functions
3 is independent from 1 and 2.
The way this file currently works is that it is a state machine,
and as you read it, it may change state. But this assumption breaks
when you use lseek() on the file. The state machine gets out of sync
and the t_show() may use the wrong pointer and cause a kernel oops.
Luckily, this will only kill the app that does the lseek, but the app
dies while holding a mutex. This prevents anyone else from using the
set_ftrace_filter file (or any other function tracing file for that matter).
A real fix for this is to rewrite the code, but that is too much for
a -rc release or stable. This patch simply disables llseek on the
set_ftrace_filter() file for now, and we can do the proper fix for the
next major release.
Reported-by: Robert Swiecki <swiecki@google.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Tavis Ormandy <taviso@google.com>
Cc: Eugene Teo <eugene@redhat.com>
Cc: vendor-sec@lst.de
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/trace/ftrace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index ed676ba..7d51cab 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2395,7 +2395,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 = no_llseek,
.release = ftrace_filter_release,
};
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 064/260] tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (62 preceding siblings ...)
2011-01-02 7:15 ` [34-longterm 063/260] tracing: Do not allow llseek to set_ftrace_filter Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 065/260] irda: off by one Paul Gortmaker
` (197 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Chris Wright, Robert Swiecki, Eugene Teo,
Steven Rostedt, Paul Gortmaker
From: Chris Wright <chrisw@sous-sol.org>
commit df09162550fbb53354f0c88e85b5d0e6129ee9cc upstream.
Be sure to avoid entering t_show() with FTRACE_ITER_HASH set without
having properly started the iterator to iterate the hash. This case is
degenerate and, as discovered by Robert Swiecki, can cause t_hash_show()
to misuse a pointer. This causes a NULL ptr deref with possible security
implications. Tracked as CVE-2010-3079.
Cc: Robert Swiecki <swiecki@google.com>
Cc: Eugene Teo <eugene@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/trace/ftrace.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 7d51cab..73dedb3 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1488,6 +1488,8 @@ static void *t_start(struct seq_file *m, loff_t *pos)
if (*pos > 0)
return t_hash_start(m, pos);
iter->flags |= FTRACE_ITER_PRINTALL;
+ /* reset in case of seek/pread */
+ iter->flags &= ~FTRACE_ITER_HASH;
return iter;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 065/260] irda: off by one
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (63 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 064/260] tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 066/260] gcov: fix null-pointer dereference for certain module types Paul Gortmaker
` (196 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, David S. Miller, Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit cf9b94f88bdbe8a02015fc30d7c232b2d262d4ad upstream.
This is an off by one. We would go past the end when we NUL terminate
the "value" string at end of the function. The "value" buffer is
allocated in irlan_client_parse_response() or
irlan_provider_parse_command().
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/irda/irlan/irlan_common.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index a788f9e..6130f9d 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -1102,7 +1102,7 @@ int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len)
memcpy(&val_len, buf+n, 2); /* To avoid alignment problems */
le16_to_cpus(&val_len); n+=2;
- if (val_len > 1016) {
+ if (val_len >= 1016) {
IRDA_DEBUG(2, "%s(), parameter length to long\n", __func__ );
return -RSP_INVALID_COMMAND_FORMAT;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 066/260] gcov: fix null-pointer dereference for certain module types
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (64 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 065/260] irda: off by one Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 067/260] tmio_mmc: don't clear unhandled pending interrupts Paul Gortmaker
` (195 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Peter Oberparleiter, Andrew Morton, Linus Torvalds,
Paul Gortmaker
From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
commit 85a0fdfd0f967507f3903e8419bc7e408f5a59de upstream.
The gcov-kernel infrastructure expects that each object file is loaded
only once. This may not be true, e.g. when loading multiple kernel
modules which are linked to the same object file. As a result, loading
such kernel modules will result in incorrect gcov results while unloading
will cause a null-pointer dereference.
This patch fixes these problems by changing the gcov-kernel infrastructure
so that multiple profiling data sets can be associated with one debugfs
entry. It applies to 2.6.36-rc1.
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Reported-by: Werner Spies <werner.spies@thalesgroup.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/gcov/fs.c | 244 ++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 180 insertions(+), 64 deletions(-)
diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
index ef3c3f8..f83972b 100644
--- a/kernel/gcov/fs.c
+++ b/kernel/gcov/fs.c
@@ -33,10 +33,11 @@
* @children: child nodes
* @all: list head for list of all nodes
* @parent: parent node
- * @info: associated profiling data structure if not a directory
- * @ghost: when an object file containing profiling data is unloaded we keep a
- * copy of the profiling data here to allow collecting coverage data
- * for cleanup code. Such a node is called a "ghost".
+ * @loaded_info: array of pointers to profiling data sets for loaded object
+ * files.
+ * @num_loaded: number of profiling data sets for loaded object files.
+ * @unloaded_info: accumulated copy of profiling data sets for unloaded
+ * object files. Used only when gcov_persist=1.
* @dentry: main debugfs entry, either a directory or data file
* @links: associated symbolic links
* @name: data file basename
@@ -51,10 +52,11 @@ struct gcov_node {
struct list_head children;
struct list_head all;
struct gcov_node *parent;
- struct gcov_info *info;
- struct gcov_info *ghost;
+ struct gcov_info **loaded_info;
+ struct gcov_info *unloaded_info;
struct dentry *dentry;
struct dentry **links;
+ int num_loaded;
char name[0];
};
@@ -136,16 +138,37 @@ static const struct seq_operations gcov_seq_ops = {
};
/*
- * Return the profiling data set for a given node. This can either be the
- * original profiling data structure or a duplicate (also called "ghost")
- * in case the associated object file has been unloaded.
+ * Return a profiling data set associated with the given node. This is
+ * either a data set for a loaded object file or a data set copy in case
+ * all associated object files have been unloaded.
*/
static struct gcov_info *get_node_info(struct gcov_node *node)
{
- if (node->info)
- return node->info;
+ if (node->num_loaded > 0)
+ return node->loaded_info[0];
- return node->ghost;
+ return node->unloaded_info;
+}
+
+/*
+ * Return a newly allocated profiling data set which contains the sum of
+ * all profiling data associated with the given node.
+ */
+static struct gcov_info *get_accumulated_info(struct gcov_node *node)
+{
+ struct gcov_info *info;
+ int i = 0;
+
+ if (node->unloaded_info)
+ info = gcov_info_dup(node->unloaded_info);
+ else
+ info = gcov_info_dup(node->loaded_info[i++]);
+ if (!info)
+ return NULL;
+ for (; i < node->num_loaded; i++)
+ gcov_info_add(info, node->loaded_info[i]);
+
+ return info;
}
/*
@@ -163,9 +186,10 @@ static int gcov_seq_open(struct inode *inode, struct file *file)
mutex_lock(&node_lock);
/*
* Read from a profiling data copy to minimize reference tracking
- * complexity and concurrent access.
+ * complexity and concurrent access and to keep accumulating multiple
+ * profiling data sets associated with one node simple.
*/
- info = gcov_info_dup(get_node_info(node));
+ info = get_accumulated_info(node);
if (!info)
goto out_unlock;
iter = gcov_iter_new(info);
@@ -225,12 +249,25 @@ static struct gcov_node *get_node_by_name(const char *name)
return NULL;
}
+/*
+ * Reset all profiling data associated with the specified node.
+ */
+static void reset_node(struct gcov_node *node)
+{
+ int i;
+
+ if (node->unloaded_info)
+ gcov_info_reset(node->unloaded_info);
+ for (i = 0; i < node->num_loaded; i++)
+ gcov_info_reset(node->loaded_info[i]);
+}
+
static void remove_node(struct gcov_node *node);
/*
* write() implementation for gcov data files. Reset profiling data for the
- * associated file. If the object file has been unloaded (i.e. this is
- * a "ghost" node), remove the debug fs node as well.
+ * corresponding file. If all associated object files have been unloaded,
+ * remove the debug fs node as well.
*/
static ssize_t gcov_seq_write(struct file *file, const char __user *addr,
size_t len, loff_t *pos)
@@ -245,10 +282,10 @@ static ssize_t gcov_seq_write(struct file *file, const char __user *addr,
node = get_node_by_name(info->filename);
if (node) {
/* Reset counts or remove node for unloaded modules. */
- if (node->ghost)
+ if (node->num_loaded == 0)
remove_node(node);
else
- gcov_info_reset(node->info);
+ reset_node(node);
}
/* Reset counts for open file. */
gcov_info_reset(info);
@@ -378,7 +415,10 @@ static void init_node(struct gcov_node *node, struct gcov_info *info,
INIT_LIST_HEAD(&node->list);
INIT_LIST_HEAD(&node->children);
INIT_LIST_HEAD(&node->all);
- node->info = info;
+ if (node->loaded_info) {
+ node->loaded_info[0] = info;
+ node->num_loaded = 1;
+ }
node->parent = parent;
if (name)
strcpy(node->name, name);
@@ -394,9 +434,13 @@ static struct gcov_node *new_node(struct gcov_node *parent,
struct gcov_node *node;
node = kzalloc(sizeof(struct gcov_node) + strlen(name) + 1, GFP_KERNEL);
- if (!node) {
- pr_warning("out of memory\n");
- return NULL;
+ if (!node)
+ goto err_nomem;
+ if (info) {
+ node->loaded_info = kcalloc(1, sizeof(struct gcov_info *),
+ GFP_KERNEL);
+ if (!node->loaded_info)
+ goto err_nomem;
}
init_node(node, info, name, parent);
/* Differentiate between gcov data file nodes and directory nodes. */
@@ -416,6 +460,11 @@ static struct gcov_node *new_node(struct gcov_node *parent,
list_add(&node->all, &all_head);
return node;
+
+err_nomem:
+ kfree(node);
+ pr_warning("out of memory\n");
+ return NULL;
}
/* Remove symbolic links associated with node. */
@@ -441,8 +490,9 @@ static void release_node(struct gcov_node *node)
list_del(&node->all);
debugfs_remove(node->dentry);
remove_links(node);
- if (node->ghost)
- gcov_info_free(node->ghost);
+ kfree(node->loaded_info);
+ if (node->unloaded_info)
+ gcov_info_free(node->unloaded_info);
kfree(node);
}
@@ -477,7 +527,7 @@ static struct gcov_node *get_child_by_name(struct gcov_node *parent,
/*
* write() implementation for reset file. Reset all profiling data to zero
- * and remove ghost nodes.
+ * and remove nodes for which all associated object files are unloaded.
*/
static ssize_t reset_write(struct file *file, const char __user *addr,
size_t len, loff_t *pos)
@@ -487,8 +537,8 @@ static ssize_t reset_write(struct file *file, const char __user *addr,
mutex_lock(&node_lock);
restart:
list_for_each_entry(node, &all_head, all) {
- if (node->info)
- gcov_info_reset(node->info);
+ if (node->num_loaded > 0)
+ reset_node(node);
else if (list_empty(&node->children)) {
remove_node(node);
/* Several nodes may have gone - restart loop. */
@@ -564,37 +614,115 @@ err_remove:
}
/*
- * The profiling data set associated with this node is being unloaded. Store a
- * copy of the profiling data and turn this node into a "ghost".
+ * Associate a profiling data set with an existing node. Needs to be called
+ * with node_lock held.
*/
-static int ghost_node(struct gcov_node *node)
+static void add_info(struct gcov_node *node, struct gcov_info *info)
{
- node->ghost = gcov_info_dup(node->info);
- if (!node->ghost) {
- pr_warning("could not save data for '%s' (out of memory)\n",
- node->info->filename);
- return -ENOMEM;
+ struct gcov_info **loaded_info;
+ int num = node->num_loaded;
+
+ /*
+ * Prepare new array. This is done first to simplify cleanup in
+ * case the new data set is incompatible, the node only contains
+ * unloaded data sets and there's not enough memory for the array.
+ */
+ loaded_info = kcalloc(num + 1, sizeof(struct gcov_info *), GFP_KERNEL);
+ if (!loaded_info) {
+ pr_warning("could not add '%s' (out of memory)\n",
+ info->filename);
+ return;
+ }
+ memcpy(loaded_info, node->loaded_info,
+ num * sizeof(struct gcov_info *));
+ loaded_info[num] = info;
+ /* Check if the new data set is compatible. */
+ if (num == 0) {
+ /*
+ * A module was unloaded, modified and reloaded. The new
+ * data set replaces the copy of the last one.
+ */
+ if (!gcov_info_is_compatible(node->unloaded_info, info)) {
+ pr_warning("discarding saved data for %s "
+ "(incompatible version)\n", info->filename);
+ gcov_info_free(node->unloaded_info);
+ node->unloaded_info = NULL;
+ }
+ } else {
+ /*
+ * Two different versions of the same object file are loaded.
+ * The initial one takes precedence.
+ */
+ if (!gcov_info_is_compatible(node->loaded_info[0], info)) {
+ pr_warning("could not add '%s' (incompatible "
+ "version)\n", info->filename);
+ kfree(loaded_info);
+ return;
+ }
}
- node->info = NULL;
+ /* Overwrite previous array. */
+ kfree(node->loaded_info);
+ node->loaded_info = loaded_info;
+ node->num_loaded = num + 1;
+}
- return 0;
+/*
+ * Return the index of a profiling data set associated with a node.
+ */
+static int get_info_index(struct gcov_node *node, struct gcov_info *info)
+{
+ int i;
+
+ for (i = 0; i < node->num_loaded; i++) {
+ if (node->loaded_info[i] == info)
+ return i;
+ }
+ return -ENOENT;
}
/*
- * Profiling data for this node has been loaded again. Add profiling data
- * from previous instantiation and turn this node into a regular node.
+ * Save the data of a profiling data set which is being unloaded.
*/
-static void revive_node(struct gcov_node *node, struct gcov_info *info)
+static void save_info(struct gcov_node *node, struct gcov_info *info)
{
- if (gcov_info_is_compatible(node->ghost, info))
- gcov_info_add(info, node->ghost);
+ if (node->unloaded_info)
+ gcov_info_add(node->unloaded_info, info);
else {
- pr_warning("discarding saved data for '%s' (version changed)\n",
+ node->unloaded_info = gcov_info_dup(info);
+ if (!node->unloaded_info) {
+ pr_warning("could not save data for '%s' "
+ "(out of memory)\n", info->filename);
+ }
+ }
+}
+
+/*
+ * Disassociate a profiling data set from a node. Needs to be called with
+ * node_lock held.
+ */
+static void remove_info(struct gcov_node *node, struct gcov_info *info)
+{
+ int i;
+
+ i = get_info_index(node, info);
+ if (i < 0) {
+ pr_warning("could not remove '%s' (not found)\n",
info->filename);
+ return;
}
- gcov_info_free(node->ghost);
- node->ghost = NULL;
- node->info = info;
+ if (gcov_persist)
+ save_info(node, info);
+ /* Shrink array. */
+ node->loaded_info[i] = node->loaded_info[node->num_loaded - 1];
+ node->num_loaded--;
+ if (node->num_loaded > 0)
+ return;
+ /* Last loaded data set was removed. */
+ kfree(node->loaded_info);
+ node->loaded_info = NULL;
+ node->num_loaded = 0;
+ if (!node->unloaded_info)
+ remove_node(node);
}
/*
@@ -609,30 +737,18 @@ void gcov_event(enum gcov_action action, struct gcov_info *info)
node = get_node_by_name(info->filename);
switch (action) {
case GCOV_ADD:
- /* Add new node or revive ghost. */
- if (!node) {
+ if (node)
+ add_info(node, info);
+ else
add_node(info);
- break;
- }
- if (gcov_persist)
- revive_node(node, info);
- else {
- pr_warning("could not add '%s' (already exists)\n",
- info->filename);
- }
break;
case GCOV_REMOVE:
- /* Remove node or turn into ghost. */
- if (!node) {
+ if (node)
+ remove_info(node, info);
+ else {
pr_warning("could not remove '%s' (not found)\n",
info->filename);
- break;
}
- if (gcov_persist) {
- if (!ghost_node(node))
- break;
- }
- remove_node(node);
break;
}
mutex_unlock(&node_lock);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 067/260] tmio_mmc: don't clear unhandled pending interrupts
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (65 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 066/260] gcov: fix null-pointer dereference for certain module types Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 068/260] mmc: fix the use of kunmap_atomic() in tmio_mmc.h Paul Gortmaker
` (194 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Yusuke Goda, Matt Fleming, Samuel Ortiz,
Paul Mundt, linux-mmc, Andrew Morton, Linus Torvalds,
Paul Gortmaker
From: Yusuke Goda <yusuke.goda.sx@renesas.com>
commit b78d6c5f51935ba89df8db33a57bacb547aa7325 upstream.
Previously, it was possible for ack_mmc_irqs() to clear pending interrupt
bits in the CTL_STATUS register, even though the interrupt handler had not
been called. This was because of a race that existed when doing a
read-modify-write sequence on CTL_STATUS. After the read step in this
sequence, if an interrupt occurred (causing one of the bits in CTL_STATUS
to be set) the write step would inadvertently clear it.
Observed with the TMIO_STAT_RXRDY bit together with CMD53 on AR6002 and
BCM4318 SDIO cards in polled mode.
This patch eliminates this race by only writing to CTL_STATUS and clearing
the interrupts that were passed as an argument to ack_mmc_irqs()."
[matt@console-pimps.org: rewrote changelog]
Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>"
Tested-by: Arnd Hannemann <arnd@arndnet.de>"
Acked-by: Ian Molton <ian@mnementh.co.uk>
Cc: Matt Fleming <matt@console-pimps.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/mmc/host/tmio_mmc.h | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index dafecfb..1836ed9 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -80,10 +80,7 @@
#define ack_mmc_irqs(host, i) \
do { \
- u32 mask;\
- mask = sd_ctrl_read32((host), CTL_STATUS); \
- mask &= ~((i) & TMIO_MASK_IRQ); \
- sd_ctrl_write32((host), CTL_STATUS, mask); \
+ sd_ctrl_write32((host), CTL_STATUS, ~(i)); \
} while (0)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 068/260] mmc: fix the use of kunmap_atomic() in tmio_mmc.h
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (66 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 067/260] tmio_mmc: don't clear unhandled pending interrupts Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 069/260] bounce: call flush_dcache_page() after bounce_copy_vec() Paul Gortmaker
` (193 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Guennadi Liakhovetski, Andrew Morton,
Linus Torvalds, Paul Gortmaker
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
commit 5600efb1bc2745d93ae0bc08130117a84f2b9d69 upstream.
kunmap_atomic() takes the cookie, returned by the kmap_atomic() as its
argument and not the page address, used as an argument to kmap_atomic().
This patch fixes the compile error:
In file included from drivers/mmc/host/tmio_mmc.c:37:
drivers/mmc/host/tmio_mmc.h: In function 'tmio_mmc_kunmap_atomic':
drivers/mmc/host/tmio_mmc.h:192: error: negative width in bit-field '<anonymous>'
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Tested-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/mmc/host/tmio_mmc.c | 7 ++++---
drivers/mmc/host/tmio_mmc.h | 8 +++-----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index b2b577f..73f8ba7 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -163,6 +163,7 @@ tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
static inline void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
{
struct mmc_data *data = host->data;
+ void *sg_virt;
unsigned short *buf;
unsigned int count;
unsigned long flags;
@@ -172,8 +173,8 @@ static inline void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
return;
}
- buf = (unsigned short *)(tmio_mmc_kmap_atomic(host, &flags) +
- host->sg_off);
+ sg_virt = tmio_mmc_kmap_atomic(host->sg_ptr, &flags);
+ buf = (unsigned short *)(sg_virt + host->sg_off);
count = host->sg_ptr->length - host->sg_off;
if (count > data->blksz)
@@ -190,7 +191,7 @@ static inline void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
host->sg_off += count;
- tmio_mmc_kunmap_atomic(host, &flags);
+ tmio_mmc_kunmap_atomic(sg_virt, &flags);
if (host->sg_off == host->sg_ptr->length)
tmio_mmc_next_sg(host);
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 1836ed9..87b3517 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -161,19 +161,17 @@ static inline int tmio_mmc_next_sg(struct tmio_mmc_host *host)
return --host->sg_len;
}
-static inline char *tmio_mmc_kmap_atomic(struct tmio_mmc_host *host,
+static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg,
unsigned long *flags)
{
- struct scatterlist *sg = host->sg_ptr;
-
local_irq_save(*flags);
return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset;
}
-static inline void tmio_mmc_kunmap_atomic(struct tmio_mmc_host *host,
+static inline void tmio_mmc_kunmap_atomic(void *virt,
unsigned long *flags)
{
- kunmap_atomic(sg_page(host->sg_ptr), KM_BIO_SRC_IRQ);
+ kunmap_atomic(virt, KM_BIO_SRC_IRQ);
local_irq_restore(*flags);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 069/260] bounce: call flush_dcache_page() after bounce_copy_vec()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (67 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 068/260] mmc: fix the use of kunmap_atomic() in tmio_mmc.h Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 070/260] kernel/groups.c: fix integer overflow in groups_search Paul Gortmaker
` (192 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Gary King, Tejun Heo, Russell King, Andrew Morton,
Linus Torvalds, Paul Gortmaker
From: Gary King <gking@nvidia.com>
commit ac8456d6f9a3011c824176bd6084d39e5f70a382 upstream.
I have been seeing problems on Tegra 2 (ARMv7 SMP) systems with HIGHMEM
enabled on 2.6.35 (plus some patches targetted at 2.6.36 to perform cache
maintenance lazily), and the root cause appears to be that the mm bouncing
code is calling flush_dcache_page before it copies the bounce buffer into
the bio.
The bounced page needs to be flushed after data is copied into it, to
ensure that architecture implementations can synchronize instruction and
data caches if necessary.
Signed-off-by: Gary King <gking@nvidia.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Acked-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/bounce.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/bounce.c b/mm/bounce.c
index 13b6dad..1481de6 100644
--- a/mm/bounce.c
+++ b/mm/bounce.c
@@ -116,8 +116,8 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from)
*/
vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
- flush_dcache_page(tovec->bv_page);
bounce_copy_vec(tovec, vfrom);
+ flush_dcache_page(tovec->bv_page);
}
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 070/260] kernel/groups.c: fix integer overflow in groups_search
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (68 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 069/260] bounce: call flush_dcache_page() after bounce_copy_vec() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 071/260] binfmt_misc: fix binfmt_misc priority Paul Gortmaker
` (191 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jerome Marchand, Andrew Morton, Linus Torvalds,
Paul Gortmaker
From: Jerome Marchand <jmarchan@redhat.com>
commit 1c24de60e50fb19b94d94225458da17c720f0729 upstream.
gid_t is a unsigned int. If group_info contains a gid greater than
MAX_INT, groups_search() function may look on the wrong side of the search
tree.
This solves some unfair "permission denied" problems.
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/groups.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/groups.c b/kernel/groups.c
index 2b45b2e..f0c2528 100644
--- a/kernel/groups.c
+++ b/kernel/groups.c
@@ -143,10 +143,9 @@ int groups_search(const struct group_info *group_info, gid_t grp)
right = group_info->ngroups;
while (left < right) {
unsigned int mid = (left+right)/2;
- int cmp = grp - GROUP_AT(group_info, mid);
- if (cmp > 0)
+ if (grp > GROUP_AT(group_info, mid))
left = mid + 1;
- else if (cmp < 0)
+ else if (grp < GROUP_AT(group_info, mid))
right = mid;
else
return 1;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 071/260] binfmt_misc: fix binfmt_misc priority
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (69 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 070/260] kernel/groups.c: fix integer overflow in groups_search Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 072/260] Input: i8042 - fix device removal on unload Paul Gortmaker
` (190 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jan Sembera, Ivan Kokshaysky, Al Viro,
Richard Henderson, Andrew Morton, Linus Torvalds, Paul Gortmaker
From: Jan Sembera <jsembera@suse.cz>
commit ee3aebdd8f5f8eac41c25c80ceee3d728f920f3b upstream.
Commit 74641f584da ("alpha: binfmt_aout fix") (May 2009) introduced a
regression - binfmt_misc is now consulted after binfmt_elf, which will
unfortunately break ia32el. ia32 ELF binaries on ia64 used to be matched
using binfmt_misc and executed using wrapper. As 32bit binaries are now
matched by binfmt_elf before bindmt_misc kicks in, the wrapper is ignored.
The fix increases precedence of binfmt_misc to the original state.
Signed-off-by: Jan Sembera <jsembera@suse.cz>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Richard Henderson <rth@twiddle.net
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/binfmt_misc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index c4e8353..42b60b0 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -723,7 +723,7 @@ static int __init init_misc_binfmt(void)
{
int err = register_filesystem(&bm_fs_type);
if (!err) {
- err = register_binfmt(&misc_format);
+ err = insert_binfmt(&misc_format);
if (err)
unregister_filesystem(&bm_fs_type);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 072/260] Input: i8042 - fix device removal on unload
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (70 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 071/260] binfmt_misc: fix binfmt_misc priority Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 073/260] memory hotplug: fix next block calculation in is_removable Paul Gortmaker
` (189 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Torokhov, Dmitry Torokhov, Paul Gortmaker
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
commit af045b86662f17bf130239a65995c61a34f00a6b upstream.
We need to call platform_device_unregister(i8042_platform_device)
before calling platform_driver_unregister() because i8042_remove()
resets i8042_platform_device to NULL. This leaves the platform device
instance behind and prevents driver reload.
Fixes https://bugzilla.kernel.org/show_bug.cgi?id=16613
Reported-by: Seryodkin Victor <vvscore@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/input/serio/i8042.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 6440a8f..f3c2bb7 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1483,8 +1483,8 @@ static int __init i8042_init(void)
static void __exit i8042_exit(void)
{
- platform_driver_unregister(&i8042_driver);
platform_device_unregister(i8042_platform_device);
+ platform_driver_unregister(&i8042_driver);
i8042_platform_exit();
panic_blink = NULL;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 073/260] memory hotplug: fix next block calculation in is_removable
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (71 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 072/260] Input: i8042 - fix device removal on unload Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 074/260] perf: Initialize callchains roots's childen hits Paul Gortmaker
` (188 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, KAMEZAWA Hiroyuki, Michal Hocko, Wu Fengguang,
Mel Gorman, Andrew Morton, Linus Torvalds, Paul Gortmaker
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
commit 0dcc48c15f63ee86c2fcd33968b08d651f0360a5 upstream.
next_active_pageblock() is for finding next _used_ freeblock. It skips
several blocks when it finds there are a chunk of free pages lager than
pageblock. But it has 2 bugs.
1. We have no lock. page_order(page) - pageblock_order can be minus.
2. pageblocks_stride += is wrong. it should skip page_order(p) of pages.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/memory_hotplug.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index be211a5..91f7c26 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -558,19 +558,19 @@ static inline int pageblock_free(struct page *page)
/* Return the start of the next active pageblock after a given page */
static struct page *next_active_pageblock(struct page *page)
{
- int pageblocks_stride;
-
/* Ensure the starting page is pageblock-aligned */
BUG_ON(page_to_pfn(page) & (pageblock_nr_pages - 1));
- /* Move forward by at least 1 * pageblock_nr_pages */
- pageblocks_stride = 1;
-
/* If the entire pageblock is free, move to the end of free page */
- if (pageblock_free(page))
- pageblocks_stride += page_order(page) - pageblock_order;
+ if (pageblock_free(page)) {
+ int order;
+ /* be careful. we don't have locks, page_order can be changed.*/
+ order = page_order(page);
+ if ((order < MAX_ORDER) && (order >= pageblock_order))
+ return page + (1 << order);
+ }
- return page + (pageblocks_stride * pageblock_nr_pages);
+ return page + pageblock_nr_pages;
}
/* Checks if this range of memory is likely to be hot-removable. */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 074/260] perf: Initialize callchains roots's childen hits
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (72 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 073/260] memory hotplug: fix next block calculation in is_removable Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 075/260] p54: fix tx feedback status flag check Paul Gortmaker
` (187 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Frederic Weisbecker, Ingo Molnar, Peter Zijlstra,
Arnaldo Carvalho de Melo, Paul Mackerras, Paul Gortmaker
From: Frederic Weisbecker <fweisbec@gmail.com>
commit 5225c45899e872383ca39f5533d28ec63c54b39e upstream.
Each histogram entry has a callchain root that stores the
callchain samples. However we forgot to initialize the
tracking of children hits of these roots, which then got
random values on their creation.
The root children hits is multiplied by the minimum percentage
of hits provided by the user, and the result becomes the minimum
hits expected from children branches. If the random value due
to the uninitialization is big enough, then this minimum number
of hits can be huge and eventually filter every children branches.
The end result was invisible callchains. All we need to
fix this is to initialize the children hits of the root.
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
tools/perf/util/callchain.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 1b7a389..1121303 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -49,6 +49,7 @@ static inline void callchain_init(struct callchain_node *node)
INIT_LIST_HEAD(&node->children);
INIT_LIST_HEAD(&node->val);
+ node->children_hit = 0;
node->parent = NULL;
node->hit = 0;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 075/260] p54: fix tx feedback status flag check
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (73 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 074/260] perf: Initialize callchains roots's childen hits Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 076/260] ath5k: check return value of ieee80211_get_tx_rate Paul Gortmaker
` (186 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Christian Lamparter, John W. Linville,
Paul Gortmaker
From: Christian Lamparter <chunkeey@googlemail.com>
commit f880c2050f30b23c9b6f80028c09f76e693bf309 upstream.
Michael reported that p54* never really entered power
save mode, even tough it was enabled.
It turned out that upon a power save mode change the
firmware will set a special flag onto the last outgoing
frame tx status (which in this case is almost always the
designated PSM nullfunc frame). This flag confused the
driver; It erroneously reported transmission failures
to the stack, which then generated the next nullfunc.
and so on...
Reported-by: Michael Buesch <mb@bu3sch.de>
Tested-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/wireless/p54/txrx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 6605799..7398c98 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -445,7 +445,7 @@ static void p54_rx_frame_sent(struct p54_common *priv, struct sk_buff *skb)
}
if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
- (!payload->status))
+ !(payload->status & P54_TX_FAILED))
info->flags |= IEEE80211_TX_STAT_ACK;
if (payload->status & P54_TX_PSM_CANCELLED)
info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 076/260] ath5k: check return value of ieee80211_get_tx_rate
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (74 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 075/260] p54: fix tx feedback status flag check Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 077/260] wireless extensions: fix kernel heap content leak Paul Gortmaker
` (185 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, John W. Linville, Paul Gortmaker
From: John W. Linville <linville@tuxdriver.com>
commit d8e1ba76d619dbc0be8fbeee4e6c683b5c812d3a upstream.
This avoids a NULL pointer dereference as reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=625889
When the WARN condition is hit in ieee80211_get_tx_rate, it will return
NULL. So, we need to check the return value and avoid dereferencing it
in that case.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/wireless/ath/ath5k/base.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index db84169..61023e9 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1316,6 +1316,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
PCI_DMA_TODEVICE);
rate = ieee80211_get_tx_rate(sc->hw, info);
+ if (!rate) {
+ ret = -EINVAL;
+ goto err_unmap;
+ }
if (info->flags & IEEE80211_TX_CTL_NO_ACK)
flags |= AR5K_TXDESC_NOACK;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 077/260] wireless extensions: fix kernel heap content leak
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (75 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 076/260] ath5k: check return value of ieee80211_get_tx_rate Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 078/260] x86, tsc: Fix a preemption leak in restore_sched_clock_state() Paul Gortmaker
` (184 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Johannes Berg, John W. Linville, Paul Gortmaker
From: Johannes Berg <johannes.berg@intel.com>
commit 42da2f948d949efd0111309f5827bf0298bcc9a4 upstream.
Wireless extensions have an unfortunate, undocumented
requirement which requires drivers to always fill
iwp->length when returning a successful status. When
a driver doesn't do this, it leads to a kernel heap
content leak when userspace offers a larger buffer
than would have been necessary.
Arguably, this is a driver bug, as it should, if it
returns 0, fill iwp->length, even if it separately
indicated that the buffer contents was not valid.
However, we can also at least avoid the memory content
leak if the driver doesn't do this by setting the iwp
length to max_tokens, which then reflects how big the
buffer is that the driver may fill, regardless of how
big the userspace buffer is.
To illustrate the point, this patch also fixes a
corresponding cfg80211 bug (since this requirement
isn't documented nor was ever pointed out by anyone
during code review, I don't trust all drivers nor
all cfg80211 handlers to implement it correctly).
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/wireless/wext-compat.c | 3 +++
net/wireless/wext-core.c | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index a60a277..68202f9 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -1415,6 +1415,9 @@ int cfg80211_wext_giwessid(struct net_device *dev,
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
+ data->flags = 0;
+ data->length = 0;
+
switch (wdev->iftype) {
case NL80211_IFTYPE_ADHOC:
return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
index 4f5a470..f916f5a 100644
--- a/net/wireless/wext-core.c
+++ b/net/wireless/wext-core.c
@@ -782,6 +782,22 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
}
}
+ if (IW_IS_GET(cmd) && !(descr->flags & IW_DESCR_FLAG_NOMAX)) {
+ /*
+ * If this is a GET, but not NOMAX, it means that the extra
+ * data is not bounded by userspace, but by max_tokens. Thus
+ * set the length to max_tokens. This matches the extra data
+ * allocation.
+ * The driver should fill it with the number of tokens it
+ * provided, and it may check iwp->length rather than having
+ * knowledge of max_tokens. If the driver doesn't change the
+ * iwp->length, this ioctl just copies back max_token tokens
+ * filled with zeroes. Hopefully the driver isn't claiming
+ * them to be valid data.
+ */
+ iwp->length = descr->max_tokens;
+ }
+
err = handler(dev, info, (union iwreq_data *) iwp, extra);
iwp->length += essid_compat;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 078/260] x86, tsc: Fix a preemption leak in restore_sched_clock_state()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (76 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 077/260] wireless extensions: fix kernel heap content leak Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 10:17 ` 2.6.37-rc7: screen black after several suspends Nico Schottelius
2011-01-02 7:16 ` [34-longterm 079/260] x86-64, compat: Test %rax for the syscall number, not %eax Paul Gortmaker
` (183 subsequent siblings)
261 siblings, 1 reply; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Peter Zijlstra, Peter Zijlstra, Rafael J. Wysocki,
Nico Schottelius, Jesse Barnes, Linus Torvalds, Florian Pritz,
Suresh Siddha, Len Brown, Ingo Molnar, Paul Gortmaker
From: Peter Zijlstra <peterz@infradead.org>
commit 55496c896b8a695140045099d4e0175cf09d4eae upstream.
Doh, a real life genuine preemption leak..
This caused a suspend failure.
Reported-bisected-and-tested-by-the-invaluable: Jeff Chua <jeff.chua.linux@gmail.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Nico Schottelius <nico-linux-20100709@schottelius.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Florian Pritz <flo@xssn.at>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Len Brown <lenb@kernel.org>
sleep states
LKML-Reference: <1284150773.402.122.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/tsc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index c65f741..4094ae0 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -655,7 +655,7 @@ void restore_sched_clock_state(void)
local_irq_save(flags);
- get_cpu_var(cyc2ns_offset) = 0;
+ __get_cpu_var(cyc2ns_offset) = 0;
offset = cyc2ns_suspend - sched_clock();
for_each_possible_cpu(cpu)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 079/260] x86-64, compat: Test %rax for the syscall number, not %eax
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (77 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 078/260] x86, tsc: Fix a preemption leak in restore_sched_clock_state() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 080/260] compat: Make compat_alloc_user_space() incorporate the access_ok() Paul Gortmaker
` (182 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, H. Peter Anvin, Roland McGrath, Andrew Morton,
Paul Gortmaker
From: H. Peter Anvin <hpa@linux.intel.com>
commit 36d001c70d8a0144ac1d038f6876c484849a74de upstream.
On 64 bits, we always, by necessity, jump through the system call
table via %rax. For 32-bit system calls, in theory the system call
number is stored in %eax, and the code was testing %eax for a valid
system call number. At one point we loaded the stored value back from
the stack to enforce zero-extension, but that was removed in checkin
d4d67150165df8bf1cc05e532f6efca96f907cab. An actual 32-bit process
will not be able to introduce a non-zero-extended number, but it can
happen via ptrace.
Instead of re-introducing the zero-extension, test what we are
actually going to use, i.e. %rax. This only adds a handful of REX
prefixes to the code.
Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/ia32/ia32entry.S | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index e790bc1..944e3fc 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -153,7 +153,7 @@ ENTRY(ia32_sysenter_target)
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
CFI_REMEMBER_STATE
jnz sysenter_tracesys
- cmpl $(IA32_NR_syscalls-1),%eax
+ cmpq $(IA32_NR_syscalls-1),%rax
ja ia32_badsys
sysenter_do_call:
IA32_ARG_FIXUP
@@ -195,7 +195,7 @@ sysexit_from_sys_call:
movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */
call audit_syscall_entry
movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */
- cmpl $(IA32_NR_syscalls-1),%eax
+ cmpq $(IA32_NR_syscalls-1),%rax
ja ia32_badsys
movl %ebx,%edi /* reload 1st syscall arg */
movl RCX-ARGOFFSET(%rsp),%esi /* reload 2nd syscall arg */
@@ -248,7 +248,7 @@ sysenter_tracesys:
call syscall_trace_enter
LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
RESTORE_REST
- cmpl $(IA32_NR_syscalls-1),%eax
+ cmpq $(IA32_NR_syscalls-1),%rax
ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
jmp sysenter_do_call
CFI_ENDPROC
@@ -314,7 +314,7 @@ ENTRY(ia32_cstar_target)
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
CFI_REMEMBER_STATE
jnz cstar_tracesys
- cmpl $IA32_NR_syscalls-1,%eax
+ cmpq $IA32_NR_syscalls-1,%rax
ja ia32_badsys
cstar_do_call:
IA32_ARG_FIXUP 1
@@ -367,7 +367,7 @@ cstar_tracesys:
LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */
RESTORE_REST
xchgl %ebp,%r9d
- cmpl $(IA32_NR_syscalls-1),%eax
+ cmpq $(IA32_NR_syscalls-1),%rax
ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */
jmp cstar_do_call
END(ia32_cstar_target)
@@ -425,7 +425,7 @@ ENTRY(ia32_syscall)
orl $TS_COMPAT,TI_status(%r10)
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
jnz ia32_tracesys
- cmpl $(IA32_NR_syscalls-1),%eax
+ cmpq $(IA32_NR_syscalls-1),%rax
ja ia32_badsys
ia32_do_call:
IA32_ARG_FIXUP
@@ -444,7 +444,7 @@ ia32_tracesys:
call syscall_trace_enter
LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
RESTORE_REST
- cmpl $(IA32_NR_syscalls-1),%eax
+ cmpq $(IA32_NR_syscalls-1),%rax
ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */
jmp ia32_do_call
END(ia32_syscall)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 080/260] compat: Make compat_alloc_user_space() incorporate the access_ok()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (78 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 079/260] x86-64, compat: Test %rax for the syscall number, not %eax Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 081/260] x86-64, compat: Retruncate rax after ia32 syscall entry tracing Paul Gortmaker
` (181 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, H. Peter Anvin, Andrew Morton, Arnd Bergmann,
Fenghua Yu, H. Peter Anvin, Heiko Carstens, Helge Deller,
James Bottomley, Kyle McMartin, Martin Schwidefsky,
Paul Mackerras, Ralf Baechle, Paul Gortmaker
From: H. Peter Anvin <hpa@linux.intel.com>
commit c41d68a513c71e35a14f66d71782d27a79a81ea6 upstream.
compat_alloc_user_space() expects the caller to independently call
access_ok() to verify the returned area. A missing call could
introduce problems on some architectures.
This patch incorporates the access_ok() check into
compat_alloc_user_space() and also adds a sanity check on the length.
The existing compat_alloc_user_space() implementations are renamed
arch_compat_alloc_user_space() and are used as part of the
implementation of the new global function.
This patch assumes NULL will cause __get_user()/__put_user() to either
fail or access userspace on all architectures. This should be
followed by checking the return value of compat_access_user_space()
for NULL in the callers, at which time the access_ok() in the callers
can also be removed.
Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Tony Luck <tony.luck@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <jejb@parisc-linux.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/ia64/include/asm/compat.h | 2 +-
arch/mips/include/asm/compat.h | 2 +-
arch/parisc/include/asm/compat.h | 2 +-
arch/powerpc/include/asm/compat.h | 2 +-
arch/s390/include/asm/compat.h | 2 +-
arch/sparc/include/asm/compat.h | 2 +-
arch/x86/include/asm/compat.h | 2 +-
include/linux/compat.h | 3 +++
kernel/compat.c | 21 +++++++++++++++++++++
9 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/arch/ia64/include/asm/compat.h b/arch/ia64/include/asm/compat.h
index f90edc8..9301a28 100644
--- a/arch/ia64/include/asm/compat.h
+++ b/arch/ia64/include/asm/compat.h
@@ -199,7 +199,7 @@ ptr_to_compat(void __user *uptr)
}
static __inline__ void __user *
-compat_alloc_user_space (long len)
+arch_compat_alloc_user_space (long len)
{
struct pt_regs *regs = task_pt_regs(current);
return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len);
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h
index 613f691..dbc5106 100644
--- a/arch/mips/include/asm/compat.h
+++ b/arch/mips/include/asm/compat.h
@@ -145,7 +145,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr;
}
-static inline void __user *compat_alloc_user_space(long len)
+static inline void __user *arch_compat_alloc_user_space(long len)
{
struct pt_regs *regs = (struct pt_regs *)
((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1;
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
index 02b77ba..efa0b60 100644
--- a/arch/parisc/include/asm/compat.h
+++ b/arch/parisc/include/asm/compat.h
@@ -147,7 +147,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr;
}
-static __inline__ void __user *compat_alloc_user_space(long len)
+static __inline__ void __user *arch_compat_alloc_user_space(long len)
{
struct pt_regs *regs = ¤t->thread.regs;
return (void __user *)regs->gr[30];
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index 396d21a..a11d4ea 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -134,7 +134,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr;
}
-static inline void __user *compat_alloc_user_space(long len)
+static inline void __user *arch_compat_alloc_user_space(long len)
{
struct pt_regs *regs = current->thread.regs;
unsigned long usp = regs->gpr[1];
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 104f200..a875c2f 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -181,7 +181,7 @@ static inline int is_compat_task(void)
#endif
-static inline void __user *compat_alloc_user_space(long len)
+static inline void __user *arch_compat_alloc_user_space(long len)
{
unsigned long stack;
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 5016f76..6f57325 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -167,7 +167,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr;
}
-static inline void __user *compat_alloc_user_space(long len)
+static inline void __user *arch_compat_alloc_user_space(long len)
{
struct pt_regs *regs = current_thread_info()->kregs;
unsigned long usp = regs->u_regs[UREG_I6];
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index 306160e..1d9cd27 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -205,7 +205,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr;
}
-static inline void __user *compat_alloc_user_space(long len)
+static inline void __user *arch_compat_alloc_user_space(long len)
{
struct pt_regs *regs = task_pt_regs(current);
return (void __user *)regs->sp - len;
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 168f7da..c766441 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -360,5 +360,8 @@ extern ssize_t compat_rw_copy_check_uvector(int type,
const struct compat_iovec __user *uvector, unsigned long nr_segs,
unsigned long fast_segs, struct iovec *fast_pointer,
struct iovec **ret_pointer);
+
+extern void __user *compat_alloc_user_space(unsigned long len);
+
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
diff --git a/kernel/compat.c b/kernel/compat.c
index 5adab05..91b33fb 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -1137,3 +1137,24 @@ compat_sys_sysinfo(struct compat_sysinfo __user *info)
return 0;
}
+
+/*
+ * Allocate user-space memory for the duration of a single system call,
+ * in order to marshall parameters inside a compat thunk.
+ */
+void __user *compat_alloc_user_space(unsigned long len)
+{
+ void __user *ptr;
+
+ /* If len would occupy more than half of the entire compat space... */
+ if (unlikely(len > (((compat_uptr_t)~0) >> 1)))
+ return NULL;
+
+ ptr = arch_compat_alloc_user_space(len);
+
+ if (unlikely(!access_ok(VERIFY_WRITE, ptr, len)))
+ return NULL;
+
+ return ptr;
+}
+EXPORT_SYMBOL_GPL(compat_alloc_user_space);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 081/260] x86-64, compat: Retruncate rax after ia32 syscall entry tracing
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (79 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 080/260] compat: Make compat_alloc_user_space() incorporate the access_ok() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 082/260] sched: Kill the broken and deadlockable cpuset_lock/cpuset_cpus_allowed_locked code Paul Gortmaker
` (180 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Roland McGrath, H. Peter Anvin, Paul Gortmaker
From: Roland McGrath <roland@redhat.com>
commit eefdca043e8391dcd719711716492063030b55ac upstream.
In commit d4d6715, we reopened an old hole for a 64-bit ptracer touching a
32-bit tracee in system call entry. A %rax value set via ptrace at the
entry tracing stop gets used whole as a 32-bit syscall number, while we
only check the low 32 bits for validity.
Fix it by truncating %rax back to 32 bits after syscall_trace_enter,
in addition to testing the full 64 bits as has already been added.
Reported-by: Ben Hawkes <hawkes@sota.gen.nz>
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/ia32/ia32entry.S | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 944e3fc..4f5f71e 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -50,7 +50,12 @@
/*
* Reload arg registers from stack in case ptrace changed them.
* We don't reload %eax because syscall_trace_enter() returned
- * the value it wants us to use in the table lookup.
+ * the %rax value we should see. Instead, we just truncate that
+ * value to 32 bits again as we did on entry from user mode.
+ * If it's a new value set by user_regset during entry tracing,
+ * this matches the normal truncation of the user-mode value.
+ * If it's -1 to make us punt the syscall, then (u32)-1 is still
+ * an appropriately invalid value.
*/
.macro LOAD_ARGS32 offset, _r9=0
.if \_r9
@@ -60,6 +65,7 @@
movl \offset+48(%rsp),%edx
movl \offset+56(%rsp),%esi
movl \offset+64(%rsp),%edi
+ movl %eax,%eax /* zero extension */
.endm
.macro CFI_STARTPROC32 simple
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 082/260] sched: Kill the broken and deadlockable cpuset_lock/cpuset_cpus_allowed_locked code
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (80 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 081/260] x86-64, compat: Retruncate rax after ia32 syscall entry tracing Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 083/260] sched: move_task_off_dead_cpu(): Take rq->lock around select_fallback_rq() Paul Gortmaker
` (179 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Oleg Nesterov <oleg@redhat.com>
commit 897f0b3c3ff40b443c84e271bef19bd6ae885195 upstream.
This patch just states the fact the cpusets/cpuhotplug interaction is
broken and removes the deadlockable code which only pretends to work.
- cpuset_lock() doesn't really work. It is needed for
cpuset_cpus_allowed_locked() but we can't take this lock in
try_to_wake_up()->select_fallback_rq() path.
- cpuset_lock() is deadlockable. Suppose that a task T bound to CPU takes
callback_mutex. If cpu_down(CPU) happens before T drops callback_mutex
stop_machine() preempts T, then migration_call(CPU_DEAD) tries to take
cpuset_lock() and hangs forever because CPU is already dead and thus
T can't be scheduled.
- cpuset_cpus_allowed_locked() is deadlockable too. It takes task_lock()
which is not irq-safe, but try_to_wake_up() can be called from irq.
Kill them, and change select_fallback_rq() to use cpu_possible_mask, like
we currently do without CONFIG_CPUSETS.
Also, with or without this patch, with or without CONFIG_CPUSETS, the
callers of select_fallback_rq() can race with each other or with
set_cpus_allowed() pathes.
The subsequent patches try to to fix these problems.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100315091003.GA9123@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/cpuset.h | 13 -------------
kernel/cpuset.c | 27 +--------------------------
kernel/sched.c | 10 +++-------
3 files changed, 4 insertions(+), 46 deletions(-)
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index a5740fc..eeaaee7 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -21,8 +21,6 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
extern int cpuset_init(void);
extern void cpuset_init_smp(void);
extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
-extern void cpuset_cpus_allowed_locked(struct task_struct *p,
- struct cpumask *mask);
extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
#define cpuset_current_mems_allowed (current->mems_allowed)
void cpuset_init_current_mems_allowed(void);
@@ -69,9 +67,6 @@ struct seq_file;
extern void cpuset_task_status_allowed(struct seq_file *m,
struct task_struct *task);
-extern void cpuset_lock(void);
-extern void cpuset_unlock(void);
-
extern int cpuset_mem_spread_node(void);
static inline int cpuset_do_page_mem_spread(void)
@@ -105,11 +100,6 @@ static inline void cpuset_cpus_allowed(struct task_struct *p,
{
cpumask_copy(mask, cpu_possible_mask);
}
-static inline void cpuset_cpus_allowed_locked(struct task_struct *p,
- struct cpumask *mask)
-{
- cpumask_copy(mask, cpu_possible_mask);
-}
static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
{
@@ -157,9 +147,6 @@ static inline void cpuset_task_status_allowed(struct seq_file *m,
{
}
-static inline void cpuset_lock(void) {}
-static inline void cpuset_unlock(void) {}
-
static inline int cpuset_mem_spread_node(void)
{
return 0;
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index d109467..9a747f5 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2182,19 +2182,10 @@ void __init cpuset_init_smp(void)
void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask)
{
mutex_lock(&callback_mutex);
- cpuset_cpus_allowed_locked(tsk, pmask);
- mutex_unlock(&callback_mutex);
-}
-
-/**
- * cpuset_cpus_allowed_locked - return cpus_allowed mask from a tasks cpuset.
- * Must be called with callback_mutex held.
- **/
-void cpuset_cpus_allowed_locked(struct task_struct *tsk, struct cpumask *pmask)
-{
task_lock(tsk);
guarantee_online_cpus(task_cs(tsk), pmask);
task_unlock(tsk);
+ mutex_unlock(&callback_mutex);
}
void cpuset_init_current_mems_allowed(void)
@@ -2383,22 +2374,6 @@ int __cpuset_node_allowed_hardwall(int node, gfp_t gfp_mask)
}
/**
- * cpuset_lock - lock out any changes to cpuset structures
- *
- * The out of memory (oom) code needs to mutex_lock cpusets
- * from being changed while it scans the tasklist looking for a
- * task in an overlapping cpuset. Expose callback_mutex via this
- * cpuset_lock() routine, so the oom code can lock it, before
- * locking the task list. The tasklist_lock is a spinlock, so
- * must be taken inside callback_mutex.
- */
-
-void cpuset_lock(void)
-{
- mutex_lock(&callback_mutex);
-}
-
-/**
* cpuset_unlock - release lock on cpuset changes
*
* Undo the lock taken in a previous cpuset_lock() call.
diff --git a/kernel/sched.c b/kernel/sched.c
index a4a3801..489d985 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2302,11 +2302,9 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
return dest_cpu;
/* No more Mr. Nice Guy. */
- if (dest_cpu >= nr_cpu_ids) {
- rcu_read_lock();
- cpuset_cpus_allowed_locked(p, &p->cpus_allowed);
- rcu_read_unlock();
- dest_cpu = cpumask_any_and(cpu_active_mask, &p->cpus_allowed);
+ if (unlikely(dest_cpu >= nr_cpu_ids)) {
+ cpumask_copy(&p->cpus_allowed, cpu_possible_mask);
+ dest_cpu = cpumask_any(cpu_active_mask);
/*
* Don't tell them about moving exiting tasks or
@@ -5947,7 +5945,6 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
case CPU_DEAD:
case CPU_DEAD_FROZEN:
- cpuset_lock(); /* around calls to cpuset_cpus_allowed_lock() */
migrate_live_tasks(cpu);
rq = cpu_rq(cpu);
kthread_stop(rq->migration_thread);
@@ -5961,7 +5958,6 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
rq->idle->sched_class = &idle_sched_class;
migrate_dead_tasks(cpu);
raw_spin_unlock_irq(&rq->lock);
- cpuset_unlock();
migrate_nr_uninterruptible(rq);
BUG_ON(rq->nr_running != 0);
calc_global_load_remove(rq);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 083/260] sched: move_task_off_dead_cpu(): Take rq->lock around select_fallback_rq()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (81 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 082/260] sched: Kill the broken and deadlockable cpuset_lock/cpuset_cpus_allowed_locked code Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 084/260] sched: move_task_off_dead_cpu(): Remove retry logic Paul Gortmaker
` (178 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Oleg Nesterov <oleg@redhat.com>
commit 1445c08d06c5594895b4fae952ef8a457e89c390 upstream.
move_task_off_dead_cpu()->select_fallback_rq() reads/updates ->cpus_allowed
lockless. We can race with set_cpus_allowed() running in parallel.
Change it to take rq->lock around select_fallback_rq(). Note that it is not
trivial to move this spin_lock() into select_fallback_rq(), we must recheck
the task was not migrated after we take the lock and other callers do not
need this lock.
To avoid the races with other callers of select_fallback_rq() which rely on
TASK_WAKING, we also check p->state != TASK_WAKING and do nothing otherwise.
The owner of TASK_WAKING must update ->cpus_allowed and choose the correct
CPU anyway, and the subsequent __migrate_task() is just meaningless because
p->se.on_rq must be false.
Alternatively, we could change select_task_rq() to take rq->lock right
after it calls sched_class->select_task_rq(), but this looks a bit ugly.
Also, change it to not assume irqs are disabled and absorb __migrate_task_irq().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100315091010.GA9131@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 489d985..743af02 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5527,29 +5527,29 @@ static int migration_thread(void *data)
}
#ifdef CONFIG_HOTPLUG_CPU
-
-static int __migrate_task_irq(struct task_struct *p, int src_cpu, int dest_cpu)
-{
- int ret;
-
- local_irq_disable();
- ret = __migrate_task(p, src_cpu, dest_cpu);
- local_irq_enable();
- return ret;
-}
-
/*
* Figure out where task on dead CPU should go, use force if necessary.
*/
static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p)
{
- int dest_cpu;
-
+ struct rq *rq = cpu_rq(dead_cpu);
+ int needs_cpu, uninitialized_var(dest_cpu);
+ unsigned long flags;
again:
- dest_cpu = select_fallback_rq(dead_cpu, p);
+ local_irq_save(flags);
+
+ raw_spin_lock(&rq->lock);
+ needs_cpu = (task_cpu(p) == dead_cpu) && (p->state != TASK_WAKING);
+ if (needs_cpu)
+ dest_cpu = select_fallback_rq(dead_cpu, p);
+ raw_spin_unlock(&rq->lock);
/* It can have affinity changed while we were choosing. */
- if (unlikely(!__migrate_task_irq(p, dead_cpu, dest_cpu)))
+ if (needs_cpu)
+ needs_cpu = !__migrate_task(p, dead_cpu, dest_cpu);
+ local_irq_restore(flags);
+
+ if (unlikely(needs_cpu))
goto again;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 084/260] sched: move_task_off_dead_cpu(): Remove retry logic
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (82 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 083/260] sched: move_task_off_dead_cpu(): Take rq->lock around select_fallback_rq() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 085/260] sched: sched_exec(): Remove the select_fallback_rq() logic Paul Gortmaker
` (177 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Oleg Nesterov <oleg@redhat.com>
commit c1804d547dc098363443667609c272d1e4d15ee8 upstream.
The previous patch preserved the retry logic, but it looks unneeded.
__migrate_task() can only fail if we raced with migration after we dropped
the lock, but in this case the caller of set_cpus_allowed/etc must initiate
migration itself if ->on_rq == T.
We already fixed p->cpus_allowed, the changes in active/online masks must
be visible to racer, it should migrate the task to online cpu correctly.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100315091014.GA9138@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 743af02..59ef8a1 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5535,7 +5535,7 @@ static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p)
struct rq *rq = cpu_rq(dead_cpu);
int needs_cpu, uninitialized_var(dest_cpu);
unsigned long flags;
-again:
+
local_irq_save(flags);
raw_spin_lock(&rq->lock);
@@ -5543,14 +5543,13 @@ again:
if (needs_cpu)
dest_cpu = select_fallback_rq(dead_cpu, p);
raw_spin_unlock(&rq->lock);
-
- /* It can have affinity changed while we were choosing. */
+ /*
+ * It can only fail if we race with set_cpus_allowed(),
+ * in the racer should migrate the task anyway.
+ */
if (needs_cpu)
- needs_cpu = !__migrate_task(p, dead_cpu, dest_cpu);
+ __migrate_task(p, dead_cpu, dest_cpu);
local_irq_restore(flags);
-
- if (unlikely(needs_cpu))
- goto again;
}
/*
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 085/260] sched: sched_exec(): Remove the select_fallback_rq() logic
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (83 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 084/260] sched: move_task_off_dead_cpu(): Remove retry logic Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 086/260] sched: _cpu_down(): Don't play with current->cpus_allowed Paul Gortmaker
` (176 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Oleg Nesterov <oleg@redhat.com>
commit 30da688ef6b76e01969b00608202fff1eed2accc upstream.
sched_exec()->select_task_rq() reads/updates ->cpus_allowed lockless.
This can race with other CPUs updating our ->cpus_allowed, and this
looks meaningless to me.
The task is current and running, it must have online cpus in ->cpus_allowed,
the fallback mode is bogus. And, if ->sched_class returns the "wrong" cpu,
this likely means we raced with set_cpus_allowed() which was called
for reason, why should sched_exec() retry and call ->select_task_rq()
again?
Change the code to call sched_class->select_task_rq() directly and do
nothing if the returned cpu is wrong after re-checking under rq->lock.
>From now task_struct->cpus_allowed is always stable under TASK_WAKING,
select_fallback_rq() is always called under rq-lock or the caller or
the caller owns TASK_WAKING (select_task_rq).
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100315091019.GA9141@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched.c | 25 ++++++++-----------------
1 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 59ef8a1..5ec7687 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2286,6 +2286,9 @@ void task_oncpu_function_call(struct task_struct *p,
}
#ifdef CONFIG_SMP
+/*
+ * ->cpus_allowed is protected by either TASK_WAKING or rq->lock held.
+ */
static int select_fallback_rq(int cpu, struct task_struct *p)
{
int dest_cpu;
@@ -2322,12 +2325,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
}
/*
- * Gets called from 3 sites (exec, fork, wakeup), since it is called without
- * holding rq->lock we need to ensure ->cpus_allowed is stable, this is done
- * by:
- *
- * exec: is unstable, retry loop
- * fork & wake-up: serialize ->cpus_allowed against TASK_WAKING
+ * The caller (fork, wakeup) owns TASK_WAKING, ->cpus_allowed is stable.
*/
static inline
int select_task_rq(struct task_struct *p, int sd_flags, int wake_flags)
@@ -3137,9 +3135,8 @@ void sched_exec(void)
unsigned long flags;
struct rq *rq;
-again:
this_cpu = get_cpu();
- dest_cpu = select_task_rq(p, SD_BALANCE_EXEC, 0);
+ dest_cpu = p->sched_class->select_task_rq(p, SD_BALANCE_EXEC, 0);
if (dest_cpu == this_cpu) {
put_cpu();
return;
@@ -3147,18 +3144,12 @@ again:
rq = task_rq_lock(p, &flags);
put_cpu();
-
/*
* select_task_rq() can race against ->cpus_allowed
*/
- if (!cpumask_test_cpu(dest_cpu, &p->cpus_allowed)
- || unlikely(!cpu_active(dest_cpu))) {
- task_rq_unlock(rq, &flags);
- goto again;
- }
-
- /* force the process onto the specified CPU */
- if (migrate_task(p, dest_cpu, &req)) {
+ if (cpumask_test_cpu(dest_cpu, &p->cpus_allowed) &&
+ likely(cpu_active(dest_cpu)) &&
+ migrate_task(p, dest_cpu, &req)) {
/* Need to wait for migration thread (might exit: take ref). */
struct task_struct *mt = rq->migration_thread;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 086/260] sched: _cpu_down(): Don't play with current->cpus_allowed
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (84 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 085/260] sched: sched_exec(): Remove the select_fallback_rq() logic Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 087/260] sched: Make select_fallback_rq() cpuset friendly Paul Gortmaker
` (175 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Oleg Nesterov <oleg@redhat.com>
commit 6a1bdc1b577ebcb65f6603c57f8347309bc4ab13 upstream.
_cpu_down() changes the current task's affinity and then recovers it at
the end. The problems are well known: we can't restore old_allowed if it
was bound to the now-dead-cpu, and we can race with the userspace which
can change cpu-affinity during unplug.
_cpu_down() should not play with current->cpus_allowed at all. Instead,
take_cpu_down() can migrate the caller of _cpu_down() after __cpu_disable()
removes the dying cpu from cpu_online_mask.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100315091023.GA9148@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/sched.h | 1 +
kernel/cpu.c | 18 ++++++------------
kernel/sched.c | 2 +-
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2b7b81d..fbdbc26 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1846,6 +1846,7 @@ extern void sched_clock_idle_sleep_event(void);
extern void sched_clock_idle_wakeup_event(u64 delta_ns);
#ifdef CONFIG_HOTPLUG_CPU
+extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p);
extern void idle_task_exit(void);
#else
static inline void idle_task_exit(void) {}
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 25bba73..914aedc 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -164,6 +164,7 @@ static inline void check_for_tasks(int cpu)
}
struct take_cpu_down_param {
+ struct task_struct *caller;
unsigned long mod;
void *hcpu;
};
@@ -172,6 +173,7 @@ struct take_cpu_down_param {
static int __ref take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
+ unsigned int cpu = (unsigned long)param->hcpu;
int err;
/* Ensure this CPU doesn't handle any more interrupts. */
@@ -182,6 +184,8 @@ static int __ref take_cpu_down(void *_param)
raw_notifier_call_chain(&cpu_chain, CPU_DYING | param->mod,
param->hcpu);
+ if (task_cpu(param->caller) == cpu)
+ move_task_off_dead_cpu(cpu, param->caller);
/* Force idle task to run as soon as we yield: it should
immediately notice cpu is offline and die quickly. */
sched_idle_next();
@@ -192,10 +196,10 @@ static int __ref take_cpu_down(void *_param)
static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
{
int err, nr_calls = 0;
- cpumask_var_t old_allowed;
void *hcpu = (void *)(long)cpu;
unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
struct take_cpu_down_param tcd_param = {
+ .caller = current,
.mod = mod,
.hcpu = hcpu,
};
@@ -206,9 +210,6 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
if (!cpu_online(cpu))
return -EINVAL;
- if (!alloc_cpumask_var(&old_allowed, GFP_KERNEL))
- return -ENOMEM;
-
cpu_hotplug_begin();
set_cpu_active(cpu, false);
err = __raw_notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE | mod,
@@ -225,10 +226,6 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
goto out_release;
}
- /* Ensure that we are not runnable on dying cpu */
- cpumask_copy(old_allowed, ¤t->cpus_allowed);
- set_cpus_allowed_ptr(current, cpu_active_mask);
-
err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));
if (err) {
set_cpu_active(cpu, true);
@@ -237,7 +234,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
hcpu) == NOTIFY_BAD)
BUG();
- goto out_allowed;
+ goto out_release;
}
BUG_ON(cpu_online(cpu));
@@ -255,8 +252,6 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
check_for_tasks(cpu);
-out_allowed:
- set_cpus_allowed_ptr(current, old_allowed);
out_release:
cpu_hotplug_done();
if (!err) {
@@ -264,7 +259,6 @@ out_release:
hcpu) == NOTIFY_BAD)
BUG();
}
- free_cpumask_var(old_allowed);
return err;
}
diff --git a/kernel/sched.c b/kernel/sched.c
index 5ec7687..cc1ba47 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5521,7 +5521,7 @@ static int migration_thread(void *data)
/*
* Figure out where task on dead CPU should go, use force if necessary.
*/
-static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p)
+void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p)
{
struct rq *rq = cpu_rq(dead_cpu);
int needs_cpu, uninitialized_var(dest_cpu);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 087/260] sched: Make select_fallback_rq() cpuset friendly
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (85 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 086/260] sched: _cpu_down(): Don't play with current->cpus_allowed Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 088/260] sched: Fix TASK_WAKING vs fork deadlock Paul Gortmaker
` (174 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Oleg Nesterov, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Oleg Nesterov <oleg@redhat.com>
commit 9084bb8246ea935b98320554229e2f371f7f52fa upstream.
Introduce cpuset_cpus_allowed_fallback() helper to fix the cpuset problems
with select_fallback_rq(). It can be called from any context and can't use
any cpuset locks including task_lock(). It is called when the task doesn't
have online cpus in ->cpus_allowed but ttwu/etc must be able to find a
suitable cpu.
I am not proud of this patch. Everything which needs such a fat comment
can't be good even if correct. But I'd prefer to not change the locking
rules in the code I hardly understand, and in any case I believe this
simple change make the code much more correct compared to deadlocks we
currently have.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100315091027.GA9155@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/cpuset.h | 7 +++++++
kernel/cpuset.c | 42 ++++++++++++++++++++++++++++++++++++++++++
kernel/sched.c | 4 +---
3 files changed, 50 insertions(+), 3 deletions(-)
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index eeaaee7..a73454a 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -21,6 +21,7 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
extern int cpuset_init(void);
extern void cpuset_init_smp(void);
extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
+extern int cpuset_cpus_allowed_fallback(struct task_struct *p);
extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
#define cpuset_current_mems_allowed (current->mems_allowed)
void cpuset_init_current_mems_allowed(void);
@@ -101,6 +102,12 @@ static inline void cpuset_cpus_allowed(struct task_struct *p,
cpumask_copy(mask, cpu_possible_mask);
}
+static inline int cpuset_cpus_allowed_fallback(struct task_struct *p)
+{
+ cpumask_copy(&p->cpus_allowed, cpu_possible_mask);
+ return cpumask_any(cpu_active_mask);
+}
+
static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
{
return node_possible_map;
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 9a747f5..9a50c5f 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2188,6 +2188,48 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask)
mutex_unlock(&callback_mutex);
}
+int cpuset_cpus_allowed_fallback(struct task_struct *tsk)
+{
+ const struct cpuset *cs;
+ int cpu;
+
+ rcu_read_lock();
+ cs = task_cs(tsk);
+ if (cs)
+ cpumask_copy(&tsk->cpus_allowed, cs->cpus_allowed);
+ rcu_read_unlock();
+
+ /*
+ * We own tsk->cpus_allowed, nobody can change it under us.
+ *
+ * But we used cs && cs->cpus_allowed lockless and thus can
+ * race with cgroup_attach_task() or update_cpumask() and get
+ * the wrong tsk->cpus_allowed. However, both cases imply the
+ * subsequent cpuset_change_cpumask()->set_cpus_allowed_ptr()
+ * which takes task_rq_lock().
+ *
+ * If we are called after it dropped the lock we must see all
+ * changes in tsk_cs()->cpus_allowed. Otherwise we can temporary
+ * set any mask even if it is not right from task_cs() pov,
+ * the pending set_cpus_allowed_ptr() will fix things.
+ */
+
+ cpu = cpumask_any_and(&tsk->cpus_allowed, cpu_active_mask);
+ if (cpu >= nr_cpu_ids) {
+ /*
+ * Either tsk->cpus_allowed is wrong (see above) or it
+ * is actually empty. The latter case is only possible
+ * if we are racing with remove_tasks_in_empty_cpuset().
+ * Like above we can temporary set any mask and rely on
+ * set_cpus_allowed_ptr() as synchronization point.
+ */
+ cpumask_copy(&tsk->cpus_allowed, cpu_possible_mask);
+ cpu = cpumask_any(cpu_active_mask);
+ }
+
+ return cpu;
+}
+
void cpuset_init_current_mems_allowed(void)
{
nodes_setall(current->mems_allowed);
diff --git a/kernel/sched.c b/kernel/sched.c
index cc1ba47..b969a56 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2306,9 +2306,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
/* No more Mr. Nice Guy. */
if (unlikely(dest_cpu >= nr_cpu_ids)) {
- cpumask_copy(&p->cpus_allowed, cpu_possible_mask);
- dest_cpu = cpumask_any(cpu_active_mask);
-
+ dest_cpu = cpuset_cpus_allowed_fallback(p);
/*
* Don't tell them about moving exiting tasks or
* kernel threads (both mm NULL), since they never
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 088/260] sched: Fix TASK_WAKING vs fork deadlock
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (86 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 087/260] sched: Make select_fallback_rq() cpuset friendly Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 089/260] sched: Optimize task_rq_lock() Paul Gortmaker
` (173 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Peter Zijlstra, Ingo Molnar, Paul Gortmaker
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
commit 0017d735092844118bef006696a750a0e4ef6ebd upstream.
Oleg noticed a few races with the TASK_WAKING usage on fork.
- since TASK_WAKING is basically a spinlock, it should be IRQ safe
- since we set TASK_WAKING (*) without holding rq->lock it could
be there still is a rq->lock holder, thereby not actually
providing full serialization.
(*) in fact we clear PF_STARTING, which in effect enables TASK_WAKING.
Cure the second issue by not setting TASK_WAKING in sched_fork(), but
only temporarily in wake_up_new_task() while calling select_task_rq().
Cure the first by holding rq->lock around the select_task_rq() call,
this will disable IRQs, this however requires that we push down the
rq->lock release into select_task_rq_fair()'s cgroup stuff.
Because select_task_rq_fair() still needs to drop the rq->lock we
cannot fully get rid of TASK_WAKING.
Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/sched.h | 3 +-
kernel/sched.c | 65 +++++++++++++++++-----------------------------
kernel/sched_fair.c | 8 ++++-
kernel/sched_idletask.c | 3 +-
kernel/sched_rt.c | 5 +--
5 files changed, 36 insertions(+), 48 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index fbdbc26..25f9669 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1040,7 +1040,8 @@ struct sched_class {
void (*put_prev_task) (struct rq *rq, struct task_struct *p);
#ifdef CONFIG_SMP
- int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
+ int (*select_task_rq)(struct rq *rq, struct task_struct *p,
+ int sd_flag, int flags);
void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
void (*post_schedule) (struct rq *this_rq);
diff --git a/kernel/sched.c b/kernel/sched.c
index b969a56..31b0bae 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -916,14 +916,10 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
/*
* Check whether the task is waking, we use this to synchronize against
* ttwu() so that task_cpu() reports a stable number.
- *
- * We need to make an exception for PF_STARTING tasks because the fork
- * path might require task_rq_lock() to work, eg. it can call
- * set_cpus_allowed_ptr() from the cpuset clone_ns code.
*/
static inline int task_is_waking(struct task_struct *p)
{
- return unlikely((p->state == TASK_WAKING) && !(p->flags & PF_STARTING));
+ return unlikely(p->state == TASK_WAKING);
}
/*
@@ -2326,9 +2322,9 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
* The caller (fork, wakeup) owns TASK_WAKING, ->cpus_allowed is stable.
*/
static inline
-int select_task_rq(struct task_struct *p, int sd_flags, int wake_flags)
+int select_task_rq(struct rq *rq, struct task_struct *p, int sd_flags, int wake_flags)
{
- int cpu = p->sched_class->select_task_rq(p, sd_flags, wake_flags);
+ int cpu = p->sched_class->select_task_rq(rq, p, sd_flags, wake_flags);
/*
* In order not to call set_task_cpu() on a blocking task we need
@@ -2403,17 +2399,10 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
if (p->sched_class->task_waking)
p->sched_class->task_waking(rq, p);
- __task_rq_unlock(rq);
-
- cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
- if (cpu != orig_cpu) {
- /*
- * Since we migrate the task without holding any rq->lock,
- * we need to be careful with task_rq_lock(), since that
- * might end up locking an invalid rq.
- */
+ cpu = select_task_rq(rq, p, SD_BALANCE_WAKE, wake_flags);
+ if (cpu != orig_cpu)
set_task_cpu(p, cpu);
- }
+ __task_rq_unlock(rq);
rq = cpu_rq(cpu);
raw_spin_lock(&rq->lock);
@@ -2590,11 +2579,11 @@ void sched_fork(struct task_struct *p, int clone_flags)
__sched_fork(p);
/*
- * We mark the process as waking here. This guarantees that
+ * We mark the process as running here. This guarantees that
* nobody will actually run it, and a signal or other external
* event cannot wake it up and insert it on the runqueue either.
*/
- p->state = TASK_WAKING;
+ p->state = TASK_RUNNING;
/*
* Revert to default priority/policy on fork if requested.
@@ -2661,28 +2650,25 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
int cpu __maybe_unused = get_cpu();
#ifdef CONFIG_SMP
+ rq = task_rq_lock(p, &flags);
+ p->state = TASK_WAKING;
+
/*
* Fork balancing, do it here and not earlier because:
* - cpus_allowed can change in the fork path
* - any previously selected cpu might disappear through hotplug
*
- * We still have TASK_WAKING but PF_STARTING is gone now, meaning
- * ->cpus_allowed is stable, we have preemption disabled, meaning
- * cpu_online_mask is stable.
+ * We set TASK_WAKING so that select_task_rq() can drop rq->lock
+ * without people poking at ->cpus_allowed.
*/
- cpu = select_task_rq(p, SD_BALANCE_FORK, 0);
+ cpu = select_task_rq(rq, p, SD_BALANCE_FORK, 0);
set_task_cpu(p, cpu);
-#endif
-
- /*
- * Since the task is not on the rq and we still have TASK_WAKING set
- * nobody else will migrate this task.
- */
- rq = cpu_rq(cpu);
- raw_spin_lock_irqsave(&rq->lock, flags);
- BUG_ON(p->state != TASK_WAKING);
p->state = TASK_RUNNING;
+ task_rq_unlock(rq, &flags);
+#endif
+
+ rq = task_rq_lock(p, &flags);
update_rq_clock(rq);
activate_task(rq, p, 0);
trace_sched_wakeup_new(rq, p, 1);
@@ -3129,19 +3115,15 @@ void sched_exec(void)
{
struct task_struct *p = current;
struct migration_req req;
- int dest_cpu, this_cpu;
unsigned long flags;
struct rq *rq;
-
- this_cpu = get_cpu();
- dest_cpu = p->sched_class->select_task_rq(p, SD_BALANCE_EXEC, 0);
- if (dest_cpu == this_cpu) {
- put_cpu();
- return;
- }
+ int dest_cpu;
rq = task_rq_lock(p, &flags);
- put_cpu();
+ dest_cpu = p->sched_class->select_task_rq(rq, p, SD_BALANCE_EXEC, 0);
+ if (dest_cpu == smp_processor_id())
+ goto unlock;
+
/*
* select_task_rq() can race against ->cpus_allowed
*/
@@ -3159,6 +3141,7 @@ void sched_exec(void)
return;
}
+unlock:
task_rq_unlock(rq, &flags);
}
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 5a5ea2c..684e173 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1445,7 +1445,8 @@ select_idle_sibling(struct task_struct *p, struct sched_domain *sd, int target)
*
* preempt must be disabled.
*/
-static int select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flags)
+static int
+select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_flags)
{
struct sched_domain *tmp, *affine_sd = NULL, *sd = NULL;
int cpu = smp_processor_id();
@@ -1541,8 +1542,11 @@ static int select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flag
cpumask_weight(sched_domain_span(sd))))
tmp = affine_sd;
- if (tmp)
+ if (tmp) {
+ raw_spin_unlock(&rq->lock);
update_shares(tmp);
+ raw_spin_lock(&rq->lock);
+ }
}
if (affine_sd && wake_affine(affine_sd, p, sync))
diff --git a/kernel/sched_idletask.c b/kernel/sched_idletask.c
index a8a6d8a..5af709f 100644
--- a/kernel/sched_idletask.c
+++ b/kernel/sched_idletask.c
@@ -6,7 +6,8 @@
*/
#ifdef CONFIG_SMP
-static int select_task_rq_idle(struct task_struct *p, int sd_flag, int flags)
+static int
+select_task_rq_idle(struct rq *rq, struct task_struct *p, int sd_flag, int flags)
{
return task_cpu(p); /* IDLE tasks as never migrated */
}
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index b5b920a..fd8c1a3 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -948,10 +948,9 @@ static void yield_task_rt(struct rq *rq)
#ifdef CONFIG_SMP
static int find_lowest_rq(struct task_struct *task);
-static int select_task_rq_rt(struct task_struct *p, int sd_flag, int flags)
+static int
+select_task_rq_rt(struct rq *rq, struct task_struct *p, int sd_flag, int flags)
{
- struct rq *rq = task_rq(p);
-
if (sd_flag != SD_BALANCE_WAKE)
return smp_processor_id();
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 089/260] sched: Optimize task_rq_lock()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (87 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 088/260] sched: Fix TASK_WAKING vs fork deadlock Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 090/260] sched: Fix nr_uninterruptible count Paul Gortmaker
` (172 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Peter Zijlstra, Oleg Nesterov, Ingo Molnar,
Paul Gortmaker
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
commit 65cc8e4859ff29a9ddc989c88557d6059834c2a2 upstream.
Now that we hold the rq->lock over set_task_cpu() again, we can do
away with most of the TASK_WAKING checks and reduce them again to
set_cpus_allowed_ptr().
Removes some conditionals from scheduling hot-paths.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Oleg Nesterov <oleg@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched.c | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 31b0bae..e542c1e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -914,8 +914,8 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
#endif /* __ARCH_WANT_UNLOCKED_CTXSW */
/*
- * Check whether the task is waking, we use this to synchronize against
- * ttwu() so that task_cpu() reports a stable number.
+ * Check whether the task is waking, we use this to synchronize ->cpus_allowed
+ * against ttwu().
*/
static inline int task_is_waking(struct task_struct *p)
{
@@ -932,11 +932,9 @@ static inline struct rq *__task_rq_lock(struct task_struct *p)
struct rq *rq;
for (;;) {
- while (task_is_waking(p))
- cpu_relax();
rq = task_rq(p);
raw_spin_lock(&rq->lock);
- if (likely(rq == task_rq(p) && !task_is_waking(p)))
+ if (likely(rq == task_rq(p)))
return rq;
raw_spin_unlock(&rq->lock);
}
@@ -953,12 +951,10 @@ static struct rq *task_rq_lock(struct task_struct *p, unsigned long *flags)
struct rq *rq;
for (;;) {
- while (task_is_waking(p))
- cpu_relax();
local_irq_save(*flags);
rq = task_rq(p);
raw_spin_lock(&rq->lock);
- if (likely(rq == task_rq(p) && !task_is_waking(p)))
+ if (likely(rq == task_rq(p)))
return rq;
raw_spin_unlock_irqrestore(&rq->lock, *flags);
}
@@ -5341,7 +5337,18 @@ int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
struct rq *rq;
int ret = 0;
+ /*
+ * Serialize against TASK_WAKING so that ttwu() and wunt() can
+ * drop the rq->lock and still rely on ->cpus_allowed.
+ */
+again:
+ while (task_is_waking(p))
+ cpu_relax();
rq = task_rq_lock(p, &flags);
+ if (task_is_waking(p)) {
+ task_rq_unlock(rq, &flags);
+ goto again;
+ }
if (!cpumask_intersects(new_mask, cpu_active_mask)) {
ret = -EINVAL;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 090/260] sched: Fix nr_uninterruptible count
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (88 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 089/260] sched: Optimize task_rq_lock() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 091/260] sched: Fix rq->clock synchronization when migrating tasks Paul Gortmaker
` (171 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Peter Zijlstra, Ingo Molnar, Paul Gortmaker
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
commit cc87f76a601d2d256118f7bab15e35254356ae21 upstream.
The cpuload calculation in calc_load_account_active() assumes
rq->nr_uninterruptible will not change on an offline cpu after
migrate_nr_uninterruptible(). However the recent migrate on wakeup
changes broke that and would result in decrementing the offline cpu's
rq->nr_uninterruptible.
Fix this by accounting the nr_uninterruptible on the waking cpu.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index e542c1e..074c4d8 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2388,8 +2388,12 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
*
* First fix up the nr_uninterruptible count:
*/
- if (task_contributes_to_load(p))
- rq->nr_uninterruptible--;
+ if (task_contributes_to_load(p)) {
+ if (likely(cpu_online(orig_cpu)))
+ rq->nr_uninterruptible--;
+ else
+ this_rq()->nr_uninterruptible--;
+ }
p->state = TASK_WAKING;
if (p->sched_class->task_waking)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 091/260] sched: Fix rq->clock synchronization when migrating tasks
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (89 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 090/260] sched: Fix nr_uninterruptible count Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 092/260] rcu: apply RCU protection to wake_affine() Paul Gortmaker
` (170 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Peter Zijlstra, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Peter Zijlstra <peterz@infradead.org>
commit 861d034ee814917a83bd5de4b26e3b8336ddeeb8 upstream.
sched_fork() -- we do task placement in ->task_fork_fair() ensure we
update_rq_clock() so we work with current time. We leave the vruntime
in relative state, so the time delay until wake_up_new_task() doesn't
matter.
wake_up_new_task() -- Since task_fork_fair() left p->vruntime in
relative state we can safely migrate, the activate_task() on the
remote rq will call update_rq_clock() and causes the clock to be
synced (enough).
Tested-by: Jack Daniel <wanders.thirst@gmail.com>
Tested-by: Philby John <pjohn@mvista.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1281002322.1923.1708.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched_fair.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 684e173..461d312 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -3588,6 +3588,8 @@ static void task_fork_fair(struct task_struct *p)
raw_spin_lock_irqsave(&rq->lock, flags);
+ update_rq_clock(rq);
+
if (unlikely(task_cpu(p) != this_cpu))
__set_task_cpu(p, this_cpu);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 092/260] rcu: apply RCU protection to wake_affine()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (90 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 091/260] sched: Fix rq->clock synchronization when migrating tasks Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 093/260] sched: Fix select_idle_sibling() Paul Gortmaker
` (169 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Daniel J Blueman, Paul E. McKenney, Paul Gortmaker
From: Daniel J Blueman <daniel.blueman@gmail.com>
commit f3b577dec1f2ce32d2db6d2ca6badff7002512af upstream.
The task_group() function returns a pointer that must be protected
by either RCU, the ->alloc_lock, or the cgroup lock (see the
rcu_dereference_check() in task_subsys_state(), which is invoked by
task_group()). The wake_affine() function currently does none of these,
which means that a concurrent update would be within its rights to free
the structure returned by task_group(). Because wake_affine() uses this
structure only to compute load-balancing heuristics, there is no reason
to acquire either of the two locks.
Therefore, this commit introduces an RCU read-side critical section that
starts before the first call to task_group() and ends after the last use
of the "tg" pointer returned from task_group(). Thanks to Li Zefan for
pointing out the need to extend the RCU read-side critical section from
that proposed by the original patch.
Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched_fair.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 461d312..94993ac 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1272,6 +1272,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
* effect of the currently running task from the load
* of the current CPU:
*/
+ rcu_read_lock();
if (sync) {
tg = task_group(current);
weight = current->se.load.weight;
@@ -1297,6 +1298,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
balanced = !this_load ||
100*(this_load + effective_load(tg, this_cpu, weight, weight)) <=
imbalance*(load + effective_load(tg, prev_cpu, 0, weight));
+ rcu_read_unlock();
/*
* If the currently running task will sleep within
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 093/260] sched: Fix select_idle_sibling()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (91 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 092/260] rcu: apply RCU protection to wake_affine() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 094/260] sched: Pre-compute cpumask_weight(sched_domain_span(sd)) Paul Gortmaker
` (168 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Mike Galbraith, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Mike Galbraith <efault@gmx.de>
commit 8b911acdf08477c059d1c36c21113ab1696c612b upstream.
Don't bother with selection when the current cpu is idle. Recent load
balancing changes also make it no longer necessary to check wake_affine()
success before returning the selected sibling, so we now always use it.
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1268301369.6785.36.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched_fair.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 94993ac..ae4d842 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1454,7 +1454,7 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
int cpu = smp_processor_id();
int prev_cpu = task_cpu(p);
int new_cpu = cpu;
- int want_affine = 0;
+ int want_affine = 0, cpu_idle = !current->pid;
int want_sd = 1;
int sync = wake_flags & WF_SYNC;
@@ -1512,13 +1512,15 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
* If there's an idle sibling in this domain, make that
* the wake_affine target instead of the current cpu.
*/
- if (tmp->flags & SD_SHARE_PKG_RESOURCES)
+ if (!cpu_idle && tmp->flags & SD_SHARE_PKG_RESOURCES)
target = select_idle_sibling(p, tmp, target);
if (target >= 0) {
if (tmp->flags & SD_WAKE_AFFINE) {
affine_sd = tmp;
want_affine = 0;
+ if (target != cpu)
+ cpu_idle = 1;
}
cpu = target;
}
@@ -1534,6 +1536,7 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
sd = tmp;
}
+#ifdef CONFIG_FAIR_GROUP_SCHED
if (sched_feat(LB_SHARES_UPDATE)) {
/*
* Pick the largest domain to update shares over
@@ -1550,9 +1553,12 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
raw_spin_lock(&rq->lock);
}
}
+#endif
- if (affine_sd && wake_affine(affine_sd, p, sync))
- return cpu;
+ if (affine_sd) {
+ if (cpu_idle || cpu == prev_cpu || wake_affine(affine_sd, p, sync))
+ return cpu;
+ }
while (sd) {
int load_idx = sd->forkexec_idx;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 094/260] sched: Pre-compute cpumask_weight(sched_domain_span(sd))
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (92 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 093/260] sched: Fix select_idle_sibling() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 095/260] sched: Fix select_idle_sibling() logic in select_task_rq_fair() Paul Gortmaker
` (167 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Peter Zijlstra, Ingo Molnar, Paul Gortmaker
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
commit 669c55e9f99b90e46eaa0f98a67ec53d46dc969a upstream.
Dave reported that his large SPARC machines spend lots of time in
hweight64(), try and optimize some of those needless cpumask_weight()
invocations (esp. with the large offstack cpumasks these are very
expensive indeed).
Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/sched.h | 1 +
kernel/sched.c | 3 +++
kernel/sched_fair.c | 12 +++++-------
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 25f9669..89e0fee 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -954,6 +954,7 @@ struct sched_domain {
char *name;
#endif
+ unsigned int span_weight;
/*
* Span of all CPUs in this domain.
*
diff --git a/kernel/sched.c b/kernel/sched.c
index 074c4d8..b741de5 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6296,6 +6296,9 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
struct rq *rq = cpu_rq(cpu);
struct sched_domain *tmp;
+ for (tmp = sd; tmp; tmp = tmp->parent)
+ tmp->span_weight = cpumask_weight(sched_domain_span(tmp));
+
/* Remove the sched domains which do not contribute to scheduling. */
for (tmp = sd; tmp; ) {
struct sched_domain *parent = tmp->parent;
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index ae4d842..a29df86 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1542,9 +1542,7 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
* Pick the largest domain to update shares over
*/
tmp = sd;
- if (affine_sd && (!tmp ||
- cpumask_weight(sched_domain_span(affine_sd)) >
- cpumask_weight(sched_domain_span(sd))))
+ if (affine_sd && (!tmp || affine_sd->span_weight > sd->span_weight))
tmp = affine_sd;
if (tmp) {
@@ -1588,10 +1586,10 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
/* Now try balancing at a lower domain level of new_cpu */
cpu = new_cpu;
- weight = cpumask_weight(sched_domain_span(sd));
+ weight = sd->span_weight;
sd = NULL;
for_each_domain(cpu, tmp) {
- if (weight <= cpumask_weight(sched_domain_span(tmp)))
+ if (weight <= tmp->span_weight)
break;
if (tmp->flags & sd_flag)
sd = tmp;
@@ -2323,7 +2321,7 @@ unsigned long __weak arch_scale_freq_power(struct sched_domain *sd, int cpu)
unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu)
{
- unsigned long weight = cpumask_weight(sched_domain_span(sd));
+ unsigned long weight = sd->span_weight;
unsigned long smt_gain = sd->smt_gain;
smt_gain /= weight;
@@ -2356,7 +2354,7 @@ unsigned long scale_rt_power(int cpu)
static void update_cpu_power(struct sched_domain *sd, int cpu)
{
- unsigned long weight = cpumask_weight(sched_domain_span(sd));
+ unsigned long weight = sd->span_weight;
unsigned long power = SCHED_LOAD_SCALE;
struct sched_group *sdg = sd->groups;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 095/260] sched: Fix select_idle_sibling() logic in select_task_rq_fair()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (93 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 094/260] sched: Pre-compute cpumask_weight(sched_domain_span(sd)) Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 096/260] ALSA: hda - Handle missing NID 0x1b on ALC259 codec Paul Gortmaker
` (166 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Suresh Siddha, Peter Zijlstra, Ingo Molnar,
Paul Gortmaker
From: Suresh Siddha <suresh.b.siddha@intel.com>
commit 99bd5e2f245d8cd17d040c82d40becdb3efd9b69 upstream.
Issues in the current select_idle_sibling() logic in select_task_rq_fair()
in the context of a task wake-up:
a) Once we select the idle sibling, we use that domain (spanning the cpu that
the task is currently woken-up and the idle sibling that we found) in our
wake_affine() decisions. This domain is completely different from the
domain(we are supposed to use) that spans the cpu that the task currently
woken-up and the cpu where the task previously ran.
b) We do select_idle_sibling() check only for the cpu that the task is
currently woken-up on. If select_task_rq_fair() selects the previously run
cpu for waking the task, doing a select_idle_sibling() check
for that cpu also helps and we don't do this currently.
c) In the scenarios where the cpu that the task is woken-up is busy but
with its HT siblings are idle, we are selecting the task be woken-up
on the idle HT sibling instead of a core that it previously ran
and currently completely idle. i.e., we are not taking decisions based on
wake_affine() but directly selecting an idle sibling that can cause
an imbalance at the SMT/MC level which will be later corrected by the
periodic load balancer.
Fix this by first going through the load imbalance calculations using
wake_affine() and once we make a decision of woken-up cpu vs previously-ran cpu,
then choose a possible idle sibling for waking up the task on.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1270079265.7835.8.camel@sbs-t61.sc.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched_fair.c | 82 +++++++++++++++++++++++++--------------------------
1 files changed, 40 insertions(+), 42 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index a29df86..72eb9a6 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1408,29 +1408,48 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
/*
* Try and locate an idle CPU in the sched_domain.
*/
-static int
-select_idle_sibling(struct task_struct *p, struct sched_domain *sd, int target)
+static int select_idle_sibling(struct task_struct *p, int target)
{
int cpu = smp_processor_id();
int prev_cpu = task_cpu(p);
+ struct sched_domain *sd;
int i;
/*
- * If this domain spans both cpu and prev_cpu (see the SD_WAKE_AFFINE
- * test in select_task_rq_fair) and the prev_cpu is idle then that's
- * always a better target than the current cpu.
+ * If the task is going to be woken-up on this cpu and if it is
+ * already idle, then it is the right target.
+ */
+ if (target == cpu && idle_cpu(cpu))
+ return cpu;
+
+ /*
+ * If the task is going to be woken-up on the cpu where it previously
+ * ran and if it is currently idle, then it the right target.
*/
- if (target == cpu && !cpu_rq(prev_cpu)->cfs.nr_running)
+ if (target == prev_cpu && idle_cpu(prev_cpu))
return prev_cpu;
/*
- * Otherwise, iterate the domain and find an elegible idle cpu.
+ * Otherwise, iterate the domains and find an elegible idle cpu.
*/
- for_each_cpu_and(i, sched_domain_span(sd), &p->cpus_allowed) {
- if (!cpu_rq(i)->cfs.nr_running) {
- target = i;
+ for_each_domain(target, sd) {
+ if (!(sd->flags & SD_SHARE_PKG_RESOURCES))
break;
+
+ for_each_cpu_and(i, sched_domain_span(sd), &p->cpus_allowed) {
+ if (idle_cpu(i)) {
+ target = i;
+ break;
+ }
}
+
+ /*
+ * Lets stop looking for an idle sibling when we reached
+ * the domain that spans the current cpu and prev_cpu.
+ */
+ if (cpumask_test_cpu(cpu, sched_domain_span(sd)) &&
+ cpumask_test_cpu(prev_cpu, sched_domain_span(sd)))
+ break;
}
return target;
@@ -1454,7 +1473,7 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
int cpu = smp_processor_id();
int prev_cpu = task_cpu(p);
int new_cpu = cpu;
- int want_affine = 0, cpu_idle = !current->pid;
+ int want_affine = 0;
int want_sd = 1;
int sync = wake_flags & WF_SYNC;
@@ -1494,36 +1513,13 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
}
/*
- * While iterating the domains looking for a spanning
- * WAKE_AFFINE domain, adjust the affine target to any idle cpu
- * in cache sharing domains along the way.
+ * If both cpu and prev_cpu are part of this domain,
+ * cpu is a valid SD_WAKE_AFFINE target.
*/
- if (want_affine) {
- int target = -1;
-
- /*
- * If both cpu and prev_cpu are part of this domain,
- * cpu is a valid SD_WAKE_AFFINE target.
- */
- if (cpumask_test_cpu(prev_cpu, sched_domain_span(tmp)))
- target = cpu;
-
- /*
- * If there's an idle sibling in this domain, make that
- * the wake_affine target instead of the current cpu.
- */
- if (!cpu_idle && tmp->flags & SD_SHARE_PKG_RESOURCES)
- target = select_idle_sibling(p, tmp, target);
-
- if (target >= 0) {
- if (tmp->flags & SD_WAKE_AFFINE) {
- affine_sd = tmp;
- want_affine = 0;
- if (target != cpu)
- cpu_idle = 1;
- }
- cpu = target;
- }
+ if (want_affine && (tmp->flags & SD_WAKE_AFFINE) &&
+ cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) {
+ affine_sd = tmp;
+ want_affine = 0;
}
if (!want_sd && !want_affine)
@@ -1554,8 +1550,10 @@ select_task_rq_fair(struct rq *rq, struct task_struct *p, int sd_flag, int wake_
#endif
if (affine_sd) {
- if (cpu_idle || cpu == prev_cpu || wake_affine(affine_sd, p, sync))
- return cpu;
+ if (cpu == prev_cpu || wake_affine(affine_sd, p, sync))
+ return select_idle_sibling(p, cpu);
+ else
+ return select_idle_sibling(p, prev_cpu);
}
while (sd) {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 096/260] ALSA: hda - Handle missing NID 0x1b on ALC259 codec
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (94 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 095/260] sched: Fix select_idle_sibling() logic in select_task_rq_fair() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 097/260] ALSA: hda - Handle pin NID 0x1a on ALC259/269 Paul Gortmaker
` (165 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Takashi Iwai, Paul Gortmaker
From: Takashi Iwai <tiwai@suse.de>
commit 5d4abf93ea3192cc666430225a29a4978c97c57d upstream.
Since ALC259/269 use the same parser of ALC268, the pin 0x1b was ignored
as an invalid widget. Just add this NID to handle properly.
This will add the missing mixer controls for some devices.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/pci/hda/patch_realtek.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f310f3c..1df35cd 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -12911,6 +12911,7 @@ static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid,
dac = 0x02;
break;
case 0x15:
+ case 0x1b:
case 0x21: /* ALC269vb has this pin, too */
dac = 0x03;
break;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 097/260] ALSA: hda - Handle pin NID 0x1a on ALC259/269
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (95 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 096/260] ALSA: hda - Handle missing NID 0x1b on ALC259 codec Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 098/260] arm: fix really nasty sigreturn bug Paul Gortmaker
` (164 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Takashi Iwai, Paul Gortmaker
From: Takashi Iwai <tiwai@suse.de>
commit b08b1637ce1c0196970348bcabf40f04b6b3d58e upstream.
The pin NID 0x1a should be handled as well as NID 0x1b.
Also added comments.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/pci/hda/patch_realtek.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 1df35cd..7b516f1 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -12911,7 +12911,8 @@ static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid,
dac = 0x02;
break;
case 0x15:
- case 0x1b:
+ case 0x1a: /* ALC259/269 only */
+ case 0x1b: /* ALC259/269 only */
case 0x21: /* ALC269vb has this pin, too */
dac = 0x03;
break;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 098/260] arm: fix really nasty sigreturn bug
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (96 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 097/260] ALSA: hda - Handle pin NID 0x1a on ALC259/269 Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 099/260] hwmon: (f75375s) Shift control mode to the correct bit position Paul Gortmaker
` (163 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Al Viro, Linus Torvalds, Paul Gortmaker
From: Al Viro <viro@zeniv.linux.org.uk>
commit 653d48b22166db2d8b1515ebe6f9f0f7c95dfc86 upstream.
If a signal hits us outside of a syscall and another gets delivered
when we are in sigreturn (e.g. because it had been in sa_mask for
the first one and got sent to us while we'd been in the first handler),
we have a chance of returning from the second handler to location one
insn prior to where we ought to return. If r0 happens to contain -513
(-ERESTARTNOINTR), sigreturn will get confused into doing restart
syscall song and dance.
Incredible joy to debug, since it manifests as random, infrequent and
very hard to reproduce double execution of instructions in userland
code...
The fix is simple - mark it "don't bother with restarts" in wrapper,
i.e. set r8 to 0 in sys_sigreturn and sys_rt_sigreturn wrappers,
suppressing the syscall restart handling on return from these guys.
They can't legitimately return a restart-worthy error anyway.
Testcase:
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/time.h>
#include <errno.h>
void f(int n)
{
__asm__ __volatile__(
"ldr r0, [%0]\n"
"b 1f\n"
"b 2f\n"
"1:b .\n"
"2:\n" : : "r"(&n));
}
void handler1(int sig) { }
void handler2(int sig) { raise(1); }
void handler3(int sig) { exit(0); }
main()
{
struct sigaction s = {.sa_handler = handler2};
struct itimerval t1 = { .it_value = {1} };
struct itimerval t2 = { .it_value = {2} };
signal(1, handler1);
sigemptyset(&s.sa_mask);
sigaddset(&s.sa_mask, 1);
sigaction(SIGALRM, &s, NULL);
signal(SIGVTALRM, handler3);
setitimer(ITIMER_REAL, &t1, NULL);
setitimer(ITIMER_VIRTUAL, &t2, NULL);
f(-513); /* -ERESTARTNOINTR */
write(1, "buggered\n", 9);
return 1;
}
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/arm/kernel/entry-common.S | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 2c1db77..a6c66f5 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -382,11 +382,13 @@ ENDPROC(sys_clone_wrapper)
sys_sigreturn_wrapper:
add r0, sp, #S_OFF
+ mov why, #0 @ prevent syscall restart handling
b sys_sigreturn
ENDPROC(sys_sigreturn_wrapper)
sys_rt_sigreturn_wrapper:
add r0, sp, #S_OFF
+ mov why, #0 @ prevent syscall restart handling
b sys_rt_sigreturn
ENDPROC(sys_rt_sigreturn_wrapper)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 099/260] hwmon: (f75375s) Shift control mode to the correct bit position
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (97 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 098/260] arm: fix really nasty sigreturn bug Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 100/260] hwmon: (f75375s) Do not overwrite values read from registers Paul Gortmaker
` (162 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Guillem Jover, Riku Voipio, Jean Delvare,
Paul Gortmaker
From: Guillem Jover <guillem@hadrons.org>
commit 96f3640894012be7dd15a384566bfdc18297bc6c upstream.
The spec notes that fan0 and fan1 control mode bits are located in bits
7-6 and 5-4 respectively, but the FAN_CTRL_MODE macro was making the
bits shift by 5 instead of by 4.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/hwmon/f75375s.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index bad2cf3..303160c 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -79,7 +79,7 @@ enum chips { f75373, f75375 };
#define F75375_REG_PWM2_DROP_DUTY 0x6C
#define FAN_CTRL_LINEAR(nr) (4 + nr)
-#define FAN_CTRL_MODE(nr) (5 + ((nr) * 2))
+#define FAN_CTRL_MODE(nr) (4 + ((nr) * 2))
/*
* Data structures and manipulation thereof
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 100/260] hwmon: (f75375s) Do not overwrite values read from registers
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (98 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 099/260] hwmon: (f75375s) Shift control mode to the correct bit position Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 101/260] apm_power: Add missing break statement Paul Gortmaker
` (161 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Guillem Jover, Riku Voipio, Jean Delvare,
Paul Gortmaker
From: Guillem Jover <guillem@hadrons.org>
commit c3b327d60bbba3f5ff8fd87d1efc0e95eb6c121b upstream.
All bits in the values read from registers to be used for the next
write were getting overwritten, avoid doing so to not mess with the
current configuration.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/hwmon/f75375s.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index 303160c..72afd06 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -298,7 +298,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
return -EINVAL;
fanmode = f75375_read8(client, F75375_REG_FAN_TIMER);
- fanmode = ~(3 << FAN_CTRL_MODE(nr));
+ fanmode &= ~(3 << FAN_CTRL_MODE(nr));
switch (val) {
case 0: /* Full speed */
@@ -350,7 +350,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr,
mutex_lock(&data->update_lock);
conf = f75375_read8(client, F75375_REG_CONFIG1);
- conf = ~(1 << FAN_CTRL_LINEAR(nr));
+ conf &= ~(1 << FAN_CTRL_LINEAR(nr));
if (val == 0)
conf |= (1 << FAN_CTRL_LINEAR(nr)) ;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 101/260] apm_power: Add missing break statement
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (99 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 100/260] hwmon: (f75375s) Do not overwrite values read from registers Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 102/260] NFS: Fix a typo in nfs_sockaddr_match_ipaddr6 Paul Gortmaker
` (160 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Anton Vorontsov, Paul Gortmaker
From: Anton Vorontsov <cbouatmailru@gmail.com>
commit 1d220334d6a8a711149234dc5f98d34ae02226b8 upstream.
The missing break statement causes wrong capacity calculation for
batteries that report energy.
Reported-by: d binderman <dcb314@hotmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/power/apm_power.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c
index 936bae5..dc628cb 100644
--- a/drivers/power/apm_power.c
+++ b/drivers/power/apm_power.c
@@ -233,6 +233,7 @@ static int calculate_capacity(enum apm_source source)
empty_design_prop = POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN;
now_prop = POWER_SUPPLY_PROP_ENERGY_NOW;
avg_prop = POWER_SUPPLY_PROP_ENERGY_AVG;
+ break;
case SOURCE_VOLTAGE:
full_prop = POWER_SUPPLY_PROP_VOLTAGE_MAX;
empty_prop = POWER_SUPPLY_PROP_VOLTAGE_MIN;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 102/260] NFS: Fix a typo in nfs_sockaddr_match_ipaddr6
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (100 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 101/260] apm_power: Add missing break statement Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 103/260] SUNRPC: Fix race corrupting rpc upcall Paul Gortmaker
` (159 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Trond Myklebust, Paul Gortmaker
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit b20d37ca9561711c6a3c4b859c2855f49565e061 upstream.
Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/nfs/client.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index acc9c49..5f3fb75 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -274,7 +274,7 @@ static int nfs_sockaddr_match_ipaddr6(const struct sockaddr *sa1,
sin1->sin6_scope_id != sin2->sin6_scope_id)
return 0;
- return ipv6_addr_equal(&sin1->sin6_addr, &sin1->sin6_addr);
+ return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);
}
#else /* !defined(CONFIG_IPV6) && !defined(CONFIG_IPV6_MODULE) */
static int nfs_sockaddr_match_ipaddr6(const struct sockaddr *sa1,
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 103/260] SUNRPC: Fix race corrupting rpc upcall
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (101 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 102/260] NFS: Fix a typo in nfs_sockaddr_match_ipaddr6 Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 104/260] i915: return -EFAULT if copy_to_user fails Paul Gortmaker
` (158 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Trond Myklebust, Paul Gortmaker
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit 5a67657a2e90c9e4a48518f95d4ba7777aa20fbb upstream.
If rpc_queue_upcall() adds a new upcall to the rpci->pipe list just
after rpc_pipe_release calls rpc_purge_list(), but before it calls
gss_pipe_release (as rpci->ops->release_pipe(inode)), then the latter
will free a message without deleting it from the rpci->pipe list.
We will be left with a freed object on the rpc->pipe list. Most
frequent symptoms are kernel crashes in rpc.gssd system calls on the
pipe in question.
Reported-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/sunrpc/auth_gss/auth_gss.c | 9 +++++----
net/sunrpc/rpc_pipe.c | 6 +++---
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index c389ccf..c369ea6 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -724,17 +724,18 @@ gss_pipe_release(struct inode *inode)
struct rpc_inode *rpci = RPC_I(inode);
struct gss_upcall_msg *gss_msg;
+restart:
spin_lock(&inode->i_lock);
- while (!list_empty(&rpci->in_downcall)) {
+ list_for_each_entry(gss_msg, &rpci->in_downcall, list) {
- gss_msg = list_entry(rpci->in_downcall.next,
- struct gss_upcall_msg, list);
+ if (!list_empty(&gss_msg->msg.list))
+ continue;
gss_msg->msg.errno = -EPIPE;
atomic_inc(&gss_msg->count);
__gss_unhash_msg(gss_msg);
spin_unlock(&inode->i_lock);
gss_release_msg(gss_msg);
- spin_lock(&inode->i_lock);
+ goto restart;
}
spin_unlock(&inode->i_lock);
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 20e30c6..dbf50f9 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -47,7 +47,7 @@ static void rpc_purge_list(struct rpc_inode *rpci, struct list_head *head,
return;
do {
msg = list_entry(head->next, struct rpc_pipe_msg, list);
- list_del(&msg->list);
+ list_del_init(&msg->list);
msg->errno = err;
destroy_msg(msg);
} while (!list_empty(head));
@@ -207,7 +207,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
if (msg != NULL) {
spin_lock(&inode->i_lock);
msg->errno = -EAGAIN;
- list_del(&msg->list);
+ list_del_init(&msg->list);
spin_unlock(&inode->i_lock);
rpci->ops->destroy_msg(msg);
}
@@ -267,7 +267,7 @@ rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset)
if (res < 0 || msg->len == msg->copied) {
filp->private_data = NULL;
spin_lock(&inode->i_lock);
- list_del(&msg->list);
+ list_del_init(&msg->list);
spin_unlock(&inode->i_lock);
rpci->ops->destroy_msg(msg);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 104/260] i915: return -EFAULT if copy_to_user fails
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (102 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 103/260] SUNRPC: Fix race corrupting rpc upcall Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 105/260] " Paul Gortmaker
` (157 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, Chris Wilson, Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit 9927a403ca8c97798129953fa9cbb5dc259c7cb9 upstream.
copy_to_user returns the number of bytes remaining to be copied, but we
want to return a negative error code here. These are returned to
userspace.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/gpu/drm/i915/i915_dma.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 9550230..b0ac371 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -691,8 +691,10 @@ static int i915_batchbuffer(struct drm_device *dev, void *data,
ret = copy_from_user(cliprects, batch->cliprects,
batch->num_cliprects *
sizeof(struct drm_clip_rect));
- if (ret != 0)
+ if (ret != 0) {
+ ret = -EFAULT;
goto fail_free;
+ }
}
mutex_lock(&dev->struct_mutex);
@@ -733,8 +735,10 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data,
return -ENOMEM;
ret = copy_from_user(batch_data, cmdbuf->buf, cmdbuf->sz);
- if (ret != 0)
+ if (ret != 0) {
+ ret = -EFAULT;
goto fail_batch_free;
+ }
if (cmdbuf->num_cliprects) {
cliprects = kcalloc(cmdbuf->num_cliprects,
@@ -747,8 +751,10 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data,
ret = copy_from_user(cliprects, cmdbuf->cliprects,
cmdbuf->num_cliprects *
sizeof(struct drm_clip_rect));
- if (ret != 0)
+ if (ret != 0) {
+ ret = -EFAULT;
goto fail_clip_free;
+ }
}
mutex_lock(&dev->struct_mutex);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 105/260] i915: return -EFAULT if copy_to_user fails
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (103 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 104/260] i915: return -EFAULT if copy_to_user fails Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 106/260] drm/i915: Prevent double dpms on Paul Gortmaker
` (156 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, Chris Wilson, Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit c877cdce93a44eea96f6cf7fc04be7d0372db2be upstream.
copy_to_user() returns the number of bytes remaining to be copied and
I'm pretty sure we want to return a negative error code here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/gpu/drm/i915/i915_gem.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 37a9ea3..e07722a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3818,6 +3818,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
if (ret != 0) {
DRM_ERROR("copy %d cliprects failed: %d\n",
args->num_cliprects, ret);
+ ret = -EFAULT;
goto pre_mutex_err;
}
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 106/260] drm/i915: Prevent double dpms on
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (104 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 105/260] " Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 107/260] drm: Only decouple the old_fb from the crtc is we call mode_set* Paul Gortmaker
` (155 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Chris Wilson, Paul Gortmaker
From: Chris Wilson <chris@chris-wilson.co.uk>
commit 032d2a0d068b0368296a56469761394ef03207c3 upstream.
Arguably this is a bug in drm-core in that we should not be called twice
in succession with DPMS_ON, however this is still occuring and we see
FDI link training failures on the second call leading to the occassional
blank display. For the time being ignore the repeated call.
Original patch by Dave Airlie <airlied@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/gpu/drm/i915/intel_display.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 66eb458..28eebc5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2059,6 +2059,9 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
int pipe = intel_crtc->pipe;
bool enabled;
+ if (intel_crtc->dpms_mode == mode)
+ return;
+
dev_priv->display.dpms(crtc, mode);
intel_crtc->dpms_mode = mode;
@@ -4389,7 +4392,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = &intel_crtc->base;
intel_crtc->cursor_addr = 0;
- intel_crtc->dpms_mode = DRM_MODE_DPMS_OFF;
+ intel_crtc->dpms_mode = -1;
drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);
intel_crtc->busy = false;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 107/260] drm: Only decouple the old_fb from the crtc is we call mode_set*
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (105 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 106/260] drm/i915: Prevent double dpms on Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 108/260] tun: Don't add sysfs attributes to devices without sysfs directories Paul Gortmaker
` (154 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Chris Wilson, Dave Airlie, Paul Gortmaker
From: Chris Wilson <chris@chris-wilson.co.uk>
commit 356ad3cd616185631235ffb48b3efbf39f9923b3 upstream.
Otherwise when disabling the output we switch to the new fb (which is
likely NULL) and skip the call to mode_set -- leaking driver private
state on the old_fb.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29857
Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/gpu/drm/drm_crtc_helper.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 51103aa..220177a 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -921,13 +921,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
mode_changed = true;
if (mode_changed) {
- old_fb = set->crtc->fb;
- set->crtc->fb = set->fb;
set->crtc->enabled = (set->mode != NULL);
if (set->mode != NULL) {
DRM_DEBUG_KMS("attempting to set mode from"
" userspace\n");
drm_mode_debug_printmodeline(set->mode);
+ old_fb = set->crtc->fb;
+ set->crtc->fb = set->fb;
if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
set->x, set->y,
old_fb)) {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 108/260] tun: Don't add sysfs attributes to devices without sysfs directories
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (106 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 107/260] drm: Only decouple the old_fb from the crtc is we call mode_set* Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 109/260] USB: serial/mos*: prevent reading uninitialized stack memory Paul Gortmaker
` (153 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ben Hutchings, Greg Kroah-Hartman, Paul Gortmaker
From: Ben Hutchings <ben@decadent.org.uk>
This applies to 2.6.32 *only*. It has not been applied upstream since
the limitation no longer exists.
Prior to Linux 2.6.35, net devices outside the initial net namespace
did not have sysfs directories. Attempting to add attributes to
them will trigger a BUG().
Reported-and-tested-by: Russell Stuart <russell-debian@stuart.id.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/tun.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 4326520..7b4a88b 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1061,7 +1061,8 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
if (err < 0)
goto err_free_sk;
- if (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
+ if (!net_eq(dev_net(tun->dev), &init_net) ||
+ device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
device_create_file(&tun->dev->dev, &dev_attr_owner) ||
device_create_file(&tun->dev->dev, &dev_attr_group))
printk(KERN_ERR "Failed to create tun sysfs files\n");
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 109/260] USB: serial/mos*: prevent reading uninitialized stack memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (107 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 108/260] tun: Don't add sysfs attributes to devices without sysfs directories Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 110/260] gro: fix different skb headrooms Paul Gortmaker
` (152 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Dan Rosenberg, Greg Kroah-Hartman,
Paul Gortmaker
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit a0846f1868b11cd827bdfeaf4527d8b1b1c0b098 upstream.
The TIOCGICOUNT device ioctl in both mos7720.c and mos7840.c allows
unprivileged users to read uninitialized stack memory, because the
"reserved" member of the serial_icounter_struct struct declared on the
stack is not altered or zeroed before being copied back to the user.
This patch takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/mos7720.c | 3 +++
drivers/usb/serial/mos7840.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 0d47f2c..623a6d3 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1566,6 +1566,9 @@ static int mos7720_ioctl(struct tty_struct *tty, struct file *file,
case TIOCGICOUNT:
cnow = mos7720_port->icount;
+
+ memset(&icount, 0, sizeof(struct serial_icounter_struct));
+
icount.cts = cnow.cts;
icount.dsr = cnow.dsr;
icount.rng = cnow.rng;
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index a73f2f5..16f0548 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2286,6 +2286,9 @@ static int mos7840_ioctl(struct tty_struct *tty, struct file *file,
case TIOCGICOUNT:
cnow = mos7840_port->icount;
smp_rmb();
+
+ memset(&icount, 0, sizeof(struct serial_icounter_struct));
+
icount.cts = cnow.cts;
icount.dsr = cnow.dsr;
icount.rng = cnow.rng;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 110/260] gro: fix different skb headrooms
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (108 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 109/260] USB: serial/mos*: prevent reading uninitialized stack memory Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 111/260] gro: Re-fix " Paul Gortmaker
` (151 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Dumazet, Jarek Poplawski, David S. Miller,
Paul Gortmaker
From: Eric Dumazet <eric.dumazet@gmail.com>
commit 3d3be4333fdf6faa080947b331a6a19bce1a4f57 upstream.
Packets entering GRO might have different headrooms, even for a given
flow (because of implementation details in drivers, like copybreak).
We cant force drivers to deliver packets with a fixed headroom.
1) fix skb_segment()
skb_segment() makes the false assumption headrooms of fragments are same
than the head. When CHECKSUM_PARTIAL is used, this can give csum_start
errors, and crash later in skb_copy_and_csum_dev()
2) allocate a minimal skb for head of frag_list
skb_gro_receive() uses netdev_alloc_skb(headroom + skb_gro_offset(p)) to
allocate a fresh skb. This adds NET_SKB_PAD to a padding already
provided by netdevice, depending on various things, like copybreak.
Use alloc_skb() to allocate an exact padding, to reduce cache line
needs:
NET_SKB_PAD + NET_IP_ALIGN
bugzilla : https://bugzilla.kernel.org/show_bug.cgi?id=16626
Many thanks to Plamen Petrov, testing many debugging patches !
With help of Jarek Poplawski.
Reported-by: Plamen Petrov <pvp-lsts@fs.uni-ruse.bg>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/core/skbuff.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index cad8e97..c1c86f5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2578,6 +2578,10 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
__copy_skb_header(nskb, skb);
nskb->mac_len = skb->mac_len;
+ /* nskb and skb might have different headroom */
+ if (nskb->ip_summed == CHECKSUM_PARTIAL)
+ nskb->csum_start += skb_headroom(nskb) - headroom;
+
skb_reset_mac_header(nskb);
skb_set_network_header(nskb, skb->mac_len);
nskb->transport_header = (nskb->network_header +
@@ -2707,8 +2711,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
} else if (skb_gro_len(p) != pinfo->gso_size)
return -E2BIG;
- headroom = skb_headroom(p);
- nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p));
+ headroom = NET_SKB_PAD + NET_IP_ALIGN;
+ nskb = alloc_skb(headroom + skb_gro_offset(p), GFP_ATOMIC);
if (unlikely(!nskb))
return -ENOMEM;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 111/260] gro: Re-fix different skb headrooms
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (109 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 110/260] gro: fix different skb headrooms Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 112/260] irda: Correctly clean up self->ias_obj on irda_bind() failure Paul Gortmaker
` (150 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jarek Poplawski, Eric Dumazet, David S. Miller,
Paul Gortmaker
From: Jarek Poplawski <jarkao2@gmail.com>
commit 64289c8e6851bca0e589e064c9a5c9fbd6ae5dd4 upstream.
The patch: "gro: fix different skb headrooms" in its part:
"2) allocate a minimal skb for head of frag_list" is buggy. The copied
skb has p->data set at the ip header at the moment, and skb_gro_offset
is the length of ip + tcp headers. So, after the change the length of
mac header is skipped. Later skb_set_mac_header() sets it into the
NET_SKB_PAD area (if it's long enough) and ip header is misaligned at
NET_SKB_PAD + NET_IP_ALIGN offset. There is no reason to assume the
original skb was wrongly allocated, so let's copy it as it was.
bugzilla : https://bugzilla.kernel.org/show_bug.cgi?id=16626
fixes commit: 3d3be4333fdf6faa080947b331a6a19bce1a4f57
Reported-by: Plamen Petrov <pvp-lsts@fs.uni-ruse.bg>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Plamen Petrov <pvp-lsts@fs.uni-ruse.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/core/skbuff.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c1c86f5..9e7214e 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2711,7 +2711,7 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
} else if (skb_gro_len(p) != pinfo->gso_size)
return -E2BIG;
- headroom = NET_SKB_PAD + NET_IP_ALIGN;
+ headroom = skb_headroom(p);
nskb = alloc_skb(headroom + skb_gro_offset(p), GFP_ATOMIC);
if (unlikely(!nskb))
return -ENOMEM;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 112/260] irda: Correctly clean up self->ias_obj on irda_bind() failure.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (110 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 111/260] gro: Re-fix " Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 113/260] tcp: select(writefds) don't hang up when a peer close connection Paul Gortmaker
` (149 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, David S. Miller, Paul Gortmaker
From: David S. Miller <davem@davemloft.net>
commit 628e300cccaa628d8fb92aa28cb7530a3d5f2257 upstream.
If irda_open_tsap() fails, the irda_bind() code tries to destroy
the ->ias_obj object by hand, but does so wrongly.
In particular, it fails to a) release the hashbin attached to the
object and b) reset the self->ias_obj pointer to NULL.
Fix both problems by using irias_delete_object() and explicitly
setting self->ias_obj to NULL, just as irda_release() does.
Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/irda/af_irda.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 2a4efce..6fae047 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -824,8 +824,8 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name);
if (err < 0) {
- kfree(self->ias_obj->name);
- kfree(self->ias_obj);
+ irias_delete_object(self->ias_obj);
+ self->ias_obj = NULL;
goto out;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 113/260] tcp: select(writefds) don't hang up when a peer close connection
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (111 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 112/260] irda: Correctly clean up self->ias_obj on irda_bind() failure Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 114/260] tcp: Combat per-cpu skew in orphan tests Paul Gortmaker
` (148 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, KOSAKI Motohiro, David S. Miller, Paul Gortmaker
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
commit d84ba638e4ba3c40023ff997aa5e8d3ed002af36 upstream.
This issue come from ruby language community. Below test program
hang up when only run on Linux.
% uname -mrsv
Linux 2.6.26-2-486 #1 Sat Dec 26 08:37:39 UTC 2009 i686
% ruby -rsocket -ve '
BasicSocket.do_not_reverse_lookup = true
serv = TCPServer.open("127.0.0.1", 0)
s1 = TCPSocket.open("127.0.0.1", serv.addr[1])
s2 = serv.accept
s2.close
s1.write("a") rescue p $!
s1.write("a") rescue p $!
Thread.new {
s1.write("a")
}.join'
ruby 1.9.3dev (2010-07-06 trunk 28554) [i686-linux]
#<Errno::EPIPE: Broken pipe>
[Hang Here]
FreeBSD, Solaris, Mac doesn't. because Ruby's write() method call
select() internally. and tcp_poll has a bug.
SUS defined 'ready for writing' of select() as following.
| A descriptor shall be considered ready for writing when a call to an output
| function with O_NONBLOCK clear would not block, whether or not the function
| would transfer data successfully.
That said, EPIPE situation is clearly one of 'ready for writing'.
We don't have read-side issue because tcp_poll() already has read side
shutdown care.
| if (sk->sk_shutdown & RCV_SHUTDOWN)
| mask |= POLLIN | POLLRDNORM | POLLRDHUP;
So, Let's insert same logic in write side.
- reference url
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/31065
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/31068
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/ipv4/tcp.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4fbf481..205ea31 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -453,7 +453,8 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk))
mask |= POLLOUT | POLLWRNORM;
}
- }
+ } else
+ mask |= POLLOUT | POLLWRNORM;
if (tp->urg_data & TCP_URG_VALID)
mask |= POLLPRI;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 114/260] tcp: Combat per-cpu skew in orphan tests.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (112 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 113/260] tcp: select(writefds) don't hang up when a peer close connection Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 115/260] tcp: fix three tcp sysctls tuning Paul Gortmaker
` (147 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, David S. Miller, Paul Gortmaker
From: David S. Miller <davem@davemloft.net>
commit ad1af0fedba14f82b240a03fe20eb9b2fdbd0357 upstream.
As reported by Anton Blanchard when we use
percpu_counter_read_positive() to make our orphan socket limit checks,
the check can be off by up to num_cpus_online() * batch (which is 32
by default) which on a 128 cpu machine can be as large as the default
orphan limit itself.
Fix this by doing the full expensive sum check if the optimized check
triggers.
Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/net/tcp.h | 18 ++++++++++++++----
net/ipv4/tcp.c | 5 +----
net/ipv4/tcp_timer.c | 8 ++++----
3 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index aa04b9a..cae8c39 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -268,11 +268,21 @@ static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
return seq3 - seq2 >= seq1 - seq2;
}
-static inline int tcp_too_many_orphans(struct sock *sk, int num)
+static inline bool tcp_too_many_orphans(struct sock *sk, int shift)
{
- return (num > sysctl_tcp_max_orphans) ||
- (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
- atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]);
+ struct percpu_counter *ocp = sk->sk_prot->orphan_count;
+ int orphans = percpu_counter_read_positive(ocp);
+
+ if (orphans << shift > sysctl_tcp_max_orphans) {
+ orphans = percpu_counter_sum_positive(ocp);
+ if (orphans << shift > sysctl_tcp_max_orphans)
+ return true;
+ }
+
+ if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
+ atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])
+ return true;
+ return false;
}
/* syncookies: remember time of last synqueue overflow */
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 205ea31..692f424 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2002,11 +2002,8 @@ adjudge_to_death:
}
}
if (sk->sk_state != TCP_CLOSE) {
- int orphan_count = percpu_counter_read_positive(
- sk->sk_prot->orphan_count);
-
sk_mem_reclaim(sk);
- if (tcp_too_many_orphans(sk, orphan_count)) {
+ if (tcp_too_many_orphans(sk, 0)) {
if (net_ratelimit())
printk(KERN_INFO "TCP: too many of orphaned "
"sockets\n");
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 8a0ab29..d252af7 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -67,18 +67,18 @@ static void tcp_write_err(struct sock *sk)
static int tcp_out_of_resources(struct sock *sk, int do_reset)
{
struct tcp_sock *tp = tcp_sk(sk);
- int orphans = percpu_counter_read_positive(&tcp_orphan_count);
+ int shift = 0;
/* If peer does not open window for long time, or did not transmit
* anything for long time, penalize it. */
if ((s32)(tcp_time_stamp - tp->lsndtime) > 2*TCP_RTO_MAX || !do_reset)
- orphans <<= 1;
+ shift++;
/* If some dubious ICMP arrived, penalize even more. */
if (sk->sk_err_soft)
- orphans <<= 1;
+ shift++;
- if (tcp_too_many_orphans(sk, orphans)) {
+ if (tcp_too_many_orphans(sk, shift)) {
if (net_ratelimit())
printk(KERN_INFO "Out of socket memory\n");
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 115/260] tcp: fix three tcp sysctls tuning
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (113 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 114/260] tcp: Combat per-cpu skew in orphan tests Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 116/260] bridge: Clear IPCB before possible entry into IP stack Paul Gortmaker
` (146 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Dumazet, David S. Miller, Paul Gortmaker
From: Eric Dumazet <eric.dumazet@gmail.com>
commit c5ed63d66f24fd4f7089b5a6e087b0ce7202aa8e upstream.
As discovered by Anton Blanchard, current code to autotune
tcp_death_row.sysctl_max_tw_buckets, sysctl_tcp_max_orphans and
sysctl_max_syn_backlog makes little sense.
The bigger a page is, the less tcp_max_orphans is : 4096 on a 512GB
machine in Anton's case.
(tcp_hashinfo.bhash_size * sizeof(struct inet_bind_hashbucket))
is much bigger if spinlock debugging is on. Its wrong to select bigger
limits in this case (where kernel structures are also bigger)
bhash_size max is 65536, and we get this value even for small machines.
A better ground is to use size of ehash table, this also makes code
shorter and more obvious.
Based on a patch from Anton, and another from David.
Reported-and-tested-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/ipv4/tcp.c | 24 +++++++-----------------
1 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 692f424..4a638f0 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3192,7 +3192,7 @@ void __init tcp_init(void)
{
struct sk_buff *skb = NULL;
unsigned long nr_pages, limit;
- int order, i, max_share;
+ int i, max_share, cnt;
unsigned long jiffy = jiffies;
BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb));
@@ -3241,22 +3241,12 @@ void __init tcp_init(void)
INIT_HLIST_HEAD(&tcp_hashinfo.bhash[i].chain);
}
- /* Try to be a bit smarter and adjust defaults depending
- * on available memory.
- */
- for (order = 0; ((1 << order) << PAGE_SHIFT) <
- (tcp_hashinfo.bhash_size * sizeof(struct inet_bind_hashbucket));
- order++)
- ;
- if (order >= 4) {
- tcp_death_row.sysctl_max_tw_buckets = 180000;
- sysctl_tcp_max_orphans = 4096 << (order - 4);
- sysctl_max_syn_backlog = 1024;
- } else if (order < 3) {
- tcp_death_row.sysctl_max_tw_buckets >>= (3 - order);
- sysctl_tcp_max_orphans >>= (3 - order);
- sysctl_max_syn_backlog = 128;
- }
+
+ cnt = tcp_hashinfo.ehash_mask + 1;
+
+ tcp_death_row.sysctl_max_tw_buckets = cnt / 2;
+ sysctl_tcp_max_orphans = cnt / 2;
+ sysctl_max_syn_backlog = max(128, cnt / 256);
/* Set the pressure threshold to be a fraction of global memory that
* is up to 1/2 at 256 MB, decreasing toward zero with the amount of
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 116/260] bridge: Clear IPCB before possible entry into IP stack
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (114 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 115/260] tcp: fix three tcp sysctls tuning Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 117/260] bridge: Clear INET control block of SKBs passed into ip_fragment() Paul Gortmaker
` (145 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Herbert Xu, David S. Miller, Paul Gortmaker
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 17762060c25590bfddd68cc1131f28ec720f405f upstream.
The bridge protocol lives dangerously by having incestuous relations
with the IP stack. In this instance an abomination has been created
where a bogus IPCB area from a bridged packet leads to a crash in
the IP stack because it's interpreted as IP options.
This patch papers over the problem by clearing the IPCB area in that
particular spot. To fix this properly we'd also need to parse any
IP options if present but I'm way too lazy for that.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/bridge/br_netfilter.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 4c4977d..54d812e 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -601,6 +601,9 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff *skb,
pskb_trim_rcsum(skb, len);
+ /* BUG: Should really parse the IP options here. */
+ memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
+
nf_bridge_put(skb->nf_bridge);
if (!nf_bridge_alloc(skb))
return NF_DROP;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 117/260] bridge: Clear INET control block of SKBs passed into ip_fragment().
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (115 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 116/260] bridge: Clear IPCB before possible entry into IP stack Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 118/260] rds: fix a leak of kernel memory Paul Gortmaker
` (144 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, David S. Miller, Paul Gortmaker
From: David S. Miller <davem@davemloft.net>
commit 87f94b4e91dc042620c527f3c30c37e5127ef757 upstream.
In a similar vain to commit 17762060c25590bfddd68cc1131f28ec720f405f
("bridge: Clear IPCB before possible entry into IP stack")
Any time we call into the IP stack we have to make sure the state
there is as expected by the ipv4 code.
With help from Eric Dumazet and Herbert Xu.
Reported-by: Bandan Das <bandan.das@stratus.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/bridge/br_netfilter.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 54d812e..641d662 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -801,9 +801,11 @@ static int br_nf_dev_queue_xmit(struct sk_buff *skb)
if (skb->nfct != NULL &&
(skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb)) &&
skb->len > skb->dev->mtu &&
- !skb_is_gso(skb))
+ !skb_is_gso(skb)) {
+ /* BUG: Should really parse the IP options here. */
+ memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
return ip_fragment(skb, br_dev_queue_push_xmit);
- else
+ } else
return br_dev_queue_push_xmit(skb);
}
#else
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 118/260] rds: fix a leak of kernel memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (116 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 117/260] bridge: Clear INET control block of SKBs passed into ip_fragment() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 119/260] tcp: Prevent overzealous packetization by SWS logic Paul Gortmaker
` (143 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Dumazet, Andy Grover, David S. Miller,
Paul Gortmaker
From: Eric Dumazet <eric.dumazet@gmail.com>
commit f037590fff3005ce8a1513858d7d44f50053cc8f upstream.
struct rds_rdma_notify contains a 32 bits hole on 64bit arches,
make sure it is zeroed before copying it to user.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/rds/recv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/rds/recv.c b/net/rds/recv.c
index e2a2b93..93aadc0 100644
--- a/net/rds/recv.c
+++ b/net/rds/recv.c
@@ -297,7 +297,7 @@ static int rds_still_queued(struct rds_sock *rs, struct rds_incoming *inc,
int rds_notify_queue_get(struct rds_sock *rs, struct msghdr *msghdr)
{
struct rds_notifier *notifier;
- struct rds_rdma_notify cmsg;
+ struct rds_rdma_notify cmsg = { 0 }; /* fill holes with zero */
unsigned int count = 0, max_messages = ~0U;
unsigned long flags;
LIST_HEAD(copy);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 119/260] tcp: Prevent overzealous packetization by SWS logic.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (117 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 118/260] rds: fix a leak of kernel memory Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 120/260] UNIX: Do not loop forever at unix_autobind() Paul Gortmaker
` (142 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Alexey Kuznetsov, David S. Miller, Paul Gortmaker
From: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
commit 01f83d69844d307be2aa6fea88b0e8fe5cbdb2f4 upstream.
If peer uses tiny MSS (say, 75 bytes) and similarly tiny advertised
window, the SWS logic will packetize to half the MSS unnecessarily.
This causes problems with some embedded devices.
However for large MSS devices we do want to half-MSS packetize
otherwise we never get enough packets into the pipe for things
like fast retransmit and recovery to work.
Be careful also to handle the case where MSS > window, otherwise
we'll never send until the probe timer.
Reported-by: ツ Leandro Melo de Sales <leandroal@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/net/tcp.h | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cae8c39..91cdffd 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -518,8 +518,22 @@ extern unsigned int tcp_current_mss(struct sock *sk);
/* Bound MSS / TSO packet size with the half of the window */
static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
{
- if (tp->max_window && pktsize > (tp->max_window >> 1))
- return max(tp->max_window >> 1, 68U - tp->tcp_header_len);
+ int cutoff;
+
+ /* When peer uses tiny windows, there is no use in packetizing
+ * to sub-MSS pieces for the sake of SWS or making sure there
+ * are enough packets in the pipe for fast recovery.
+ *
+ * On the other hand, for extremely large MSS devices, handling
+ * smaller than MSS windows in this way does make sense.
+ */
+ if (tp->max_window >= 512)
+ cutoff = (tp->max_window >> 1);
+ else
+ cutoff = tp->max_window;
+
+ if (cutoff && pktsize > cutoff)
+ return max_t(int, cutoff, 68U - tp->tcp_header_len);
else
return pktsize;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 120/260] UNIX: Do not loop forever at unix_autobind().
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (118 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 119/260] tcp: Prevent overzealous packetization by SWS logic Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 121/260] sparc64: Get rid of indirect p1275 PROM call buffer Paul Gortmaker
` (141 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Tetsuo Handa, David S. Miller, Paul Gortmaker
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
commit 8df73ff90f00f14d2c7ff7156f7ef153f7e9d3b7 upstream.
We assumed that unix_autobind() never fails if kzalloc() succeeded.
But unix_autobind() allows only 1048576 names. If /proc/sys/fs/file-max is
larger than 1048576 (e.g. systems with more than 10GB of RAM), a local user can
consume all names using fork()/socket()/bind().
If all names are in use, those who call bind() with addr_len == sizeof(short)
or connect()/sendmsg() with setsockopt(SO_PASSCRED) will continue
while (1)
yield();
loop at unix_autobind() till a name becomes available.
This patch adds a loop counter in order to give up after 1048576 attempts.
Calling yield() for once per 256 attempts may not be sufficient when many names
are already in use, for __unix_find_socket_byname() can take long time under
such circumstance. Therefore, this patch also adds cond_resched() call.
Note that currently a local user can consume 2GB of kernel memory if the user
is allowed to create and autobind 1048576 UNIX domain sockets. We should
consider adding some restriction for autobind operation.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/unix/af_unix.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 3d9122e..8c34e3b 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -672,6 +672,7 @@ static int unix_autobind(struct socket *sock)
static u32 ordernum = 1;
struct unix_address *addr;
int err;
+ unsigned int retries = 0;
mutex_lock(&u->readlock);
@@ -697,9 +698,17 @@ retry:
if (__unix_find_socket_byname(net, addr->name, addr->len, sock->type,
addr->hash)) {
spin_unlock(&unix_table_lock);
- /* Sanity yield. It is unusual case, but yet... */
- if (!(ordernum&0xFF))
- yield();
+ /*
+ * __unix_find_socket_byname() may take long time if many names
+ * are already in use.
+ */
+ cond_resched();
+ /* Give up if all names seems to be in use. */
+ if (retries++ == 0xFFFFF) {
+ err = -ENOSPC;
+ kfree(addr);
+ goto out;
+ }
goto retry;
}
addr->hash ^= sk->sk_type;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 121/260] sparc64: Get rid of indirect p1275 PROM call buffer.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (119 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 120/260] UNIX: Do not loop forever at unix_autobind() Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 122/260] drivers/net/usb/hso.c: prevent reading uninitialized memory Paul Gortmaker
` (140 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, David S. Miller, Paul Gortmaker
From: David S. Miller <davem@davemloft.net>
commit 25edd6946a1d74e5e77813c2324a0908c68bcf9e upstream.
This is based upon a report by Meelis Roos showing that it's possible
that we'll try to fetch a property that is 32K in size with some
devices. With the current fixed 3K buffer we use for moving data in
and out of the firmware during PROM calls, that simply won't work.
In fact, it will scramble random kernel data during bootup.
The reasoning behind the temporary buffer is entirely historical. It
used to be the case that we had problems referencing dynamic kernel
memory (including the stack) early in the boot process before we
explicitly told the firwmare to switch us over to the kernel trap
table.
So what we did was always give the firmware buffers that were locked
into the main kernel image.
But we no longer have problems like that, so get rid of all of this
indirect bounce buffering.
Besides fixing Meelis's bug, this also makes the kernel data about 3K
smaller.
It was also discovered during these conversions that the
implementation of prom_retain() was completely wrong, so that was
fixed here as well. Currently that interface is not in use.
Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/sparc/include/asm/oplib_64.h | 27 +---
arch/sparc/prom/cif.S | 16 +-
arch/sparc/prom/console_64.c | 48 +++++--
arch/sparc/prom/devops_64.c | 36 ++++-
arch/sparc/prom/misc_64.c | 314 ++++++++++++++++++++++++++-----------
arch/sparc/prom/p1275.c | 102 +------------
arch/sparc/prom/tree_64.c | 210 ++++++++++++++++++-------
7 files changed, 456 insertions(+), 297 deletions(-)
diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h
index a5db031..3e0b2d6 100644
--- a/arch/sparc/include/asm/oplib_64.h
+++ b/arch/sparc/include/asm/oplib_64.h
@@ -185,9 +185,8 @@ extern int prom_getunumber(int syndrome_code,
char *buf, int buflen);
/* Retain physical memory to the caller across soft resets. */
-extern unsigned long prom_retain(const char *name,
- unsigned long pa_low, unsigned long pa_high,
- long size, long align);
+extern int prom_retain(const char *name, unsigned long size,
+ unsigned long align, unsigned long *paddr);
/* Load explicit I/D TLB entries into the calling processor. */
extern long prom_itlb_load(unsigned long index,
@@ -287,26 +286,6 @@ extern void prom_sun4v_guest_soft_state(void);
extern int prom_ihandle2path(int handle, char *buffer, int bufsize);
/* Client interface level routines. */
-extern long p1275_cmd(const char *, long, ...);
-
-#if 0
-#define P1275_SIZE(x) ((((long)((x) / 32)) << 32) | (x))
-#else
-#define P1275_SIZE(x) x
-#endif
-
-/* We support at most 16 input and 1 output argument */
-#define P1275_ARG_NUMBER 0
-#define P1275_ARG_IN_STRING 1
-#define P1275_ARG_OUT_BUF 2
-#define P1275_ARG_OUT_32B 3
-#define P1275_ARG_IN_FUNCTION 4
-#define P1275_ARG_IN_BUF 5
-#define P1275_ARG_IN_64B 6
-
-#define P1275_IN(x) ((x) & 0xf)
-#define P1275_OUT(x) (((x) << 4) & 0xf0)
-#define P1275_INOUT(i,o) (P1275_IN(i)|P1275_OUT(o))
-#define P1275_ARG(n,x) ((x) << ((n)*3 + 8))
+extern void p1275_cmd_direct(unsigned long *);
#endif /* !(__SPARC64_OPLIB_H) */
diff --git a/arch/sparc/prom/cif.S b/arch/sparc/prom/cif.S
index 5f27ad7..9c86b4b 100644
--- a/arch/sparc/prom/cif.S
+++ b/arch/sparc/prom/cif.S
@@ -9,18 +9,18 @@
#include <asm/thread_info.h>
.text
- .globl prom_cif_interface
-prom_cif_interface:
- sethi %hi(p1275buf), %o0
- or %o0, %lo(p1275buf), %o0
- ldx [%o0 + 0x010], %o1 ! prom_cif_stack
- save %o1, -192, %sp
- ldx [%i0 + 0x008], %l2 ! prom_cif_handler
+ .globl prom_cif_direct
+prom_cif_direct:
+ sethi %hi(p1275buf), %o1
+ or %o1, %lo(p1275buf), %o1
+ ldx [%o1 + 0x0010], %o2 ! prom_cif_stack
+ save %o2, -192, %sp
+ ldx [%i1 + 0x0008], %l2 ! prom_cif_handler
mov %g4, %l0
mov %g5, %l1
mov %g6, %l3
call %l2
- add %i0, 0x018, %o0 ! prom_args
+ mov %i0, %o0 ! prom_args
mov %l0, %g4
mov %l1, %g5
mov %l3, %g6
diff --git a/arch/sparc/prom/console_64.c b/arch/sparc/prom/console_64.c
index f55d58a..10322dc 100644
--- a/arch/sparc/prom/console_64.c
+++ b/arch/sparc/prom/console_64.c
@@ -21,14 +21,22 @@ extern int prom_stdin, prom_stdout;
inline int
prom_nbgetchar(void)
{
+ unsigned long args[7];
char inc;
- if (p1275_cmd("read", P1275_ARG(1,P1275_ARG_OUT_BUF)|
- P1275_INOUT(3,1),
- prom_stdin, &inc, P1275_SIZE(1)) == 1)
+ args[0] = (unsigned long) "read";
+ args[1] = 3;
+ args[2] = 1;
+ args[3] = (unsigned int) prom_stdin;
+ args[4] = (unsigned long) &inc;
+ args[5] = 1;
+ args[6] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ if (args[6] == 1)
return inc;
- else
- return -1;
+ return -1;
}
/* Non blocking put character to console device, returns -1 if
@@ -37,12 +45,22 @@ prom_nbgetchar(void)
inline int
prom_nbputchar(char c)
{
+ unsigned long args[7];
char outc;
outc = c;
- if (p1275_cmd("write", P1275_ARG(1,P1275_ARG_IN_BUF)|
- P1275_INOUT(3,1),
- prom_stdout, &outc, P1275_SIZE(1)) == 1)
+
+ args[0] = (unsigned long) "write";
+ args[1] = 3;
+ args[2] = 1;
+ args[3] = (unsigned int) prom_stdout;
+ args[4] = (unsigned long) &outc;
+ args[5] = 1;
+ args[6] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ if (args[6] == 1)
return 0;
else
return -1;
@@ -67,7 +85,15 @@ prom_putchar(char c)
void
prom_puts(const char *s, int len)
{
- p1275_cmd("write", P1275_ARG(1,P1275_ARG_IN_BUF)|
- P1275_INOUT(3,1),
- prom_stdout, s, P1275_SIZE(len));
+ unsigned long args[7];
+
+ args[0] = (unsigned long) "write";
+ args[1] = 3;
+ args[2] = 1;
+ args[3] = (unsigned int) prom_stdout;
+ args[4] = (unsigned long) s;
+ args[5] = len;
+ args[6] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
}
diff --git a/arch/sparc/prom/devops_64.c b/arch/sparc/prom/devops_64.c
index 9dbd803..a017119 100644
--- a/arch/sparc/prom/devops_64.c
+++ b/arch/sparc/prom/devops_64.c
@@ -18,16 +18,32 @@
int
prom_devopen(const char *dstr)
{
- return p1275_cmd ("open", P1275_ARG(0,P1275_ARG_IN_STRING)|
- P1275_INOUT(1,1),
- dstr);
+ unsigned long args[5];
+
+ args[0] = (unsigned long) "open";
+ args[1] = 1;
+ args[2] = 1;
+ args[3] = (unsigned long) dstr;
+ args[4] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (int) args[4];
}
/* Close the device described by device handle 'dhandle'. */
int
prom_devclose(int dhandle)
{
- p1275_cmd ("close", P1275_INOUT(1,0), dhandle);
+ unsigned long args[4];
+
+ args[0] = (unsigned long) "close";
+ args[1] = 1;
+ args[2] = 0;
+ args[3] = (unsigned int) dhandle;
+
+ p1275_cmd_direct(args);
+
return 0;
}
@@ -37,5 +53,15 @@ prom_devclose(int dhandle)
void
prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
{
- p1275_cmd ("seek", P1275_INOUT(3,1), dhandle, seekhi, seeklo);
+ unsigned long args[7];
+
+ args[0] = (unsigned long) "seek";
+ args[1] = 3;
+ args[2] = 1;
+ args[3] = (unsigned int) dhandle;
+ args[4] = seekhi;
+ args[5] = seeklo;
+ args[6] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
}
diff --git a/arch/sparc/prom/misc_64.c b/arch/sparc/prom/misc_64.c
index 39fc6af..6cb1581 100644
--- a/arch/sparc/prom/misc_64.c
+++ b/arch/sparc/prom/misc_64.c
@@ -20,10 +20,17 @@
int prom_service_exists(const char *service_name)
{
- int err = p1275_cmd("test", P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_INOUT(1, 1), service_name);
+ unsigned long args[5];
- if (err)
+ args[0] = (unsigned long) "test";
+ args[1] = 1;
+ args[2] = 1;
+ args[3] = (unsigned long) service_name;
+ args[4] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ if (args[4])
return 0;
return 1;
}
@@ -31,30 +38,47 @@ int prom_service_exists(const char *service_name)
void prom_sun4v_guest_soft_state(void)
{
const char *svc = "SUNW,soft-state-supported";
+ unsigned long args[3];
if (!prom_service_exists(svc))
return;
- p1275_cmd(svc, P1275_INOUT(0, 0));
+ args[0] = (unsigned long) svc;
+ args[1] = 0;
+ args[2] = 0;
+ p1275_cmd_direct(args);
}
/* Reset and reboot the machine with the command 'bcommand'. */
void prom_reboot(const char *bcommand)
{
+ unsigned long args[4];
+
#ifdef CONFIG_SUN_LDOMS
if (ldom_domaining_enabled)
ldom_reboot(bcommand);
#endif
- p1275_cmd("boot", P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_INOUT(1, 0), bcommand);
+ args[0] = (unsigned long) "boot";
+ args[1] = 1;
+ args[2] = 0;
+ args[3] = (unsigned long) bcommand;
+
+ p1275_cmd_direct(args);
}
/* Forth evaluate the expression contained in 'fstring'. */
void prom_feval(const char *fstring)
{
+ unsigned long args[5];
+
if (!fstring || fstring[0] == 0)
return;
- p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_INOUT(1, 1), fstring);
+ args[0] = (unsigned long) "interpret";
+ args[1] = 1;
+ args[2] = 1;
+ args[3] = (unsigned long) fstring;
+ args[4] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
}
EXPORT_SYMBOL(prom_feval);
@@ -68,6 +92,7 @@ extern void smp_release(void);
*/
void prom_cmdline(void)
{
+ unsigned long args[3];
unsigned long flags;
local_irq_save(flags);
@@ -76,7 +101,11 @@ void prom_cmdline(void)
smp_capture();
#endif
- p1275_cmd("enter", P1275_INOUT(0, 0));
+ args[0] = (unsigned long) "enter";
+ args[1] = 0;
+ args[2] = 0;
+
+ p1275_cmd_direct(args);
#ifdef CONFIG_SMP
smp_release();
@@ -90,22 +119,32 @@ void prom_cmdline(void)
*/
void notrace prom_halt(void)
{
+ unsigned long args[3];
+
#ifdef CONFIG_SUN_LDOMS
if (ldom_domaining_enabled)
ldom_power_off();
#endif
again:
- p1275_cmd("exit", P1275_INOUT(0, 0));
+ args[0] = (unsigned long) "exit";
+ args[1] = 0;
+ args[2] = 0;
+ p1275_cmd_direct(args);
goto again; /* PROM is out to get me -DaveM */
}
void prom_halt_power_off(void)
{
+ unsigned long args[3];
+
#ifdef CONFIG_SUN_LDOMS
if (ldom_domaining_enabled)
ldom_power_off();
#endif
- p1275_cmd("SUNW,power-off", P1275_INOUT(0, 0));
+ args[0] = (unsigned long) "SUNW,power-off";
+ args[1] = 0;
+ args[2] = 0;
+ p1275_cmd_direct(args);
/* if nothing else helps, we just halt */
prom_halt();
@@ -114,10 +153,15 @@ void prom_halt_power_off(void)
/* Set prom sync handler to call function 'funcp'. */
void prom_setcallback(callback_func_t funcp)
{
+ unsigned long args[5];
if (!funcp)
return;
- p1275_cmd("set-callback", P1275_ARG(0, P1275_ARG_IN_FUNCTION) |
- P1275_INOUT(1, 1), funcp);
+ args[0] = (unsigned long) "set-callback";
+ args[1] = 1;
+ args[2] = 1;
+ args[3] = (unsigned long) funcp;
+ args[4] = (unsigned long) -1;
+ p1275_cmd_direct(args);
}
/* Get the idprom and stuff it into buffer 'idbuf'. Returns the
@@ -173,57 +217,61 @@ static int prom_get_memory_ihandle(void)
}
/* Load explicit I/D TLB entries. */
+static long tlb_load(const char *type, unsigned long index,
+ unsigned long tte_data, unsigned long vaddr)
+{
+ unsigned long args[9];
+
+ args[0] = (unsigned long) prom_callmethod_name;
+ args[1] = 5;
+ args[2] = 1;
+ args[3] = (unsigned long) type;
+ args[4] = (unsigned int) prom_get_mmu_ihandle();
+ args[5] = vaddr;
+ args[6] = tte_data;
+ args[7] = index;
+ args[8] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (long) args[8];
+}
+
long prom_itlb_load(unsigned long index,
unsigned long tte_data,
unsigned long vaddr)
{
- return p1275_cmd(prom_callmethod_name,
- (P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_ARG(2, P1275_ARG_IN_64B) |
- P1275_ARG(3, P1275_ARG_IN_64B) |
- P1275_INOUT(5, 1)),
- "SUNW,itlb-load",
- prom_get_mmu_ihandle(),
- /* And then our actual args are pushed backwards. */
- vaddr,
- tte_data,
- index);
+ return tlb_load("SUNW,itlb-load", index, tte_data, vaddr);
}
long prom_dtlb_load(unsigned long index,
unsigned long tte_data,
unsigned long vaddr)
{
- return p1275_cmd(prom_callmethod_name,
- (P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_ARG(2, P1275_ARG_IN_64B) |
- P1275_ARG(3, P1275_ARG_IN_64B) |
- P1275_INOUT(5, 1)),
- "SUNW,dtlb-load",
- prom_get_mmu_ihandle(),
- /* And then our actual args are pushed backwards. */
- vaddr,
- tte_data,
- index);
+ return tlb_load("SUNW,dtlb-load", index, tte_data, vaddr);
}
int prom_map(int mode, unsigned long size,
unsigned long vaddr, unsigned long paddr)
{
- int ret = p1275_cmd(prom_callmethod_name,
- (P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_ARG(3, P1275_ARG_IN_64B) |
- P1275_ARG(4, P1275_ARG_IN_64B) |
- P1275_ARG(6, P1275_ARG_IN_64B) |
- P1275_INOUT(7, 1)),
- prom_map_name,
- prom_get_mmu_ihandle(),
- mode,
- size,
- vaddr,
- 0,
- paddr);
-
+ unsigned long args[11];
+ int ret;
+
+ args[0] = (unsigned long) prom_callmethod_name;
+ args[1] = 7;
+ args[2] = 1;
+ args[3] = (unsigned long) prom_map_name;
+ args[4] = (unsigned int) prom_get_mmu_ihandle();
+ args[5] = (unsigned int) mode;
+ args[6] = size;
+ args[7] = vaddr;
+ args[8] = 0;
+ args[9] = paddr;
+ args[10] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ ret = (int) args[10];
if (ret == 0)
ret = -1;
return ret;
@@ -231,40 +279,51 @@ int prom_map(int mode, unsigned long size,
void prom_unmap(unsigned long size, unsigned long vaddr)
{
- p1275_cmd(prom_callmethod_name,
- (P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_ARG(2, P1275_ARG_IN_64B) |
- P1275_ARG(3, P1275_ARG_IN_64B) |
- P1275_INOUT(4, 0)),
- prom_unmap_name,
- prom_get_mmu_ihandle(),
- size,
- vaddr);
+ unsigned long args[7];
+
+ args[0] = (unsigned long) prom_callmethod_name;
+ args[1] = 4;
+ args[2] = 0;
+ args[3] = (unsigned long) prom_unmap_name;
+ args[4] = (unsigned int) prom_get_mmu_ihandle();
+ args[5] = size;
+ args[6] = vaddr;
+
+ p1275_cmd_direct(args);
}
/* Set aside physical memory which is not touched or modified
* across soft resets.
*/
-unsigned long prom_retain(const char *name,
- unsigned long pa_low, unsigned long pa_high,
- long size, long align)
+int prom_retain(const char *name, unsigned long size,
+ unsigned long align, unsigned long *paddr)
{
- /* XXX I don't think we return multiple values correctly.
- * XXX OBP supposedly returns pa_low/pa_high here, how does
- * XXX it work?
+ unsigned long args[11];
+
+ args[0] = (unsigned long) prom_callmethod_name;
+ args[1] = 5;
+ args[2] = 3;
+ args[3] = (unsigned long) "SUNW,retain";
+ args[4] = (unsigned int) prom_get_memory_ihandle();
+ args[5] = align;
+ args[6] = size;
+ args[7] = (unsigned long) name;
+ args[8] = (unsigned long) -1;
+ args[9] = (unsigned long) -1;
+ args[10] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ if (args[8])
+ return (int) args[8];
+
+ /* Next we get "phys_high" then "phys_low". On 64-bit
+ * the phys_high cell is don't care since the phys_low
+ * cell has the full value.
*/
+ *paddr = args[10];
- /* If align is zero, the pa_low/pa_high args are passed,
- * else they are not.
- */
- if (align == 0)
- return p1275_cmd("SUNW,retain",
- (P1275_ARG(0, P1275_ARG_IN_BUF) | P1275_INOUT(5, 2)),
- name, pa_low, pa_high, size, align);
- else
- return p1275_cmd("SUNW,retain",
- (P1275_ARG(0, P1275_ARG_IN_BUF) | P1275_INOUT(3, 2)),
- name, size, align);
+ return 0;
}
/* Get "Unumber" string for the SIMM at the given
@@ -277,62 +336,129 @@ int prom_getunumber(int syndrome_code,
unsigned long phys_addr,
char *buf, int buflen)
{
- return p1275_cmd(prom_callmethod_name,
- (P1275_ARG(0, P1275_ARG_IN_STRING) |
- P1275_ARG(3, P1275_ARG_OUT_BUF) |
- P1275_ARG(6, P1275_ARG_IN_64B) |
- P1275_INOUT(8, 2)),
- "SUNW,get-unumber", prom_get_memory_ihandle(),
- buflen, buf, P1275_SIZE(buflen),
- 0, phys_addr, syndrome_code);
+ unsigned long args[12];
+
+ args[0] = (unsigned long) prom_callmethod_name;
+ args[1] = 7;
+ args[2] = 2;
+ args[3] = (unsigned long) "SUNW,get-unumber";
+ args[4] = (unsigned int) prom_get_memory_ihandle();
+ args[5] = buflen;
+ args[6] = (unsigned long) buf;
+ args[7] = 0;
+ args[8] = phys_addr;
+ args[9] = (unsigned int) syndrome_code;
+ args[10] = (unsigned long) -1;
+ args[11] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (int) args[10];
}
/* Power management extensions. */
void prom_sleepself(void)
{
- p1275_cmd("SUNW,sleep-self", P1275_INOUT(0, 0));
+ unsigned long args[3];
+
+ args[0] = (unsigned long) "SUNW,sleep-self";
+ args[1] = 0;
+ args[2] = 0;
+ p1275_cmd_direct(args);
}
int prom_sleepsystem(void)
{
- return p1275_cmd("SUNW,sleep-system", P1275_INOUT(0, 1));
+ unsigned long args[4];
+
+ args[0] = (unsigned long) "SUNW,sleep-system";
+ args[1] = 0;
+ args[2] = 1;
+ args[3] = (unsigned long) -1;
+ p1275_cmd_direct(args);
+
+ return (int) args[3];
}
int prom_wakeupsystem(void)
{
- return p1275_cmd("SUNW,wakeup-system", P1275_INOUT(0, 1));
+ unsigned long args[4];
+
+ args[0] = (unsigned long) "SUNW,wakeup-system";
+ args[1] = 0;
+ args[2] = 1;
+ args[3] = (unsigned long) -1;
+ p1275_cmd_direct(args);
+
+ return (int) args[3];
}
#ifdef CONFIG_SMP
void prom_startcpu(int cpunode, unsigned long pc, unsigned long arg)
{
- p1275_cmd("SUNW,start-cpu", P1275_INOUT(3, 0), cpunode, pc, arg);
+ unsigned long args[6];
+
+ args[0] = (unsigned long) "SUNW,start-cpu";
+ args[1] = 3;
+ args[2] = 0;
+ args[3] = (unsigned int) cpunode;
+ args[4] = pc;
+ args[5] = arg;
+ p1275_cmd_direct(args);
}
void prom_startcpu_cpuid(int cpuid, unsigned long pc, unsigned long arg)
{
- p1275_cmd("SUNW,start-cpu-by-cpuid", P1275_INOUT(3, 0),
- cpuid, pc, arg);
+ unsigned long args[6];
+
+ args[0] = (unsigned long) "SUNW,start-cpu-by-cpuid";
+ args[1] = 3;
+ args[2] = 0;
+ args[3] = (unsigned int) cpuid;
+ args[4] = pc;
+ args[5] = arg;
+ p1275_cmd_direct(args);
}
void prom_stopcpu_cpuid(int cpuid)
{
- p1275_cmd("SUNW,stop-cpu-by-cpuid", P1275_INOUT(1, 0),
- cpuid);
+ unsigned long args[4];
+
+ args[0] = (unsigned long) "SUNW,stop-cpu-by-cpuid";
+ args[1] = 1;
+ args[2] = 0;
+ args[3] = (unsigned int) cpuid;
+ p1275_cmd_direct(args);
}
void prom_stopself(void)
{
- p1275_cmd("SUNW,stop-self", P1275_INOUT(0, 0));
+ unsigned long args[3];
+
+ args[0] = (unsigned long) "SUNW,stop-self";
+ args[1] = 0;
+ args[2] = 0;
+ p1275_cmd_direct(args);
}
void prom_idleself(void)
{
- p1275_cmd("SUNW,idle-self", P1275_INOUT(0, 0));
+ unsigned long args[3];
+
+ args[0] = (unsigned long) "SUNW,idle-self";
+ args[1] = 0;
+ args[2] = 0;
+ p1275_cmd_direct(args);
}
void prom_resumecpu(int cpunode)
{
- p1275_cmd("SUNW,resume-cpu", P1275_INOUT(1, 0), cpunode);
+ unsigned long args[4];
+
+ args[0] = (unsigned long) "SUNW,resume-cpu";
+ args[1] = 1;
+ args[2] = 0;
+ args[3] = (unsigned int) cpunode;
+ p1275_cmd_direct(args);
}
#endif
diff --git a/arch/sparc/prom/p1275.c b/arch/sparc/prom/p1275.c
index 2d8b70d..fa6e4e2 100644
--- a/arch/sparc/prom/p1275.c
+++ b/arch/sparc/prom/p1275.c
@@ -22,13 +22,11 @@ struct {
long prom_callback; /* 0x00 */
void (*prom_cif_handler)(long *); /* 0x08 */
unsigned long prom_cif_stack; /* 0x10 */
- unsigned long prom_args [23]; /* 0x18 */
- char prom_buffer [3000];
} p1275buf;
extern void prom_world(int);
-extern void prom_cif_interface(void);
+extern void prom_cif_direct(unsigned long *args);
extern void prom_cif_callback(void);
/*
@@ -36,114 +34,20 @@ extern void prom_cif_callback(void);
*/
DEFINE_RAW_SPINLOCK(prom_entry_lock);
-long p1275_cmd(const char *service, long fmt, ...)
+void p1275_cmd_direct(unsigned long *args)
{
- char *p, *q;
unsigned long flags;
- int nargs, nrets, i;
- va_list list;
- long attrs, x;
-
- p = p1275buf.prom_buffer;
raw_local_save_flags(flags);
raw_local_irq_restore(PIL_NMI);
raw_spin_lock(&prom_entry_lock);
- p1275buf.prom_args[0] = (unsigned long)p; /* service */
- strcpy (p, service);
- p = (char *)(((long)(strchr (p, 0) + 8)) & ~7);
- p1275buf.prom_args[1] = nargs = (fmt & 0x0f); /* nargs */
- p1275buf.prom_args[2] = nrets = ((fmt & 0xf0) >> 4); /* nrets */
- attrs = fmt >> 8;
- va_start(list, fmt);
- for (i = 0; i < nargs; i++, attrs >>= 3) {
- switch (attrs & 0x7) {
- case P1275_ARG_NUMBER:
- p1275buf.prom_args[i + 3] =
- (unsigned)va_arg(list, long);
- break;
- case P1275_ARG_IN_64B:
- p1275buf.prom_args[i + 3] =
- va_arg(list, unsigned long);
- break;
- case P1275_ARG_IN_STRING:
- strcpy (p, va_arg(list, char *));
- p1275buf.prom_args[i + 3] = (unsigned long)p;
- p = (char *)(((long)(strchr (p, 0) + 8)) & ~7);
- break;
- case P1275_ARG_OUT_BUF:
- (void) va_arg(list, char *);
- p1275buf.prom_args[i + 3] = (unsigned long)p;
- x = va_arg(list, long);
- i++; attrs >>= 3;
- p = (char *)(((long)(p + (int)x + 7)) & ~7);
- p1275buf.prom_args[i + 3] = x;
- break;
- case P1275_ARG_IN_BUF:
- q = va_arg(list, char *);
- p1275buf.prom_args[i + 3] = (unsigned long)p;
- x = va_arg(list, long);
- i++; attrs >>= 3;
- memcpy (p, q, (int)x);
- p = (char *)(((long)(p + (int)x + 7)) & ~7);
- p1275buf.prom_args[i + 3] = x;
- break;
- case P1275_ARG_OUT_32B:
- (void) va_arg(list, char *);
- p1275buf.prom_args[i + 3] = (unsigned long)p;
- p += 32;
- break;
- case P1275_ARG_IN_FUNCTION:
- p1275buf.prom_args[i + 3] =
- (unsigned long)prom_cif_callback;
- p1275buf.prom_callback = va_arg(list, long);
- break;
- }
- }
- va_end(list);
-
prom_world(1);
- prom_cif_interface();
+ prom_cif_direct(args);
prom_world(0);
- attrs = fmt >> 8;
- va_start(list, fmt);
- for (i = 0; i < nargs; i++, attrs >>= 3) {
- switch (attrs & 0x7) {
- case P1275_ARG_NUMBER:
- (void) va_arg(list, long);
- break;
- case P1275_ARG_IN_STRING:
- (void) va_arg(list, char *);
- break;
- case P1275_ARG_IN_FUNCTION:
- (void) va_arg(list, long);
- break;
- case P1275_ARG_IN_BUF:
- (void) va_arg(list, char *);
- (void) va_arg(list, long);
- i++; attrs >>= 3;
- break;
- case P1275_ARG_OUT_BUF:
- p = va_arg(list, char *);
- x = va_arg(list, long);
- memcpy (p, (char *)(p1275buf.prom_args[i + 3]), (int)x);
- i++; attrs >>= 3;
- break;
- case P1275_ARG_OUT_32B:
- p = va_arg(list, char *);
- memcpy (p, (char *)(p1275buf.prom_args[i + 3]), 32);
- break;
- }
- }
- va_end(list);
- x = p1275buf.prom_args [nargs + 3];
-
raw_spin_unlock(&prom_entry_lock);
raw_local_irq_restore(flags);
-
- return x;
}
void prom_cif_init(void *cif_handler, void *cif_stack)
diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
index 3c0d2dd..9d3f913 100644
--- a/arch/sparc/prom/tree_64.c
+++ b/arch/sparc/prom/tree_64.c
@@ -16,22 +16,39 @@
#include <asm/oplib.h>
#include <asm/ldc.h>
+static int prom_node_to_node(const char *type, int node)
+{
+ unsigned long args[5];
+
+ args[0] = (unsigned long) type;
+ args[1] = 1;
+ args[2] = 1;
+ args[3] = (unsigned int) node;
+ args[4] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (int) args[4];
+}
+
/* Return the child of node 'node' or zero if no this node has no
* direct descendent.
*/
inline int __prom_getchild(int node)
{
- return p1275_cmd ("child", P1275_INOUT(1, 1), node);
+ return prom_node_to_node("child", node);
}
inline int prom_getchild(int node)
{
int cnode;
- if(node == -1) return 0;
+ if (node == -1)
+ return 0;
cnode = __prom_getchild(node);
- if(cnode == -1) return 0;
- return (int)cnode;
+ if (cnode == -1)
+ return 0;
+ return cnode;
}
EXPORT_SYMBOL(prom_getchild);
@@ -39,10 +56,12 @@ inline int prom_getparent(int node)
{
int cnode;
- if(node == -1) return 0;
- cnode = p1275_cmd ("parent", P1275_INOUT(1, 1), node);
- if(cnode == -1) return 0;
- return (int)cnode;
+ if (node == -1)
+ return 0;
+ cnode = prom_node_to_node("parent", node);
+ if (cnode == -1)
+ return 0;
+ return cnode;
}
/* Return the next sibling of node 'node' or zero if no more siblings
@@ -50,7 +69,7 @@ inline int prom_getparent(int node)
*/
inline int __prom_getsibling(int node)
{
- return p1275_cmd(prom_peer_name, P1275_INOUT(1, 1), node);
+ return prom_node_to_node(prom_peer_name, node);
}
inline int prom_getsibling(int node)
@@ -72,11 +91,21 @@ EXPORT_SYMBOL(prom_getsibling);
*/
inline int prom_getproplen(int node, const char *prop)
{
- if((!node) || (!prop)) return -1;
- return p1275_cmd ("getproplen",
- P1275_ARG(1,P1275_ARG_IN_STRING)|
- P1275_INOUT(2, 1),
- node, prop);
+ unsigned long args[6];
+
+ if (!node || !prop)
+ return -1;
+
+ args[0] = (unsigned long) "getproplen";
+ args[1] = 2;
+ args[2] = 1;
+ args[3] = (unsigned int) node;
+ args[4] = (unsigned long) prop;
+ args[5] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (int) args[5];
}
EXPORT_SYMBOL(prom_getproplen);
@@ -87,19 +116,25 @@ EXPORT_SYMBOL(prom_getproplen);
inline int prom_getproperty(int node, const char *prop,
char *buffer, int bufsize)
{
+ unsigned long args[8];
int plen;
plen = prom_getproplen(node, prop);
- if ((plen > bufsize) || (plen == 0) || (plen == -1)) {
+ if ((plen > bufsize) || (plen == 0) || (plen == -1))
return -1;
- } else {
- /* Ok, things seem all right. */
- return p1275_cmd(prom_getprop_name,
- P1275_ARG(1,P1275_ARG_IN_STRING)|
- P1275_ARG(2,P1275_ARG_OUT_BUF)|
- P1275_INOUT(4, 1),
- node, prop, buffer, P1275_SIZE(plen));
- }
+
+ args[0] = (unsigned long) prom_getprop_name;
+ args[1] = 4;
+ args[2] = 1;
+ args[3] = (unsigned int) node;
+ args[4] = (unsigned long) prop;
+ args[5] = (unsigned long) buffer;
+ args[6] = bufsize;
+ args[7] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (int) args[7];
}
EXPORT_SYMBOL(prom_getproperty);
@@ -110,7 +145,7 @@ inline int prom_getint(int node, const char *prop)
{
int intprop;
- if(prom_getproperty(node, prop, (char *) &intprop, sizeof(int)) != -1)
+ if (prom_getproperty(node, prop, (char *) &intprop, sizeof(int)) != -1)
return intprop;
return -1;
@@ -126,7 +161,8 @@ int prom_getintdefault(int node, const char *property, int deflt)
int retval;
retval = prom_getint(node, property);
- if(retval == -1) return deflt;
+ if (retval == -1)
+ return deflt;
return retval;
}
@@ -138,7 +174,8 @@ int prom_getbool(int node, const char *prop)
int retval;
retval = prom_getproplen(node, prop);
- if(retval == -1) return 0;
+ if (retval == -1)
+ return 0;
return 1;
}
EXPORT_SYMBOL(prom_getbool);
@@ -152,7 +189,8 @@ void prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size)
int len;
len = prom_getproperty(node, prop, user_buf, ubuf_size);
- if(len != -1) return;
+ if (len != -1)
+ return;
user_buf[0] = 0;
}
EXPORT_SYMBOL(prom_getstring);
@@ -164,7 +202,8 @@ int prom_nodematch(int node, const char *name)
{
char namebuf[128];
prom_getproperty(node, "name", namebuf, sizeof(namebuf));
- if(strcmp(namebuf, name) == 0) return 1;
+ if (strcmp(namebuf, name) == 0)
+ return 1;
return 0;
}
@@ -190,16 +229,29 @@ int prom_searchsiblings(int node_start, const char *nodename)
}
EXPORT_SYMBOL(prom_searchsiblings);
+static const char *prom_nextprop_name = "nextprop";
+
/* Return the first property type for node 'node'.
* buffer should be at least 32B in length
*/
inline char *prom_firstprop(int node, char *buffer)
{
+ unsigned long args[7];
+
*buffer = 0;
- if(node == -1) return buffer;
- p1275_cmd ("nextprop", P1275_ARG(2,P1275_ARG_OUT_32B)|
- P1275_INOUT(3, 0),
- node, (char *) 0x0, buffer);
+ if (node == -1)
+ return buffer;
+
+ args[0] = (unsigned long) prom_nextprop_name;
+ args[1] = 3;
+ args[2] = 1;
+ args[3] = (unsigned int) node;
+ args[4] = 0;
+ args[5] = (unsigned long) buffer;
+ args[6] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
return buffer;
}
EXPORT_SYMBOL(prom_firstprop);
@@ -210,9 +262,10 @@ EXPORT_SYMBOL(prom_firstprop);
*/
inline char *prom_nextprop(int node, const char *oprop, char *buffer)
{
+ unsigned long args[7];
char buf[32];
- if(node == -1) {
+ if (node == -1) {
*buffer = 0;
return buffer;
}
@@ -220,10 +273,17 @@ inline char *prom_nextprop(int node, const char *oprop, char *buffer)
strcpy (buf, oprop);
oprop = buf;
}
- p1275_cmd ("nextprop", P1275_ARG(1,P1275_ARG_IN_STRING)|
- P1275_ARG(2,P1275_ARG_OUT_32B)|
- P1275_INOUT(3, 0),
- node, oprop, buffer);
+
+ args[0] = (unsigned long) prom_nextprop_name;
+ args[1] = 3;
+ args[2] = 1;
+ args[3] = (unsigned int) node;
+ args[4] = (unsigned long) oprop;
+ args[5] = (unsigned long) buffer;
+ args[6] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
return buffer;
}
EXPORT_SYMBOL(prom_nextprop);
@@ -231,12 +291,19 @@ EXPORT_SYMBOL(prom_nextprop);
int
prom_finddevice(const char *name)
{
+ unsigned long args[5];
+
if (!name)
return 0;
- return p1275_cmd(prom_finddev_name,
- P1275_ARG(0,P1275_ARG_IN_STRING)|
- P1275_INOUT(1, 1),
- name);
+ args[0] = (unsigned long) "finddevice";
+ args[1] = 1;
+ args[2] = 1;
+ args[3] = (unsigned long) name;
+ args[4] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (int) args[4];
}
EXPORT_SYMBOL(prom_finddevice);
@@ -247,7 +314,7 @@ int prom_node_has_property(int node, const char *prop)
*buf = 0;
do {
prom_nextprop(node, buf, buf);
- if(!strcmp(buf, prop))
+ if (!strcmp(buf, prop))
return 1;
} while (*buf);
return 0;
@@ -260,6 +327,8 @@ EXPORT_SYMBOL(prom_node_has_property);
int
prom_setprop(int node, const char *pname, char *value, int size)
{
+ unsigned long args[8];
+
if (size == 0)
return 0;
if ((pname == 0) || (value == 0))
@@ -271,19 +340,37 @@ prom_setprop(int node, const char *pname, char *value, int size)
return 0;
}
#endif
- return p1275_cmd ("setprop", P1275_ARG(1,P1275_ARG_IN_STRING)|
- P1275_ARG(2,P1275_ARG_IN_BUF)|
- P1275_INOUT(4, 1),
- node, pname, value, P1275_SIZE(size));
+ args[0] = (unsigned long) "setprop";
+ args[1] = 4;
+ args[2] = 1;
+ args[3] = (unsigned int) node;
+ args[4] = (unsigned long) pname;
+ args[5] = (unsigned long) value;
+ args[6] = size;
+ args[7] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (int) args[7];
}
EXPORT_SYMBOL(prom_setprop);
inline int prom_inst2pkg(int inst)
{
+ unsigned long args[5];
int node;
- node = p1275_cmd ("instance-to-package", P1275_INOUT(1, 1), inst);
- if (node == -1) return 0;
+ args[0] = (unsigned long) "instance-to-package";
+ args[1] = 1;
+ args[2] = 1;
+ args[3] = (unsigned int) inst;
+ args[4] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ node = (int) args[4];
+ if (node == -1)
+ return 0;
return node;
}
@@ -296,17 +383,28 @@ prom_pathtoinode(const char *path)
int node, inst;
inst = prom_devopen (path);
- if (inst == 0) return 0;
- node = prom_inst2pkg (inst);
- prom_devclose (inst);
- if (node == -1) return 0;
+ if (inst == 0)
+ return 0;
+ node = prom_inst2pkg(inst);
+ prom_devclose(inst);
+ if (node == -1)
+ return 0;
return node;
}
int prom_ihandle2path(int handle, char *buffer, int bufsize)
{
- return p1275_cmd("instance-to-path",
- P1275_ARG(1,P1275_ARG_OUT_BUF)|
- P1275_INOUT(3, 1),
- handle, buffer, P1275_SIZE(bufsize));
+ unsigned long args[7];
+
+ args[0] = (unsigned long) "instance-to-path";
+ args[1] = 3;
+ args[2] = 1;
+ args[3] = (unsigned int) handle;
+ args[4] = (unsigned long) buffer;
+ args[5] = bufsize;
+ args[6] = (unsigned long) -1;
+
+ p1275_cmd_direct(args);
+
+ return (int) args[6];
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 122/260] drivers/net/usb/hso.c: prevent reading uninitialized memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (120 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 121/260] sparc64: Get rid of indirect p1275 PROM call buffer Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 123/260] drivers/net/cxgb3/cxgb3_main.c: prevent reading uninitialized stack memory Paul Gortmaker
` (139 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Dan Rosenberg, David S. Miller,
Paul Gortmaker
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit 7011e660938fc44ed86319c18a5954e95a82ab3e upstream.
Fixed formatting (tabs and line breaks).
The TIOCGICOUNT device ioctl allows unprivileged users to read
uninitialized stack memory, because the "reserved" member of the
serial_icounter_struct struct declared on the stack in hso_get_count()
is not altered or zeroed before being copied back to the user. This
patch takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/usb/hso.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index be0cc99..0ba865e 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1654,6 +1654,8 @@ static int hso_get_count(struct hso_serial *serial,
struct uart_icount cnow;
struct hso_tiocmget *tiocmget = serial->tiocmget;
+ memset(&icount, 0, sizeof(struct serial_icounter_struct));
+
if (!tiocmget)
return -ENOENT;
spin_lock_irq(&serial->serial_lock);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 123/260] drivers/net/cxgb3/cxgb3_main.c: prevent reading uninitialized stack memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (121 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 122/260] drivers/net/usb/hso.c: prevent reading uninitialized memory Paul Gortmaker
@ 2011-01-02 7:16 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 124/260] drivers/net/eql.c: " Paul Gortmaker
` (138 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:16 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Dan Rosenberg, David S. Miller,
Paul Gortmaker
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit 49c37c0334a9b85d30ab3d6b5d1acb05ef2ef6de upstream.
Fixed formatting (tabs and line breaks).
The CHELSIO_GET_QSET_NUM device ioctl allows unprivileged users to read
4 bytes of uninitialized stack memory, because the "addr" member of the
ch_reg struct declared on the stack in cxgb_extension_ioctl() is not
altered or zeroed before being copied back to the user. This patch
takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/cxgb3/cxgb3_main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index e3f1b85..3e0f19f 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2296,6 +2296,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
case CHELSIO_GET_QSET_NUM:{
struct ch_reg edata;
+ memset(&edata, 0, sizeof(struct ch_reg));
+
edata.cmd = CHELSIO_GET_QSET_NUM;
edata.val = pi->nqsets;
if (copy_to_user(useraddr, &edata, sizeof(edata)))
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 124/260] drivers/net/eql.c: prevent reading uninitialized stack memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (122 preceding siblings ...)
2011-01-02 7:16 ` [34-longterm 123/260] drivers/net/cxgb3/cxgb3_main.c: prevent reading uninitialized stack memory Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 125/260] bonding: correctly process non-linear skbs Paul Gortmaker
` (137 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Dan Rosenberg, David S. Miller,
Paul Gortmaker
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit 44467187dc22fdd33a1a06ea0ba86ce20be3fe3c upstream.
Fixed formatting (tabs and line breaks).
The EQL_GETMASTRCFG device ioctl allows unprivileged users to read 16
bytes of uninitialized stack memory, because the "master_name" member of
the master_config_t struct declared on the stack in eql_g_master_cfg()
is not altered or zeroed before being copied back to the user. This
patch takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/eql.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/eql.c b/drivers/net/eql.c
index b34a2dd..a8b982d 100644
--- a/drivers/net/eql.c
+++ b/drivers/net/eql.c
@@ -555,6 +555,8 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp)
equalizer_t *eql;
master_config_t mc;
+ memset(&mc, 0, sizeof(master_config_t));
+
if (eql_is_master(dev)) {
eql = netdev_priv(dev);
mc.max_slaves = eql->max_slaves;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 125/260] bonding: correctly process non-linear skbs
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (123 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 124/260] drivers/net/eql.c: " Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 126/260] Staging: vt6655: fix buffer overflow Paul Gortmaker
` (136 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Andy Gospodarek, Alexander Duyck, Jesse Brandeburg,
stable, Jay Vosburgh, David S. Miller, Paul Gortmaker
From: Andy Gospodarek <andy@greyhouse.net>
commit ab12811c89e88f2e66746790b1fe4469ccb7bdd9 upstream.
It was recently brought to my attention that 802.3ad mode bonds would no
longer form when using some network hardware after a driver update.
After snooping around I realized that the particular hardware was using
page-based skbs and found that skb->data did not contain a valid LACPDU
as it was not stored there. That explained the inability to form an
802.3ad-based bond. For balance-alb mode bonds this was also an issue
as ARPs would not be properly processed.
This patch fixes the issue in my tests and should be applied to 2.6.36
and as far back as anyone cares to add it to stable.
Thanks to Alexander Duyck <alexander.h.duyck@intel.com> and Jesse
Brandeburg <jesse.brandeburg@intel.com> for the suggestions on this one.
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: stable@kerne.org
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/bonding/bond_3ad.c | 3 +++
drivers/net/bonding/bond_alb.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 822f586..0ddf4c6 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2466,6 +2466,9 @@ int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct pac
if (!(dev->flags & IFF_MASTER))
goto out;
+ if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
+ goto out;
+
read_lock(&bond->lock);
slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev),
orig_dev);
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 40fdc41..0d42b38 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -368,6 +368,9 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct
goto out;
}
+ if (!pskb_may_pull(skb, arp_hdr_len(bond_dev)))
+ goto out;
+
if (skb->len < sizeof(struct arp_pkt)) {
pr_debug("Packet is too small to be an ARP\n");
goto out;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 126/260] Staging: vt6655: fix buffer overflow
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (124 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 125/260] bonding: correctly process non-linear skbs Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 127/260] net/llc: make opt unsigned in llc_ui_setsockopt() Paul Gortmaker
` (135 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, Greg Kroah-Hartman, Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit dd173abfead903c7df54e977535973f3312cd307 upstream.
"param->u.wpa_associate.wpa_ie_len" comes from the user. We should
check it so that the copy_from_user() doesn't overflow the buffer.
Also further down in the function, we assume that if
"param->u.wpa_associate.wpa_ie_len" is set then "abyWPAIE[0]" is
initialized. To make that work, I changed the test here to say that if
"wpa_ie_len" is set then "wpa_ie" has to be a valid pointer or we return
-EINVAL.
Oddly, we only use the first element of the abyWPAIE[] array. So I
suspect there may be some other issues in this function.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/staging/vt6655/wpactl.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index 574e0b0..a078f6f 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -767,9 +767,14 @@ static int wpa_set_associate(PSDevice pDevice,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ie_len = %d\n", param->u.wpa_associate.wpa_ie_len);
- if (param->u.wpa_associate.wpa_ie &&
- copy_from_user(&abyWPAIE[0], param->u.wpa_associate.wpa_ie, param->u.wpa_associate.wpa_ie_len))
- return -EINVAL;
+ if (param->u.wpa_associate.wpa_ie_len) {
+ if (!param->u.wpa_associate.wpa_ie)
+ return -EINVAL;
+ if (param->u.wpa_associate.wpa_ie_len > sizeof(abyWPAIE))
+ return -EINVAL;
+ if (copy_from_user(&abyWPAIE[0], param->u.wpa_associate.wpa_ie, param->u.wpa_associate.wpa_ie_len))
+ return -EFAULT;
+ }
if (param->u.wpa_associate.mode == 1)
pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 127/260] net/llc: make opt unsigned in llc_ui_setsockopt()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (125 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 126/260] Staging: vt6655: fix buffer overflow Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 128/260] pid: make setpgid() system call use RCU read-side critical section Paul Gortmaker
` (134 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, David S. Miller, Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit 339db11b219f36cf7da61b390992d95bb6b7ba2e upstream.
The members of struct llc_sock are unsigned so if we pass a negative
value for "opt" it can cause a sign bug. Also it can cause an integer
overflow when we multiply "opt * HZ".
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/llc/af_llc.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 2db6a9f..ad4296c 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -1024,7 +1024,8 @@ static int llc_ui_setsockopt(struct socket *sock, int level, int optname,
{
struct sock *sk = sock->sk;
struct llc_sock *llc = llc_sk(sk);
- int rc = -EINVAL, opt;
+ unsigned int opt;
+ int rc = -EINVAL;
lock_sock(sk);
if (unlikely(level != SOL_LLC || optlen != sizeof(int)))
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 128/260] pid: make setpgid() system call use RCU read-side critical section
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (126 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 127/260] net/llc: make opt unsigned in llc_ui_setsockopt() Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 129/260] sched: Fix user time incorrectly accounted as system time on 32-bit Paul Gortmaker
` (133 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Paul E. McKenney, Paul Gortmaker
From: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
commit 950eaaca681c44aab87a46225c9e44f902c080aa upstream.
[ 23.584719]
[ 23.584720] ===================================================
[ 23.585059] [ INFO: suspicious rcu_dereference_check() usage. ]
[ 23.585176] ---------------------------------------------------
[ 23.585176] kernel/pid.c:419 invoked rcu_dereference_check() without protection!
[ 23.585176]
[ 23.585176] other info that might help us debug this:
[ 23.585176]
[ 23.585176]
[ 23.585176] rcu_scheduler_active = 1, debug_locks = 1
[ 23.585176] 1 lock held by rc.sysinit/728:
[ 23.585176] #0: (tasklist_lock){.+.+..}, at: [<ffffffff8104771f>] sys_setpgid+0x5f/0x193
[ 23.585176]
[ 23.585176] stack backtrace:
[ 23.585176] Pid: 728, comm: rc.sysinit Not tainted 2.6.36-rc2 #2
[ 23.585176] Call Trace:
[ 23.585176] [<ffffffff8105b436>] lockdep_rcu_dereference+0x99/0xa2
[ 23.585176] [<ffffffff8104c324>] find_task_by_pid_ns+0x50/0x6a
[ 23.585176] [<ffffffff8104c35b>] find_task_by_vpid+0x1d/0x1f
[ 23.585176] [<ffffffff81047727>] sys_setpgid+0x67/0x193
[ 23.585176] [<ffffffff810029eb>] system_call_fastpath+0x16/0x1b
[ 24.959669] type=1400 audit(1282938522.956:4): avc: denied { module_request } for pid=766 comm="hwclock" kmod="char-major-10-135" scontext=system_u:system_r:hwclock_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclas
It turns out that the setpgid() system call fails to enter an RCU
read-side critical section before doing a PID-to-task_struct translation.
This commit therefore does rcu_read_lock() before the translation, and
also does rcu_read_unlock() after the last use of the returned pointer.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sys.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/kernel/sys.c b/kernel/sys.c
index 7cb426a..0324c1c 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -962,6 +962,7 @@ SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
pgid = pid;
if (pgid < 0)
return -EINVAL;
+ rcu_read_lock();
/* From this point forward we keep holding onto the tasklist lock
* so that our parent does not change from under us. -DaveM
@@ -1015,6 +1016,7 @@ SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
out:
/* All paths lead to here, thus we are safe. -DaveM */
write_unlock_irq(&tasklist_lock);
+ rcu_read_unlock();
return err;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 129/260] sched: Fix user time incorrectly accounted as system time on 32-bit
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (127 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 128/260] pid: make setpgid() system call use RCU read-side critical section Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 130/260] oprofile: Add Support for Intel CPU Family 6 / Model 22 (Intel Celeron 540) Paul Gortmaker
` (132 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Stanislaw Gruszka, Peter Zijlstra, Hidetoshi Seto,
Ingo Molnar, Paul Gortmaker
From: Stanislaw Gruszka <sgruszka@redhat.com>
commit e75e863dd5c7d96b91ebbd241da5328fc38a78cc upstream.
We have 32-bit variable overflow possibility when multiply in
task_times() and thread_group_times() functions. When the
overflow happens then the scaled utime value becomes erroneously
small and the scaled stime becomes i erroneously big.
Reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=633037
https://bugzilla.kernel.org/show_bug.cgi?id=16559
Reported-by: Michael Chapman <redhat-bugzilla@very.puzzling.org>
Reported-by: Ciriaco Garcia de Celis <sysman@etherpilot.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
LKML-Reference: <20100914143513.GB8415@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index b741de5..dd7c170 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3428,9 +3428,9 @@ void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
rtime = nsecs_to_cputime(p->se.sum_exec_runtime);
if (total) {
- u64 temp;
+ u64 temp = rtime;
- temp = (u64)(rtime * utime);
+ temp *= utime;
do_div(temp, total);
utime = (cputime_t)temp;
} else
@@ -3461,9 +3461,9 @@ void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
if (total) {
- u64 temp;
+ u64 temp = rtime;
- temp = (u64)(rtime * cputime.utime);
+ temp *= cputime.utime;
do_div(temp, total);
utime = (cputime_t)temp;
} else
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 130/260] oprofile: Add Support for Intel CPU Family 6 / Model 22 (Intel Celeron 540)
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (128 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 129/260] sched: Fix user time incorrectly accounted as system time on 32-bit Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 131/260] char: Mark /dev/zero and /dev/kmem as not capable of writeback Paul Gortmaker
` (131 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Patrick Simmons, Robert Richter, Paul Gortmaker
From: Patrick Simmons <linuxrocks123@netscape.net>
commit c33f543d320843e1732534c3931da4bbd18e6c14 upstream.
This patch adds CPU type detection for the Intel Celeron 540, which is
part of the Core 2 family according to Wikipedia; the family and ID pair
is absent from the Volume 3B table referenced in the source code
comments. I have tested this patch on an Intel Celeron 540 machine
reporting itself as Family 6 Model 22, and OProfile runs on the machine
without issue.
Spec:
http://download.intel.com/design/mobile/SPECUPDT/317667.pdf
Signed-off-by: Patrick Simmons <linuxrocks123@netscape.net>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/oprofile/nmi_int.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 3130a4b..238526b 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -621,7 +621,9 @@ static int __init ppro_init(char **cpu_type)
case 14:
*cpu_type = "i386/core";
break;
- case 15: case 23:
+ case 0x0f:
+ case 0x16:
+ case 0x17:
*cpu_type = "i386/core_2";
break;
case 0x1a:
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 131/260] char: Mark /dev/zero and /dev/kmem as not capable of writeback
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (129 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 130/260] oprofile: Add Support for Intel CPU Family 6 / Model 22 (Intel Celeron 540) Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 132/260] drivers/pci/intel-iommu.c: fix build with older gcc's Paul Gortmaker
` (130 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Jan Kara, Jens Axboe, Paul Gortmaker
From: Jan Kara <jack@suse.cz>
commit 371d217ee1ff8b418b8f73fb2a34990f951ec2d4 upstream.
These devices don't do any writeback but their device inodes still can get
dirty so mark bdi appropriately so that bdi code does the right thing and files
inodes to lists of bdi carrying the device inodes.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/char/mem.c | 3 ++-
fs/char_dev.c | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index f54dab8..16a4443 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -788,10 +788,11 @@ static const struct file_operations zero_fops = {
/*
* capabilities for /dev/zero
* - permits private mappings, "copies" are taken of the source of zeros
+ * - no writeback happens
*/
static struct backing_dev_info zero_bdi = {
.name = "char/mem",
- .capabilities = BDI_CAP_MAP_COPY,
+ .capabilities = BDI_CAP_MAP_COPY | BDI_CAP_NO_ACCT_AND_WRITEBACK,
};
static const struct file_operations full_fops = {
diff --git a/fs/char_dev.c b/fs/char_dev.c
index d6db933..be7613e 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -39,7 +39,9 @@ struct backing_dev_info directly_mappable_cdev_bdi = {
#endif
/* permit direct mmap, for read, write or exec */
BDI_CAP_MAP_DIRECT |
- BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP),
+ BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP |
+ /* no writeback happens */
+ BDI_CAP_NO_ACCT_AND_WRITEBACK),
};
static struct kobj_map *cdev_map;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 132/260] drivers/pci/intel-iommu.c: fix build with older gcc's
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (130 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 131/260] char: Mark /dev/zero and /dev/kmem as not capable of writeback Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 133/260] drivers/video/sis/sis_main.c: prevent reading uninitialized stack memory Paul Gortmaker
` (129 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Andrew Morton, David Woodhouse, Jesse Barnes,
Linus Torvalds, Paul Gortmaker
From: Andrew Morton <akpm@linux-foundation.org>
commit df08cdc7ef606509debe7677c439be0ca48790e4 upstream.
drivers/pci/intel-iommu.c: In function `__iommu_calculate_agaw':
drivers/pci/intel-iommu.c:437: sorry, unimplemented: inlining failed in call to 'width_to_agaw': function body not available
drivers/pci/intel-iommu.c:445: sorry, unimplemented: called from here
Move the offending function (and its siblings) to top-of-file, remove the
forward declaration.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=17441
Reported-by: Martin Mokrejs <mmokrejs@ribosome.natur.cuni.cz>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/intel-iommu.c | 90 +++++++++++++++++++++-----------------------
1 files changed, 43 insertions(+), 47 deletions(-)
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 4173125..fff8832 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -71,6 +71,49 @@
#define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32))
#define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64))
+/* page table handling */
+#define LEVEL_STRIDE (9)
+#define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1)
+
+static inline int agaw_to_level(int agaw)
+{
+ return agaw + 2;
+}
+
+static inline int agaw_to_width(int agaw)
+{
+ return 30 + agaw * LEVEL_STRIDE;
+}
+
+static inline int width_to_agaw(int width)
+{
+ return (width - 30) / LEVEL_STRIDE;
+}
+
+static inline unsigned int level_to_offset_bits(int level)
+{
+ return (level - 1) * LEVEL_STRIDE;
+}
+
+static inline int pfn_level_offset(unsigned long pfn, int level)
+{
+ return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK;
+}
+
+static inline unsigned long level_mask(int level)
+{
+ return -1UL << level_to_offset_bits(level);
+}
+
+static inline unsigned long level_size(int level)
+{
+ return 1UL << level_to_offset_bits(level);
+}
+
+static inline unsigned long align_to_level(unsigned long pfn, int level)
+{
+ return (pfn + level_size(level) - 1) & level_mask(level);
+}
/* VT-d pages must always be _smaller_ than MM pages. Otherwise things
are never going to work. */
@@ -434,8 +477,6 @@ void free_iova_mem(struct iova *iova)
}
-static inline int width_to_agaw(int width);
-
static int __iommu_calculate_agaw(struct intel_iommu *iommu, int max_gaw)
{
unsigned long sagaw;
@@ -650,51 +691,6 @@ out:
spin_unlock_irqrestore(&iommu->lock, flags);
}
-/* page table handling */
-#define LEVEL_STRIDE (9)
-#define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1)
-
-static inline int agaw_to_level(int agaw)
-{
- return agaw + 2;
-}
-
-static inline int agaw_to_width(int agaw)
-{
- return 30 + agaw * LEVEL_STRIDE;
-
-}
-
-static inline int width_to_agaw(int width)
-{
- return (width - 30) / LEVEL_STRIDE;
-}
-
-static inline unsigned int level_to_offset_bits(int level)
-{
- return (level - 1) * LEVEL_STRIDE;
-}
-
-static inline int pfn_level_offset(unsigned long pfn, int level)
-{
- return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK;
-}
-
-static inline unsigned long level_mask(int level)
-{
- return -1UL << level_to_offset_bits(level);
-}
-
-static inline unsigned long level_size(int level)
-{
- return 1UL << level_to_offset_bits(level);
-}
-
-static inline unsigned long align_to_level(unsigned long pfn, int level)
-{
- return (pfn + level_size(level) - 1) & level_mask(level);
-}
-
static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
unsigned long pfn)
{
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 133/260] drivers/video/sis/sis_main.c: prevent reading uninitialized stack memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (131 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 132/260] drivers/pci/intel-iommu.c: fix build with older gcc's Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 134/260] percpu: fix pcpu_last_unit_cpu Paul Gortmaker
` (128 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Dan Rosenberg, Thomas Winischhofer,
Andrew Morton, Linus Torvalds, Paul Gortmaker
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit fd02db9de73faebc51240619c7c7f99bee9f65c7 upstream.
The FBIOGET_VBLANK device ioctl allows unprivileged users to read 16 bytes
of uninitialized stack memory, because the "reserved" member of the
fb_vblank struct declared on the stack is not altered or zeroed before
being copied back to the user. This patch takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/video/sis/sis_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index a531a0f..900b3a0 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -1701,6 +1701,9 @@ static int sisfb_ioctl(struct fb_info *info, unsigned int cmd,
break;
case FBIOGET_VBLANK:
+
+ memset(&sisvbblank, 0, sizeof(struct fb_vblank));
+
sisvbblank.count = 0;
sisvbblank.flags = sisfb_setupvbblankflags(ivideo, &sisvbblank.vcount, &sisvbblank.hcount);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 134/260] percpu: fix pcpu_last_unit_cpu
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (132 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 133/260] drivers/video/sis/sis_main.c: prevent reading uninitialized stack memory Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 135/260] aio: check for multiplication overflow in do_io_submit Paul Gortmaker
` (127 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Tejun Heo, Paul Gortmaker
From: Tejun Heo <tj@kernel.org>
commit 46b30ea9bc3698bc1d1e6fd726c9601d46fa0a91 upstream.
pcpu_first/last_unit_cpu are used to track which cpu has the first and
last units assigned. This in turn is used to determine the span of a
chunk for man/unmap cache flushes and whether an address belongs to
the first chunk or not in per_cpu_ptr_to_phys().
When the number of possible CPUs isn't power of two, a chunk may
contain unassigned units towards the end of a chunk. The logic to
determine pcpu_last_unit_cpu was incorrect when there was an unused
unit at the end of a chunk. It failed to ignore the unused unit and
assigned the unused marker NR_CPUS to pcpu_last_unit_cpu.
This was discovered through kdump failure which was caused by
malfunctioning per_cpu_ptr_to_phys() on a kvm setup with 50 possible
CPUs by CAI Qian.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/percpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/percpu.c b/mm/percpu.c
index 6e09741..717cc6e 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1750,9 +1750,9 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
if (pcpu_first_unit_cpu == NR_CPUS)
pcpu_first_unit_cpu = cpu;
+ pcpu_last_unit_cpu = cpu;
}
}
- pcpu_last_unit_cpu = cpu;
pcpu_nr_units = unit;
for_each_possible_cpu(cpu)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 135/260] aio: check for multiplication overflow in do_io_submit
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (133 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 134/260] percpu: fix pcpu_last_unit_cpu Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 136/260] inotify: send IN_UNMOUNT events Paul Gortmaker
` (126 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jeff Moyer, Linus Torvalds, Paul Gortmaker
From: Jeff Moyer <jmoyer@redhat.com>
commit 75e1c70fc31490ef8a373ea2a4bea2524099b478 upstream.
Tavis Ormandy pointed out that do_io_submit does not do proper bounds
checking on the passed-in iocb array:
if (unlikely(nr < 0))
return -EINVAL;
if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(iocbpp)))))
return -EFAULT; ^^^^^^^^^^^^^^^^^^
The attached patch checks for overflow, and if it is detected, the
number of iocbs submitted is scaled down to a number that will fit in
the long. This is an ok thing to do, as sys_io_submit is documented as
returning the number of iocbs submitted, so callers should handle a
return value of less than the 'nr' argument passed in.
Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/aio.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/aio.c b/fs/aio.c
index 48fdeeb..94b6cd6 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1659,6 +1659,9 @@ long do_io_submit(aio_context_t ctx_id, long nr,
if (unlikely(nr < 0))
return -EINVAL;
+ if (unlikely(nr > LONG_MAX/sizeof(*iocbpp)))
+ nr = LONG_MAX/sizeof(*iocbpp);
+
if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(*iocbpp)))))
return -EFAULT;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 136/260] inotify: send IN_UNMOUNT events
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (134 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 135/260] aio: check for multiplication overflow in do_io_submit Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 137/260] mptsas: fix hangs caused by ATA pass-through Paul Gortmaker
` (125 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Eric Paris, Paul Gortmaker
From: Eric Paris <eparis@redhat.com>
commit 611da04f7a31b2208e838be55a42c7a1310ae321 upstream.
Since the .31 or so notify rewrite inotify has not sent events about
inodes which are unmounted. This patch restores those events.
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/notify/inotify/inotify_user.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index e46ca68..0c6bbc0 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -96,8 +96,11 @@ static inline __u32 inotify_arg_to_mask(u32 arg)
{
__u32 mask;
- /* everything should accept their own ignored and cares about children */
- mask = (FS_IN_IGNORED | FS_EVENT_ON_CHILD);
+ /*
+ * everything should accept their own ignored, cares about children,
+ * and should receive events when the inode is unmounted
+ */
+ mask = (FS_IN_IGNORED | FS_EVENT_ON_CHILD | FS_UNMOUNT);
/* mask off the flags used to open the fd */
mask |= (arg & (IN_ALL_EVENTS | IN_ONESHOT));
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 137/260] mptsas: fix hangs caused by ATA pass-through
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (135 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 136/260] inotify: send IN_UNMOUNT events Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 138/260] ext4: Fix remaining racy updates of EXT4_I(inode)->i_flags Paul Gortmaker
` (124 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ryan Kuester, James Bottomley, Paul Gortmaker
From: Ryan Kuester <rkuester@kspace.net>
commit 2a1b7e575b80ceb19ea50bfa86ce0053ea57181d upstream.
I may have an explanation for the LSI 1068 HBA hangs provoked by ATA
pass-through commands, in particular by smartctl.
First, my version of the symptoms. On an LSI SAS1068E B3 HBA running
01.29.00.00 firmware, with SATA disks, and with smartd running, I'm seeing
occasional task, bus, and host resets, some of which lead to hard faults of
the HBA requiring a reboot. Abusively looping the smartctl command,
# while true; do smartctl -a /dev/sdb > /dev/null; done
dramatically increases the frequency of these failures to nearly one per
minute. A high IO load through the HBA while looping smartctl seems to
improve the chance of a full scsi host reset or a non-recoverable hang.
I reduced what smartctl was doing down to a simple test case which
causes the hang with a single IO when pointed at the sd interface. See
the code at the bottom of this e-mail. It uses an SG_IO ioctl to issue
a single pass-through ATA identify device command. If the buffer
userspace gives for the read data has certain alignments, the task is
issued to the HBA but the HBA fails to respond. If run against the sg
interface, neither the test code nor smartctl causes a hang.
sd and sg handle the SG_IO ioctl slightly differently. Unless you
specifically set a flag to do direct IO, sg passes a buffer of its own,
which is page-aligned, to the block layer and later copies the result
into the userspace buffer regardless of its alignment. sd, on the other
hand, always does direct IO unless the userspace buffer fails an
alignment test at block/blk-map.c line 57, in which case a page-aligned
buffer is created and used for the transfer.
The alignment test currently checks for word-alignment, the default
setup by scsi_lib.c; therefore, userspace buffers of almost any
alignment are given directly to the HBA as DMA targets. The LSI 1068
hardware doesn't seem to like at least a couple of the alignments which
cross a page boundary (see the test code below). Curiously, many
page-boundary-crossing alignments do work just fine.
So, either the hardware has an bug handling certain alignments or the
hardware has a stricter alignment requirement than the driver is
advertising. If stricter alignment is required, then in no case should
misaligned buffers from userspace be allowed through without being
bounced or at least causing an error to be returned.
It seems the mptsas driver could use blk_queue_dma_alignment() to advertise
a stricter alignment requirement. If it does, sd does the right thing and
bounces misaligned buffers (see block/blk-map.c line 57). The following
patch to 2.6.34-rc5 makes my symptoms go away. I'm sure this is the wrong
place for this code, but it gets my idea across.
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/message/fusion/mptscsih.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 6796597..c13726a 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -2450,6 +2450,8 @@ mptscsih_slave_configure(struct scsi_device *sdev)
ioc->name,sdev->tagged_supported, sdev->simple_tags,
sdev->ordered_tags));
+ blk_queue_dma_alignment (sdev->request_queue, 512 - 1);
+
return 0;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 138/260] ext4: Fix remaining racy updates of EXT4_I(inode)->i_flags
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (136 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 137/260] mptsas: fix hangs caused by ATA pass-through Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 139/260] fix siglock Paul Gortmaker
` (123 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dmitry Monakhov, Theodore Ts'o, Paul Gortmaker
From: Dmitry Monakhov <dmonakhov@openvz.org>
commit 84a8dce2710cc425089a2b92acc354d4fbb5788d upstream.
A few functions were still modifying i_flags in a racy manner.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ext4/inode.c | 40 +++++++++++++++++++++++-----------------
1 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 3fd683f..4eced51 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4932,20 +4932,26 @@ void ext4_set_inode_flags(struct inode *inode)
/* Propagate flags from i_flags to EXT4_I(inode)->i_flags */
void ext4_get_inode_flags(struct ext4_inode_info *ei)
{
- unsigned int flags = ei->vfs_inode.i_flags;
-
- ei->i_flags &= ~(EXT4_SYNC_FL|EXT4_APPEND_FL|
- EXT4_IMMUTABLE_FL|EXT4_NOATIME_FL|EXT4_DIRSYNC_FL);
- if (flags & S_SYNC)
- ei->i_flags |= EXT4_SYNC_FL;
- if (flags & S_APPEND)
- ei->i_flags |= EXT4_APPEND_FL;
- if (flags & S_IMMUTABLE)
- ei->i_flags |= EXT4_IMMUTABLE_FL;
- if (flags & S_NOATIME)
- ei->i_flags |= EXT4_NOATIME_FL;
- if (flags & S_DIRSYNC)
- ei->i_flags |= EXT4_DIRSYNC_FL;
+ unsigned int vfs_fl;
+ unsigned long old_fl, new_fl;
+
+ do {
+ vfs_fl = ei->vfs_inode.i_flags;
+ old_fl = ei->i_flags;
+ new_fl = old_fl & ~(EXT4_SYNC_FL|EXT4_APPEND_FL|
+ EXT4_IMMUTABLE_FL|EXT4_NOATIME_FL|
+ EXT4_DIRSYNC_FL);
+ if (vfs_fl & S_SYNC)
+ new_fl |= EXT4_SYNC_FL;
+ if (vfs_fl & S_APPEND)
+ new_fl |= EXT4_APPEND_FL;
+ if (vfs_fl & S_IMMUTABLE)
+ new_fl |= EXT4_IMMUTABLE_FL;
+ if (vfs_fl & S_NOATIME)
+ new_fl |= EXT4_NOATIME_FL;
+ if (vfs_fl & S_DIRSYNC)
+ new_fl |= EXT4_DIRSYNC_FL;
+ } while (cmpxchg(&ei->i_flags, old_fl, new_fl) != old_fl);
}
static blkcnt_t ext4_inode_blocks(struct ext4_inode *raw_inode,
@@ -5182,7 +5188,7 @@ static int ext4_inode_blocks_set(handle_t *handle,
*/
raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
raw_inode->i_blocks_high = 0;
- ei->i_flags &= ~EXT4_HUGE_FILE_FL;
+ ext4_clear_inode_flag(inode, EXT4_INODE_HUGE_FILE);
return 0;
}
if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_HUGE_FILE))
@@ -5195,9 +5201,9 @@ static int ext4_inode_blocks_set(handle_t *handle,
*/
raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
raw_inode->i_blocks_high = cpu_to_le16(i_blocks >> 32);
- ei->i_flags &= ~EXT4_HUGE_FILE_FL;
+ ext4_clear_inode_flag(inode, EXT4_INODE_HUGE_FILE);
} else {
- ei->i_flags |= EXT4_HUGE_FILE_FL;
+ ext4_set_inode_flag(inode, EXT4_INODE_HUGE_FILE);
/* i_block is stored in file system block size */
i_blocks = i_blocks >> (inode->i_blkbits - 9);
raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 139/260] fix siglock
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (137 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 138/260] ext4: Fix remaining racy updates of EXT4_I(inode)->i_flags Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 140/260] Optimize ticket spinlocks in fsys_rt_sigprocmask Paul Gortmaker
` (122 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Tony Luck, Paul Gortmaker
From: Tony Luck <tony.luck@intel.com>
commit f574c843191728d9407b766a027f779dcd27b272 upstream.
When ia64 converted to using ticket locks, an inline implementation
of trylock/unlock in fsys.S was missed. This was not noticed because
in most circumstances it simply resulted in using the slow path because
the siglock was apparently not available (under old spinlock rules).
Problems occur when the ticket spinlock has value 0x0 (when first
initialised, or when it wraps around). At this point the fsys.S
code acquires the lock (changing the 0x0 to 0x1. If another process
attempts to get the lock at this point, it will change the value from
0x1 to 0x2 (using new ticket lock rules). Then the fsys.S code will
free the lock using old spinlock rules by writing 0x0 to it. From
here a variety of bad things can happen.
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/ia64/kernel/fsys.S | 46 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 3567d54..471a1e7 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -424,14 +424,26 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set
andcm r14=r14,r17 // filter out SIGKILL & SIGSTOP
#ifdef CONFIG_SMP
- mov r17=1
- ;;
- cmpxchg4.acq r18=[r31],r17,ar.ccv // try to acquire the lock
+ // __ticket_spin_trylock(r31)
+ ld4 r17=[r31]
mov r8=EINVAL // default to EINVAL
;;
+ extr r9=r17,17,15
+ ;;
+ xor r18=r17,r9
+ adds r19=1,r17
+ ;;
+ extr.u r18=r18,0,15
+ ;;
+ cmp.eq p0,p7=0,r18
+(p7) br.cond.spnt.many .lock_contention
+ mov.m ar.ccv=r17
+ ;;
+ cmpxchg4.acq r9=[r31],r19,ar.ccv
+ ;;
+ cmp4.eq p0,p7=r9,r17
+(p7) br.cond.spnt.many .lock_contention
ld8 r3=[r2] // re-read current->blocked now that we hold the lock
- cmp4.ne p6,p0=r18,r0
-(p6) br.cond.spnt.many .lock_contention
;;
#else
ld8 r3=[r2] // re-read current->blocked now that we hold the lock
@@ -490,7 +502,17 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set
(p6) br.cond.spnt.few 1b // yes -> retry
#ifdef CONFIG_SMP
- st4.rel [r31]=r0 // release the lock
+ // __ticket_spin_unlock(r31)
+ adds r31=2,r31
+ ;;
+ ld2.bias r2=[r31]
+ mov r3=65534
+ ;;
+ adds r2=2,r2
+ ;;
+ and r3=r3,r2
+ ;;
+ st2.rel [r31]=r3
#endif
SSM_PSR_I(p0, p9, r31)
;;
@@ -512,7 +534,17 @@ EX(.fail_efault, (p15) st8 [r34]=r3)
.sig_pending:
#ifdef CONFIG_SMP
- st4.rel [r31]=r0 // release the lock
+ // __ticket_spin_unlock(r31)
+ adds r31=2,r31
+ ;;
+ ld2.bias r2=[r31]
+ mov r3=65534
+ ;;
+ adds r2=2,r2
+ ;;
+ and r3=r3,r2
+ ;;
+ st2.rel [r31]=r3
#endif
SSM_PSR_I(p0, p9, r17)
;;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 140/260] Optimize ticket spinlocks in fsys_rt_sigprocmask
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (138 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 139/260] fix siglock Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 141/260] KEYS: Fix RCU no-lock warning in keyctl_session_to_parent() Paul Gortmaker
` (121 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Petr Tesarik, Tony Luck, Paul Gortmaker
From: Petr Tesarik <ptesarik@suse.cz>
commit 2d2b6901649a62977452be85df53eda2412def24 upstream.
Tony's fix (f574c843191728d9407b766a027f779dcd27b272) has a small bug,
it incorrectly uses "r3" as a scratch register in the first of the two
unlock paths ... it is also inefficient. Optimize the fast path again.
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/ia64/kernel/fsys.S | 42 +++++++++++-------------------------------
1 files changed, 11 insertions(+), 31 deletions(-)
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 471a1e7..331d42b 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -420,34 +420,31 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set
;;
RSM_PSR_I(p0, r18, r19) // mask interrupt delivery
- mov ar.ccv=0
andcm r14=r14,r17 // filter out SIGKILL & SIGSTOP
+ mov r8=EINVAL // default to EINVAL
#ifdef CONFIG_SMP
// __ticket_spin_trylock(r31)
ld4 r17=[r31]
- mov r8=EINVAL // default to EINVAL
- ;;
- extr r9=r17,17,15
;;
- xor r18=r17,r9
+ mov.m ar.ccv=r17
+ extr.u r9=r17,17,15
adds r19=1,r17
+ extr.u r18=r17,0,15
;;
- extr.u r18=r18,0,15
+ cmp.eq p6,p7=r9,r18
;;
- cmp.eq p0,p7=0,r18
+(p6) cmpxchg4.acq r9=[r31],r19,ar.ccv
+(p6) dep.z r20=r19,1,15 // next serving ticket for unlock
(p7) br.cond.spnt.many .lock_contention
- mov.m ar.ccv=r17
- ;;
- cmpxchg4.acq r9=[r31],r19,ar.ccv
;;
cmp4.eq p0,p7=r9,r17
+ adds r31=2,r31
(p7) br.cond.spnt.many .lock_contention
ld8 r3=[r2] // re-read current->blocked now that we hold the lock
;;
#else
ld8 r3=[r2] // re-read current->blocked now that we hold the lock
- mov r8=EINVAL // default to EINVAL
#endif
add r18=IA64_TASK_PENDING_OFFSET+IA64_SIGPENDING_SIGNAL_OFFSET,r16
add r19=IA64_TASK_SIGNAL_OFFSET,r16
@@ -503,16 +500,8 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set
#ifdef CONFIG_SMP
// __ticket_spin_unlock(r31)
- adds r31=2,r31
- ;;
- ld2.bias r2=[r31]
- mov r3=65534
- ;;
- adds r2=2,r2
- ;;
- and r3=r3,r2
- ;;
- st2.rel [r31]=r3
+ st2.rel [r31]=r20
+ mov r20=0 // i must not leak kernel bits...
#endif
SSM_PSR_I(p0, p9, r31)
;;
@@ -535,16 +524,7 @@ EX(.fail_efault, (p15) st8 [r34]=r3)
.sig_pending:
#ifdef CONFIG_SMP
// __ticket_spin_unlock(r31)
- adds r31=2,r31
- ;;
- ld2.bias r2=[r31]
- mov r3=65534
- ;;
- adds r2=2,r2
- ;;
- and r3=r3,r2
- ;;
- st2.rel [r31]=r3
+ st2.rel [r31]=r20 // release the lock
#endif
SSM_PSR_I(p0, p9, r17)
;;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 141/260] KEYS: Fix RCU no-lock warning in keyctl_session_to_parent()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (139 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 140/260] Optimize ticket spinlocks in fsys_rt_sigprocmask Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 142/260] KEYS: Fix bug in keyctl_session_to_parent() if parent has no session keyring Paul Gortmaker
` (120 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, David Howells, Linus Torvalds, Paul Gortmaker
From: David Howells <dhowells@redhat.com>
commit 9d1ac65a9698513d00e5608d93fca0c53f536c14 upstream.
There's an protected access to the parent process's credentials in the middle
of keyctl_session_to_parent(). This results in the following RCU warning:
===================================================
[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
security/keys/keyctl.c:1291 invoked rcu_dereference_check() without protection!
other info that might help us debug this:
rcu_scheduler_active = 1, debug_locks = 0
1 lock held by keyctl-session-/2137:
#0: (tasklist_lock){.+.+..}, at: [<ffffffff811ae2ec>] keyctl_session_to_parent+0x60/0x236
stack backtrace:
Pid: 2137, comm: keyctl-session- Not tainted 2.6.36-rc2-cachefs+ #1
Call Trace:
[<ffffffff8105606a>] lockdep_rcu_dereference+0xaa/0xb3
[<ffffffff811ae379>] keyctl_session_to_parent+0xed/0x236
[<ffffffff811af77e>] sys_keyctl+0xb4/0xb6
[<ffffffff81001eab>] system_call_fastpath+0x16/0x1b
The code should take the RCU read lock to make sure the parents credentials
don't go away, even though it's holding a spinlock and has IRQ disabled.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
security/keys/keyctl.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index e9c2e7c..d29e022 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1259,6 +1259,7 @@ long keyctl_session_to_parent(void)
keyring_r = NULL;
me = current;
+ rcu_read_lock();
write_lock_irq(&tasklist_lock);
parent = me->real_parent;
@@ -1313,6 +1314,7 @@ long keyctl_session_to_parent(void)
set_ti_thread_flag(task_thread_info(parent), TIF_NOTIFY_RESUME);
write_unlock_irq(&tasklist_lock);
+ rcu_read_unlock();
if (oldcred)
put_cred(oldcred);
return 0;
@@ -1321,6 +1323,7 @@ already_same:
ret = 0;
not_permitted:
write_unlock_irq(&tasklist_lock);
+ rcu_read_unlock();
put_cred(cred);
return ret;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 142/260] KEYS: Fix bug in keyctl_session_to_parent() if parent has no session keyring
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (140 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 141/260] KEYS: Fix RCU no-lock warning in keyctl_session_to_parent() Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 143/260] xfs: prevent reading uninitialized stack memory Paul Gortmaker
` (119 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, David Howells, dann frazier, Linus Torvalds,
Paul Gortmaker
From: David Howells <dhowells@redhat.com>
commit 3d96406c7da1ed5811ea52a3b0905f4f0e295376 upstream.
Fix a bug in keyctl_session_to_parent() whereby it tries to check the ownership
of the parent process's session keyring whether or not the parent has a session
keyring [CVE-2010-2960].
This results in the following oops:
BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
IP: [<ffffffff811ae4dd>] keyctl_session_to_parent+0x251/0x443
...
Call Trace:
[<ffffffff811ae2f3>] ? keyctl_session_to_parent+0x67/0x443
[<ffffffff8109d286>] ? __do_fault+0x24b/0x3d0
[<ffffffff811af98c>] sys_keyctl+0xb4/0xb8
[<ffffffff81001eab>] system_call_fastpath+0x16/0x1b
if the parent process has no session keyring.
If the system is using pam_keyinit then it mostly protected against this as all
processes derived from a login will have inherited the session keyring created
by pam_keyinit during the log in procedure.
To test this, pam_keyinit calls need to be commented out in /etc/pam.d/.
Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Tavis Ormandy <taviso@cmpxchg8b.com>
Cc: dann frazier <dannf@debian.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
security/keys/keyctl.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index d29e022..c25603a 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1292,7 +1292,8 @@ long keyctl_session_to_parent(void)
goto not_permitted;
/* the keyrings must have the same UID */
- if (pcred ->tgcred->session_keyring->uid != mycred->euid ||
+ if ((pcred->tgcred->session_keyring &&
+ pcred->tgcred->session_keyring->uid != mycred->euid) ||
mycred->tgcred->session_keyring->uid != mycred->euid)
goto not_permitted;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 143/260] xfs: prevent reading uninitialized stack memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (141 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 142/260] KEYS: Fix bug in keyctl_session_to_parent() if parent has no session keyring Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 144/260] drivers/video/via/ioctl.c: " Paul Gortmaker
` (118 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Alex Elder, Paul Gortmaker
From: Dan Rosenberg <dan.j.rosenberg@gmail.com>
commit a122eb2fdfd78b58c6dd992d6f4b1aaef667eef9 upstream.
The XFS_IOC_FSGETXATTR ioctl allows unprivileged users to read 12
bytes of uninitialized stack memory, because the fsxattr struct
declared on the stack in xfs_ioc_fsgetxattr() does not alter (or zero)
the 12-byte fsx_pad member before copying it back to the user. This
patch takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/xfs/linux-2.6/xfs_ioctl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 7b26cc2..3da1da7 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -791,6 +791,8 @@ xfs_ioc_fsgetxattr(
{
struct fsxattr fa;
+ memset(&fa, 0, sizeof(struct fsxattr));
+
xfs_ilock(ip, XFS_ILOCK_SHARED);
fa.fsx_xflags = xfs_ip2xflags(ip);
fa.fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 144/260] drivers/video/via/ioctl.c: prevent reading uninitialized stack memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (142 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 143/260] xfs: prevent reading uninitialized stack memory Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 145/260] AT91: change dma resource index Paul Gortmaker
` (117 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Dan Rosenberg,
Florian Tobias Schandinat, Paul Gortmaker
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit b4aaa78f4c2f9cde2f335b14f4ca30b01f9651ca upstream.
The VIAFB_GET_INFO device ioctl allows unprivileged users to read 246
bytes of uninitialized stack memory, because the "reserved" member of
the viafb_ioctl_info struct declared on the stack is not altered or
zeroed before being copied back to the user. This patch takes care of
it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/video/via/ioctl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/via/ioctl.c b/drivers/video/via/ioctl.c
index da03c07..4d553d0 100644
--- a/drivers/video/via/ioctl.c
+++ b/drivers/video/via/ioctl.c
@@ -25,6 +25,8 @@ int viafb_ioctl_get_viafb_info(u_long arg)
{
struct viafb_ioctl_info viainfo;
+ memset(&viainfo, 0, sizeof(struct viafb_ioctl_info));
+
viainfo.viafb_id = VIAID;
viainfo.vendor_id = PCI_VIA_VENDOR_ID;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 145/260] AT91: change dma resource index
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (143 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 144/260] drivers/video/via/ioctl.c: " Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 146/260] mm: page allocator: drain per-cpu lists after direct reclaim allocation fails Paul Gortmaker
` (116 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Nicolas Ferre, Paul Gortmaker
From: Nicolas Ferre <nicolas.ferre@atmel.com>
commit 8d2602e0778299e2d6084f03086b716d6e7a1e1e upstream.
Reported-by: Dan Liang <dan.liang@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/arm/mach-at91/at91sam9g45_devices.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 809114d..501ac6f 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -46,7 +46,7 @@ static struct resource hdmac_resources[] = {
.end = AT91_BASE_SYS + AT91_DMA + SZ_512 - 1,
.flags = IORESOURCE_MEM,
},
- [2] = {
+ [1] = {
.start = AT91SAM9G45_ID_DMA,
.end = AT91SAM9G45_ID_DMA,
.flags = IORESOURCE_IRQ,
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 146/260] mm: page allocator: drain per-cpu lists after direct reclaim allocation fails
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (144 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 145/260] AT91: change dma resource index Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 147/260] mm: page allocator: calculate a better estimate of NR_FREE_PAGES when memory is low and kswapd is awake Paul Gortmaker
` (115 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Mel Gorman, Dave Chinner, Wu Fengguang,
David Rientjes, Andrew Morton, Linus Torvalds, Paul Gortmaker
From: Mel Gorman <mel@csn.ul.ie>
commit 9ee493ce0a60bf42c0f8fd0b0fe91df5704a1cbf upstream.
When under significant memory pressure, a process enters direct reclaim
and immediately afterwards tries to allocate a page. If it fails and no
further progress is made, it's possible the system will go OOM. However,
on systems with large amounts of memory, it's possible that a significant
number of pages are on per-cpu lists and inaccessible to the calling
process. This leads to a process entering direct reclaim more often than
it should increasing the pressure on the system and compounding the
problem.
This patch notes that if direct reclaim is making progress but allocations
are still failing that the system is already under heavy pressure. In
this case, it drains the per-cpu lists and tries the allocation a second
time before continuing.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/page_alloc.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 35268ac..a2af9bc 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1703,6 +1703,7 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
struct page *page = NULL;
struct reclaim_state reclaim_state;
struct task_struct *p = current;
+ bool drained = false;
cond_resched();
@@ -1721,14 +1722,25 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
cond_resched();
- if (order != 0)
- drain_all_pages();
+ if (unlikely(!(*did_some_progress)))
+ return NULL;
- if (likely(*did_some_progress))
- page = get_page_from_freelist(gfp_mask, nodemask, order,
+retry:
+ page = get_page_from_freelist(gfp_mask, nodemask, order,
zonelist, high_zoneidx,
alloc_flags, preferred_zone,
migratetype);
+
+ /*
+ * If an allocation failed after direct reclaim, it could be because
+ * pages are pinned on the per-cpu lists. Drain them and try again
+ */
+ if (!page && !drained) {
+ drain_all_pages();
+ drained = true;
+ goto retry;
+ }
+
return page;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 147/260] mm: page allocator: calculate a better estimate of NR_FREE_PAGES when memory is low and kswapd is awake
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (145 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 146/260] mm: page allocator: drain per-cpu lists after direct reclaim allocation fails Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 148/260] mm: page allocator: update free page counters after pages are placed on the free list Paul Gortmaker
` (114 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Christoph Lameter, Mel Gorman, Andrew Morton,
Linus Torvalds, Paul Gortmaker
From: Christoph Lameter <cl@linux.com>
commit aa45484031ddee09b06350ab8528bfe5b2c76d1c upstream.
Ordinarily watermark checks are based on the vmstat NR_FREE_PAGES as it is
cheaper than scanning a number of lists. To avoid synchronization
overhead, counter deltas are maintained on a per-cpu basis and drained
both periodically and when the delta is above a threshold. On large CPU
systems, the difference between the estimated and real value of
NR_FREE_PAGES can be very high. If NR_FREE_PAGES is much higher than
number of real free page in buddy, the VM can allocate pages below min
watermark, at worst reducing the real number of pages to zero. Even if
the OOM killer kills some victim for freeing memory, it may not free
memory if the exit path requires a new page resulting in livelock.
This patch introduces a zone_page_state_snapshot() function (courtesy of
Christoph) that takes a slightly more accurate view of an arbitrary vmstat
counter. It is used to read NR_FREE_PAGES while kswapd is awake to avoid
the watermark being accidentally broken. The estimate is not perfect and
may result in cache line bounces but is expected to be lighter than the
IPI calls necessary to continually drain the per-cpu counters while kswapd
is awake.
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/mmzone.h | 13 +++++++++++++
include/linux/vmstat.h | 22 ++++++++++++++++++++++
mm/mmzone.c | 21 +++++++++++++++++++++
mm/page_alloc.c | 4 ++--
mm/vmstat.c | 15 ++++++++++++++-
5 files changed, 72 insertions(+), 3 deletions(-)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index cf9e458..468e9fb 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -284,6 +284,13 @@ struct zone {
unsigned long watermark[NR_WMARK];
/*
+ * When free pages are below this point, additional steps are taken
+ * when reading the number of free pages to avoid per-cpu counter
+ * drift allowing watermarks to be breached
+ */
+ unsigned long percpu_drift_mark;
+
+ /*
* We don't know if the memory that we're going to allocate will be freeable
* or/and it will be released eventually, so to avoid totally wasting several
* GB of ram we must reserve some of the lower zone memory (otherwise we risk
@@ -447,6 +454,12 @@ static inline int zone_is_oom_locked(const struct zone *zone)
return test_bit(ZONE_OOM_LOCKED, &zone->flags);
}
+#ifdef CONFIG_SMP
+unsigned long zone_nr_free_pages(struct zone *zone);
+#else
+#define zone_nr_free_pages(zone) zone_page_state(zone, NR_FREE_PAGES)
+#endif /* CONFIG_SMP */
+
/*
* The "priority" of VM scanning is how much of the queues we will scan in one
* go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 117f0dd..5c9c132 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -166,6 +166,28 @@ static inline unsigned long zone_page_state(struct zone *zone,
return x;
}
+/*
+ * More accurate version that also considers the currently pending
+ * deltas. For that we need to loop over all cpus to find the current
+ * deltas. There is no synchronization so the result cannot be
+ * exactly accurate either.
+ */
+static inline unsigned long zone_page_state_snapshot(struct zone *zone,
+ enum zone_stat_item item)
+{
+ long x = atomic_long_read(&zone->vm_stat[item]);
+
+#ifdef CONFIG_SMP
+ int cpu;
+ for_each_online_cpu(cpu)
+ x += per_cpu_ptr(zone->pageset, cpu)->vm_stat_diff[item];
+
+ if (x < 0)
+ x = 0;
+#endif
+ return x;
+}
+
extern unsigned long global_reclaimable_pages(void);
extern unsigned long zone_reclaimable_pages(struct zone *zone);
diff --git a/mm/mmzone.c b/mm/mmzone.c
index f5b7d17..e35bfb8 100644
--- a/mm/mmzone.c
+++ b/mm/mmzone.c
@@ -87,3 +87,24 @@ int memmap_valid_within(unsigned long pfn,
return 1;
}
#endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */
+
+#ifdef CONFIG_SMP
+/* Called when a more accurate view of NR_FREE_PAGES is needed */
+unsigned long zone_nr_free_pages(struct zone *zone)
+{
+ unsigned long nr_free_pages = zone_page_state(zone, NR_FREE_PAGES);
+
+ /*
+ * While kswapd is awake, it is considered the zone is under some
+ * memory pressure. Under pressure, there is a risk that
+ * per-cpu-counter-drift will allow the min watermark to be breached
+ * potentially causing a live-lock. While kswapd is awake and
+ * free pages are low, get a better estimate for free pages
+ */
+ if (nr_free_pages < zone->percpu_drift_mark &&
+ !waitqueue_active(&zone->zone_pgdat->kswapd_wait))
+ return zone_page_state_snapshot(zone, NR_FREE_PAGES);
+
+ return nr_free_pages;
+}
+#endif /* CONFIG_SMP */
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a2af9bc..0de096a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1377,7 +1377,7 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
{
/* free_pages my go negative - that's OK */
long min = mark;
- long free_pages = zone_page_state(z, NR_FREE_PAGES) - (1 << order) + 1;
+ long free_pages = zone_nr_free_pages(z) - (1 << order) + 1;
int o;
if (alloc_flags & ALLOC_HIGH)
@@ -2271,7 +2271,7 @@ void show_free_areas(void)
" all_unreclaimable? %s"
"\n",
zone->name,
- K(zone_page_state(zone, NR_FREE_PAGES)),
+ K(zone_nr_free_pages(zone)),
K(min_wmark_pages(zone)),
K(low_wmark_pages(zone)),
K(high_wmark_pages(zone)),
diff --git a/mm/vmstat.c b/mm/vmstat.c
index fa12ea3..97f64e4 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -137,11 +137,24 @@ static void refresh_zone_stat_thresholds(void)
int threshold;
for_each_populated_zone(zone) {
+ unsigned long max_drift, tolerate_drift;
+
threshold = calculate_threshold(zone);
for_each_online_cpu(cpu)
per_cpu_ptr(zone->pageset, cpu)->stat_threshold
= threshold;
+
+ /*
+ * Only set percpu_drift_mark if there is a danger that
+ * NR_FREE_PAGES reports the low watermark is ok when in fact
+ * the min watermark could be breached by an allocation
+ */
+ tolerate_drift = low_wmark_pages(zone) - min_wmark_pages(zone);
+ max_drift = num_online_cpus() * threshold;
+ if (max_drift > tolerate_drift)
+ zone->percpu_drift_mark = high_wmark_pages(zone) +
+ max_drift;
}
}
@@ -721,7 +734,7 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
"\n scanned %lu"
"\n spanned %lu"
"\n present %lu",
- zone_page_state(zone, NR_FREE_PAGES),
+ zone_nr_free_pages(zone),
min_wmark_pages(zone),
low_wmark_pages(zone),
high_wmark_pages(zone),
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 148/260] mm: page allocator: update free page counters after pages are placed on the free list
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (146 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 147/260] mm: page allocator: calculate a better estimate of NR_FREE_PAGES when memory is low and kswapd is awake Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 149/260] guard page for stacks that grow upwards Paul Gortmaker
` (113 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Mel Gorman, Andrew Morton, Linus Torvalds,
Paul Gortmaker
From: Mel Gorman <mel@csn.ul.ie>
commit 72853e2991a2702ae93aaf889ac7db743a415dd3 upstream.
When allocating a page, the system uses NR_FREE_PAGES counters to
determine if watermarks would remain intact after the allocation was made.
This check is made without interrupts disabled or the zone lock held and
so is race-prone by nature. Unfortunately, when pages are being freed in
batch, the counters are updated before the pages are added on the list.
During this window, the counters are misleading as the pages do not exist
yet. When under significant pressure on systems with large numbers of
CPUs, it's possible for processes to make progress even though they should
have been stalled. This is particularly problematic if a number of the
processes are using GFP_ATOMIC as the min watermark can be accidentally
breached and in extreme cases, the system can livelock.
This patch updates the counters after the pages have been added to the
list. This makes the allocator more cautious with respect to preserving
the watermarks and mitigates livelock possibilities.
[akpm@linux-foundation.org: avoid modifying incoming args]
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/page_alloc.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0de096a..9826a8d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -551,13 +551,13 @@ static void free_pcppages_bulk(struct zone *zone, int count,
{
int migratetype = 0;
int batch_free = 0;
+ int to_free = count;
spin_lock(&zone->lock);
zone->all_unreclaimable = 0;
zone->pages_scanned = 0;
- __mod_zone_page_state(zone, NR_FREE_PAGES, count);
- while (count) {
+ while (to_free) {
struct page *page;
struct list_head *list;
@@ -582,8 +582,9 @@ static void free_pcppages_bulk(struct zone *zone, int count,
/* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */
__free_one_page(page, zone, 0, page_private(page));
trace_mm_page_pcpu_drain(page, 0, page_private(page));
- } while (--count && --batch_free && !list_empty(list));
+ } while (--to_free && --batch_free && !list_empty(list));
}
+ __mod_zone_page_state(zone, NR_FREE_PAGES, count);
spin_unlock(&zone->lock);
}
@@ -594,8 +595,8 @@ static void free_one_page(struct zone *zone, struct page *page, int order,
zone->all_unreclaimable = 0;
zone->pages_scanned = 0;
- __mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order);
__free_one_page(page, zone, order, migratetype);
+ __mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order);
spin_unlock(&zone->lock);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 149/260] guard page for stacks that grow upwards
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (147 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 148/260] mm: page allocator: update free page counters after pages are placed on the free list Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 150/260] Fix unprotected access to task credentials in waitid() Paul Gortmaker
` (112 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Luck, Tony, Linus Torvalds, Paul Gortmaker
From: Luck, Tony <tony.luck@intel.com>
commit 8ca3eb08097f6839b2206e2242db4179aee3cfb3 upstream.
pa-risc and ia64 have stacks that grow upwards. Check that
they do not run into other mappings. By making VM_GROWSUP
0x0 on architectures that do not ever use it, we can avoid
some unpleasant #ifdefs in check_stack_guard_page().
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/mm.h | 8 +++++++-
mm/memory.c | 15 +++++++++++----
mm/mmap.c | 3 ---
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 462acaf..04fb7f6 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -78,7 +78,11 @@ extern unsigned int kobjsize(const void *objp);
#define VM_MAYSHARE 0x00000080
#define VM_GROWSDOWN 0x00000100 /* general info on the segment */
+#if defined(CONFIG_STACK_GROWSUP) || defined(CONFIG_IA64)
#define VM_GROWSUP 0x00000200
+#else
+#define VM_GROWSUP 0x00000000
+#endif
#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */
#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */
@@ -1325,8 +1329,10 @@ unsigned long ra_submit(struct file_ra_state *ra,
/* Do stack extension */
extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
-#ifdef CONFIG_IA64
+#if VM_GROWSUP
extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
+#else
+ #define expand_upwards(vma, address) do { } while (0)
#endif
extern int expand_stack_downwards(struct vm_area_struct *vma,
unsigned long address);
diff --git a/mm/memory.c b/mm/memory.c
index 47fb0a0..3410236 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2751,11 +2751,9 @@ out_release:
}
/*
- * This is like a special single-page "expand_downwards()",
- * except we must first make sure that 'address-PAGE_SIZE'
+ * This is like a special single-page "expand_{down|up}wards()",
+ * except we must first make sure that 'address{-|+}PAGE_SIZE'
* doesn't hit another vma.
- *
- * The "find_vma()" will do the right thing even if we wrap
*/
static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address)
{
@@ -2774,6 +2772,15 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo
expand_stack(vma, address - PAGE_SIZE);
}
+ if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) {
+ struct vm_area_struct *next = vma->vm_next;
+
+ /* As VM_GROWSDOWN but s/below/above/ */
+ if (next && next->vm_start == address + PAGE_SIZE)
+ return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM;
+
+ expand_upwards(vma, address + PAGE_SIZE);
+ }
return 0;
}
diff --git a/mm/mmap.c b/mm/mmap.c
index 3867cfc..10cb197 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1704,9 +1704,6 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
* PA-RISC uses this for its stack; IA64 for its Register Backing Store.
* vma is the last one with address > vma->vm_end. Have to extend vma.
*/
-#ifndef CONFIG_IA64
-static
-#endif
int expand_upwards(struct vm_area_struct *vma, unsigned long address)
{
int error;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 150/260] Fix unprotected access to task credentials in waitid()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (148 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 149/260] guard page for stacks that grow upwards Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 151/260] sctp: Do not reset the packet during sctp_packet_config() Paul Gortmaker
` (111 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Daniel J Blueman, David Howells, Linus Torvalds,
Paul Gortmaker
From: Daniel J Blueman <daniel.blueman@gmail.com>
commit f362b73244fb16ea4ae127ced1467dd8adaa7733 upstream.
Using a program like the following:
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
int main() {
id_t id;
siginfo_t infop;
pid_t res;
id = fork();
if (id == 0) { sleep(1); exit(0); }
kill(id, SIGSTOP);
alarm(1);
waitid(P_PID, id, &infop, WCONTINUED);
return 0;
}
to call waitid() on a stopped process results in access to the child task's
credentials without the RCU read lock being held - which may be replaced in the
meantime - eliciting the following warning:
===================================================
[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
kernel/exit.c:1460 invoked rcu_dereference_check() without protection!
other info that might help us debug this:
rcu_scheduler_active = 1, debug_locks = 1
2 locks held by waitid02/22252:
#0: (tasklist_lock){.?.?..}, at: [<ffffffff81061ce5>] do_wait+0xc5/0x310
#1: (&(&sighand->siglock)->rlock){-.-...}, at: [<ffffffff810611da>]
wait_consider_task+0x19a/0xbe0
stack backtrace:
Pid: 22252, comm: waitid02 Not tainted 2.6.35-323cd+ #3
Call Trace:
[<ffffffff81095da4>] lockdep_rcu_dereference+0xa4/0xc0
[<ffffffff81061b31>] wait_consider_task+0xaf1/0xbe0
[<ffffffff81061d15>] do_wait+0xf5/0x310
[<ffffffff810620b6>] sys_waitid+0x86/0x1f0
[<ffffffff8105fce0>] ? child_wait_callback+0x0/0x70
[<ffffffff81003282>] system_call_fastpath+0x16/0x1b
This is fixed by holding the RCU read lock in wait_task_continued() to ensure
that the task's current credentials aren't destroyed between us reading the
cred pointer and us reading the UID from those credentials.
Furthermore, protect wait_task_stopped() in the same way.
We don't need to keep holding the RCU read lock once we've read the UID from
the credentials as holding the RCU read lock doesn't stop the target task from
changing its creds under us - so the credentials may be outdated immediately
after we've read the pointer, lock or no lock.
Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/exit.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/exit.c b/kernel/exit.c
index 7f2683a..b0242b4 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1392,8 +1392,7 @@ static int wait_task_stopped(struct wait_opts *wo,
if (!unlikely(wo->wo_flags & WNOWAIT))
*p_code = 0;
- /* don't need the RCU readlock here as we're holding a spinlock */
- uid = __task_cred(p)->uid;
+ uid = task_uid(p);
unlock_sig:
spin_unlock_irq(&p->sighand->siglock);
if (!exit_code)
@@ -1466,7 +1465,7 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p)
}
if (!unlikely(wo->wo_flags & WNOWAIT))
p->signal->flags &= ~SIGNAL_STOP_CONTINUED;
- uid = __task_cred(p)->uid;
+ uid = task_uid(p);
spin_unlock_irq(&p->sighand->siglock);
pid = task_pid_vnr(p);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 151/260] sctp: Do not reset the packet during sctp_packet_config().
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (149 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 150/260] Fix unprotected access to task credentials in waitid() Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 152/260] dasd: use correct label location for diag fba disks Paul Gortmaker
` (110 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Vlad Yasevich, David S. Miller, Paul Gortmaker
From: Vlad Yasevich <vladislav.yasevich@hp.com>
commit 4bdab43323b459900578b200a4b8cf9713ac8fab upstream.
sctp_packet_config() is called when getting the packet ready
for appending of chunks. The function should not touch the
current state, since it's possible to ping-pong between two
transports when sending, and that can result packet corruption
followed by skb overlfow crash.
Reported-by: Thomas Dreibholz <dreibh@iem.uni-due.de>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/sctp/output.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/sctp/output.c b/net/sctp/output.c
index fad261d..5468d41 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -92,7 +92,6 @@ struct sctp_packet *sctp_packet_config(struct sctp_packet *packet,
SCTP_DEBUG_PRINTK("%s: packet:%p vtag:0x%x\n", __func__,
packet, vtag);
- sctp_packet_reset(packet);
packet->vtag = vtag;
if (ecn_capable && sctp_packet_empty(packet)) {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 152/260] dasd: use correct label location for diag fba disks
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (150 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 151/260] sctp: Do not reset the packet during sctp_packet_config() Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 153/260] hostap_pci: set dev->base_addr during probe Paul Gortmaker
` (109 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Peter Oberparleiter, Martin Schwidefsky,
Paul Gortmaker
From: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
commit cffab6bc5511cd6f67a60bf16b62de4267b68c4c upstream.
Partition boundary calculation fails for DASD FBA disks under the
following conditions:
- disk is formatted with CMS FORMAT with a blocksize of more than
512 bytes
- all of the disk is reserved to a single CMS file using CMS RESERVE
- the disk is accessed using the DIAG mode of the DASD driver
Under these circumstances, the partition detection code tries to
read the CMS label block containing partition-relevant information
from logical block offset 1, while it is in fact located at physical
block offset 1.
Fix this problem by using the correct CMS label block location
depending on the device type as determined by the DASD SENSE ID
information.
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/partitions/ibm.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c
index fc71aab..bae725b 100644
--- a/fs/partitions/ibm.c
+++ b/fs/partitions/ibm.c
@@ -74,6 +74,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
} *label;
unsigned char *data;
Sector sect;
+ sector_t labelsect;
res = 0;
blocksize = bdev_logical_block_size(bdev);
@@ -98,9 +99,19 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
goto out_freeall;
/*
+ * Special case for FBA disks: label sector does not depend on
+ * blocksize.
+ */
+ if ((info->cu_type == 0x6310 && info->dev_type == 0x9336) ||
+ (info->cu_type == 0x3880 && info->dev_type == 0x3370))
+ labelsect = info->label_block;
+ else
+ labelsect = info->label_block * (blocksize >> 9);
+
+ /*
* Get volume label, extract name and type.
*/
- data = read_dev_sector(bdev, info->label_block*(blocksize/512), §);
+ data = read_dev_sector(bdev, labelsect, §);
if (data == NULL)
goto out_readerr;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 153/260] hostap_pci: set dev->base_addr during probe
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (151 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 152/260] dasd: use correct label location for diag fba disks Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 154/260] inotify: fix inotify oneshot support Paul Gortmaker
` (108 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, John W. Linville, Paul Gortmaker
From: John W. Linville <linville@tuxdriver.com>
commit 0f4da2d77e1bf424ac36424081afc22cbfc3ff2b upstream.
"hostap: Protect against initialization interrupt" (which reinstated
"wireless: hostap, fix oops due to early probing interrupt")
reintroduced Bug 16111. This is because hostap_pci wasn't setting
dev->base_addr, which is now checked in prism2_interrupt. As a result,
initialization was failing for PCI-based hostap devices. This corrects
that oversight.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/wireless/hostap/hostap_pci.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
index d24dc7d..972a9c3 100644
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -330,6 +330,7 @@ static int prism2_pci_probe(struct pci_dev *pdev,
dev->irq = pdev->irq;
hw_priv->mem_start = mem;
+ dev->base_addr = (unsigned long) mem;
prism2_pci_cor_sreset(local);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 154/260] inotify: fix inotify oneshot support
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (152 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 153/260] hostap_pci: set dev->base_addr during probe Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 155/260] MIPS: Quit using undefined behavior of ADDU in 64-bit atomic operations Paul Gortmaker
` (107 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Eric Paris, Paul Gortmaker
From: Eric Paris <eparis@redhat.com>
commit ff311008ab8d2f2cfdbbefd407d1b05acc8164b2 upstream.
During the large inotify rewrite to fsnotify I completely dropped support
for IN_ONESHOT. Reimplement that support.
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/notify/inotify/inotify_fsnotify.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
index e27960c..5d3d2a7 100644
--- a/fs/notify/inotify/inotify_fsnotify.c
+++ b/fs/notify/inotify/inotify_fsnotify.c
@@ -72,6 +72,9 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev
ret = 0;
}
+ if (entry->mask & IN_ONESHOT)
+ fsnotify_destroy_mark_by_entry(entry);
+
/*
* If we hold the entry until after the event is on the queue
* IN_IGNORED won't be able to pass this event in the queue
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 155/260] MIPS: Quit using undefined behavior of ADDU in 64-bit atomic operations.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (153 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 154/260] inotify: fix inotify oneshot support Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 156/260] MIPS: Set io_map_base for several PCI bridges lacking it Paul Gortmaker
` (106 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, David Daney, Ralf Baechle, Paul Gortmaker
From: David Daney <ddaney@caviumnetworks.com>
commit f2a68272d799bf4092443357142f63b74f7669a1 upstream.
For 64-bit, we must use DADDU and DSUBU.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1483/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/mips/include/asm/atomic.h | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index 519197e..dbbcc73 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -434,7 +434,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
__asm__ __volatile__(
" .set mips3 \n"
"1: lld %0, %1 # atomic64_add \n"
- " addu %0, %2 \n"
+ " daddu %0, %2 \n"
" scd %0, %1 \n"
" beqzl %0, 1b \n"
" .set mips0 \n"
@@ -446,7 +446,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
__asm__ __volatile__(
" .set mips3 \n"
"1: lld %0, %1 # atomic64_add \n"
- " addu %0, %2 \n"
+ " daddu %0, %2 \n"
" scd %0, %1 \n"
" beqz %0, 2f \n"
" .subsection 2 \n"
@@ -479,7 +479,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
__asm__ __volatile__(
" .set mips3 \n"
"1: lld %0, %1 # atomic64_sub \n"
- " subu %0, %2 \n"
+ " dsubu %0, %2 \n"
" scd %0, %1 \n"
" beqzl %0, 1b \n"
" .set mips0 \n"
@@ -491,7 +491,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
__asm__ __volatile__(
" .set mips3 \n"
"1: lld %0, %1 # atomic64_sub \n"
- " subu %0, %2 \n"
+ " dsubu %0, %2 \n"
" scd %0, %1 \n"
" beqz %0, 2f \n"
" .subsection 2 \n"
@@ -524,10 +524,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
__asm__ __volatile__(
" .set mips3 \n"
"1: lld %1, %2 # atomic64_add_return \n"
- " addu %0, %1, %3 \n"
+ " daddu %0, %1, %3 \n"
" scd %0, %2 \n"
" beqzl %0, 1b \n"
- " addu %0, %1, %3 \n"
+ " daddu %0, %1, %3 \n"
" .set mips0 \n"
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter)
@@ -538,10 +538,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
__asm__ __volatile__(
" .set mips3 \n"
"1: lld %1, %2 # atomic64_add_return \n"
- " addu %0, %1, %3 \n"
+ " daddu %0, %1, %3 \n"
" scd %0, %2 \n"
" beqz %0, 2f \n"
- " addu %0, %1, %3 \n"
+ " daddu %0, %1, %3 \n"
" .subsection 2 \n"
"2: b 1b \n"
" .previous \n"
@@ -576,10 +576,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
__asm__ __volatile__(
" .set mips3 \n"
"1: lld %1, %2 # atomic64_sub_return \n"
- " subu %0, %1, %3 \n"
+ " dsubu %0, %1, %3 \n"
" scd %0, %2 \n"
" beqzl %0, 1b \n"
- " subu %0, %1, %3 \n"
+ " dsubu %0, %1, %3 \n"
" .set mips0 \n"
: "=&r" (result), "=&r" (temp), "=m" (v->counter)
: "Ir" (i), "m" (v->counter)
@@ -590,10 +590,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
__asm__ __volatile__(
" .set mips3 \n"
"1: lld %1, %2 # atomic64_sub_return \n"
- " subu %0, %1, %3 \n"
+ " dsubu %0, %1, %3 \n"
" scd %0, %2 \n"
" beqz %0, 2f \n"
- " subu %0, %1, %3 \n"
+ " dsubu %0, %1, %3 \n"
" .subsection 2 \n"
"2: b 1b \n"
" .previous \n"
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 156/260] MIPS: Set io_map_base for several PCI bridges lacking it
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (154 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 155/260] MIPS: Quit using undefined behavior of ADDU in 64-bit atomic operations Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 157/260] sis-agp: Remove SIS 760, handled by amd64-agp Paul Gortmaker
` (105 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ben Hutchings, linux-mips, Martin Michlmayr,
Aurelien Jarno, 584784, Ralf Baechle, Paul Gortmaker
From: Ben Hutchings <ben@decadent.org.uk>
commit 8faf2e6c201d95b780cd3b4674b7a55ede6dcbbb upstream.
Several MIPS platforms don't set pci_controller::io_map_base for their
PCI bridges. This results in a panic in pci_iomap(). (The panic is
conditional on CONFIG_PCI_DOMAINS, but that is now enabled for all PCI
MIPS systems.)
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: linux-mips@linux-mips.org
Cc: Martin Michlmayr <tbm@cyrius.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: 584784@bugs.debian.org
Patchwork: https://patchwork.linux-mips.org/patch/1377/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/mips/mti-malta/malta-pci.c | 2 ++
arch/mips/nxp/pnx8550/common/pci.c | 1 +
arch/mips/nxp/pnx8550/common/setup.c | 2 +-
arch/mips/pci/ops-pmcmsp.c | 1 +
arch/mips/pci/pci-yosemite.c | 1 +
5 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c
index 2fbfa1a..bf80921 100644
--- a/arch/mips/mti-malta/malta-pci.c
+++ b/arch/mips/mti-malta/malta-pci.c
@@ -247,6 +247,8 @@ void __init mips_pcibios_init(void)
iomem_resource.end &= 0xfffffffffULL; /* 64 GB */
ioport_resource.end = controller->io_resource->end;
+ controller->io_map_base = mips_io_port_base;
+
register_pci_controller(controller);
}
diff --git a/arch/mips/nxp/pnx8550/common/pci.c b/arch/mips/nxp/pnx8550/common/pci.c
index eee4f3d..98e86dd 100644
--- a/arch/mips/nxp/pnx8550/common/pci.c
+++ b/arch/mips/nxp/pnx8550/common/pci.c
@@ -44,6 +44,7 @@ extern struct pci_ops pnx8550_pci_ops;
static struct pci_controller pnx8550_controller = {
.pci_ops = &pnx8550_pci_ops,
+ .io_map_base = PNX8550_PORT_BASE,
.io_resource = &pci_io_resource,
.mem_resource = &pci_mem_resource,
};
diff --git a/arch/mips/nxp/pnx8550/common/setup.c b/arch/mips/nxp/pnx8550/common/setup.c
index 2aed50f..64246c9 100644
--- a/arch/mips/nxp/pnx8550/common/setup.c
+++ b/arch/mips/nxp/pnx8550/common/setup.c
@@ -113,7 +113,7 @@ void __init plat_mem_setup(void)
PNX8550_GLB2_ENAB_INTA_O = 0;
/* IO/MEM resources. */
- set_io_port_base(KSEG1);
+ set_io_port_base(PNX8550_PORT_BASE);
ioport_resource.start = 0;
ioport_resource.end = ~0;
iomem_resource.start = 0;
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index 04b3147..b7c03d8 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -944,6 +944,7 @@ static struct pci_controller msp_pci_controller = {
.pci_ops = &msp_pci_ops,
.mem_resource = &pci_mem_resource,
.mem_offset = 0,
+ .io_map_base = MSP_PCI_IOSPACE_BASE,
.io_resource = &pci_io_resource,
.io_offset = 0
};
diff --git a/arch/mips/pci/pci-yosemite.c b/arch/mips/pci/pci-yosemite.c
index 0357946..cf5e1a2 100644
--- a/arch/mips/pci/pci-yosemite.c
+++ b/arch/mips/pci/pci-yosemite.c
@@ -54,6 +54,7 @@ static int __init pmc_yosemite_setup(void)
panic(ioremap_failed);
set_io_port_base(io_v_base);
+ py_controller.io_map_base = io_v_base;
TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1);
ioport_resource.end = TITAN_IO_SIZE - 1;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 157/260] sis-agp: Remove SIS 760, handled by amd64-agp
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (155 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 156/260] MIPS: Set io_map_base for several PCI bridges lacking it Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 158/260] alpha: Fix printk format errors Paul Gortmaker
` (104 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ben Hutchings, Dave Airlie, Paul Gortmaker
From: Ben Hutchings <ben@decadent.org.uk>
commit d831692a1a8e9ceaaa9bb16bb3fc503b7e372558 upstream.
SIS 760 is listed in the device tables for both amd64-agp and sis-agp.
amd64-agp is apparently preferable since it has workarounds for some
BIOS misconfigurations that sis-agp doesn't handle.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/char/agp/sis-agp.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
index 6c3837a..95fdd4d 100644
--- a/drivers/char/agp/sis-agp.c
+++ b/drivers/char/agp/sis-agp.c
@@ -415,14 +415,6 @@ static struct pci_device_id agp_sis_pci_table[] = {
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
},
- {
- .class = (PCI_CLASS_BRIDGE_HOST << 8),
- .class_mask = ~0,
- .vendor = PCI_VENDOR_ID_SI,
- .device = PCI_DEVICE_ID_SI_760,
- .subvendor = PCI_ANY_ID,
- .subdevice = PCI_ANY_ID,
- },
{ }
};
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 158/260] alpha: Fix printk format errors
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (156 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 157/260] sis-agp: Remove SIS 760, handled by amd64-agp Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 159/260] x86, cpu: After uncapping CPUID, re-run CPU feature detection Paul Gortmaker
` (103 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Michael Cree, Matt Turner, Paul Gortmaker
From: Michael Cree <mcree@orcon.net.nz>
commit 3e073367a57d41e506f20aebb98e308387ce3090 upstream.
When compiling alpha generic build get errors such as:
arch/alpha/kernel/err_marvel.c: In function ‘marvel_print_err_cyc’:
arch/alpha/kernel/err_marvel.c:119: error: format ‘%ld’ expects type ‘long int’, but argument 6 has type ‘u64’
Replaced a number of %ld format specifiers with %lld since u64
is unsigned long long.
Signed-off-by: Michael Cree <mcree@orcon.net.nz>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/alpha/kernel/err_marvel.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/alpha/kernel/err_marvel.c b/arch/alpha/kernel/err_marvel.c
index 52a79df..5c905aa 100644
--- a/arch/alpha/kernel/err_marvel.c
+++ b/arch/alpha/kernel/err_marvel.c
@@ -109,7 +109,7 @@ marvel_print_err_cyc(u64 err_cyc)
#define IO7__ERR_CYC__CYCLE__M (0x7)
printk("%s Packet In Error: %s\n"
- "%s Error in %s, cycle %ld%s%s\n",
+ "%s Error in %s, cycle %lld%s%s\n",
err_print_prefix,
packet_desc[EXTRACT(err_cyc, IO7__ERR_CYC__PACKET)],
err_print_prefix,
@@ -313,7 +313,7 @@ marvel_print_po7_ugbge_sym(u64 ugbge_sym)
}
printk("%s Up Hose Garbage Symptom:\n"
- "%s Source Port: %ld - Dest PID: %ld - OpCode: %s\n",
+ "%s Source Port: %lld - Dest PID: %lld - OpCode: %s\n",
err_print_prefix,
err_print_prefix,
EXTRACT(ugbge_sym, IO7__PO7_UGBGE_SYM__UPH_SRC_PORT),
@@ -552,7 +552,7 @@ marvel_print_pox_spl_cmplt(u64 spl_cmplt)
#define IO7__POX_SPLCMPLT__REM_BYTE_COUNT__M (0xfff)
printk("%s Split Completion Error:\n"
- "%s Source (Bus:Dev:Func): %ld:%ld:%ld\n",
+ "%s Source (Bus:Dev:Func): %lld:%lld:%lld\n",
err_print_prefix,
err_print_prefix,
EXTRACT(spl_cmplt, IO7__POX_SPLCMPLT__SOURCE_BUS),
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 159/260] x86, cpu: After uncapping CPUID, re-run CPU feature detection
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (157 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 158/260] alpha: Fix printk format errors Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 160/260] ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory Paul Gortmaker
` (102 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, H. Peter Anvin, Paul Gortmaker
From: H. Peter Anvin <hpa@linux.intel.com>
commit d900329e20f4476db6461752accebcf7935a8055 upstream.
After uncapping the CPUID level, we need to also re-run the CPU
feature detection code.
This resolves kernel bugzilla 16322.
Reported-by: boris64 <bugzilla.kernel.org@boris64.net>
LKML-Reference: <tip-@git.kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/cpu/common.c | 2 +-
arch/x86/kernel/cpu/cpu.h | 1 +
arch/x86/kernel/cpu/intel.c | 1 +
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 4868e4a..c4329af 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -537,7 +537,7 @@ void __cpuinit cpu_detect(struct cpuinfo_x86 *c)
}
}
-static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
+void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
{
u32 tfms, xlvl;
u32 ebx;
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 3624e8a..f668bb1 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -33,5 +33,6 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[],
*const __x86_cpu_dev_end[];
extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
+extern void get_cpu_cap(struct cpuinfo_x86 *c);
#endif
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 1366c7c..e546d54 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -40,6 +40,7 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID;
wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
c->cpuid_level = cpuid_eax(0);
+ get_cpu_cap(c);
}
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 160/260] ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (158 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 159/260] x86, cpu: After uncapping CPUID, re-run CPU feature detection Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 161/260] ALSA: oxygen: fix analog capture on Claro halo cards Paul Gortmaker
` (101 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Dan Rosenberg, Takashi Iwai,
Paul Gortmaker
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit e68d3b316ab7b02a074edc4f770e6a746390cb7d upstream.
The SNDRV_HDSP_IOCTL_GET_CONFIG_INFO and
SNDRV_HDSP_IOCTL_GET_CONFIG_INFO ioctls in hdspm.c and hdsp.c allow
unprivileged users to read uninitialized kernel stack memory, because
several fields of the hdsp{m}_config_info structs declared on the stack
are not altered or zeroed before being copied back to the user. This
patch takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/pci/rme9652/hdsp.c | 1 +
sound/pci/rme9652/hdspm.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index b92adef..d6fa7bf 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -4609,6 +4609,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
if (err < 0)
return err;
+ memset(&info, 0, sizeof(info));
spin_lock_irqsave(&hdsp->lock, flags);
info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp);
info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp);
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 547b713..0c98ef9 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -4127,6 +4127,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO:
+ memset(&info, 0, sizeof(info));
spin_lock_irq(&hdspm->lock);
info.pref_sync_ref = hdspm_pref_sync_ref(hdspm);
info.wordclock_sync_check = hdspm_wc_sync_check(hdspm);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 161/260] ALSA: oxygen: fix analog capture on Claro halo cards
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (159 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 160/260] ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 162/260] ALSA: hda - Add Dell Latitude E6400 model quirk Paul Gortmaker
` (100 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Erik J. Staab, Clemens Ladisch, Takashi Iwai,
Paul Gortmaker
From: Erik J. Staab <ejs@insightbb.com>
commit 0873a5ae747847ee55a63db409dff3476e45bcd9 upstream.
On the HT-Omega Claro halo card, the ADC data must be captured from the
second I2S input. Using the default first input, which isn't connected
to anything, would result in silence.
Signed-off-by: Erik J. Staab <ejs@insightbb.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/pci/oxygen/oxygen.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c
index 289cb4d..6c0a11a 100644
--- a/sound/pci/oxygen/oxygen.c
+++ b/sound/pci/oxygen/oxygen.c
@@ -543,6 +543,10 @@ static int __devinit get_oxygen_model(struct oxygen *chip,
chip->model.suspend = claro_suspend;
chip->model.resume = claro_resume;
chip->model.set_adc_params = set_ak5385_params;
+ chip->model.device_config = PLAYBACK_0_TO_I2S |
+ PLAYBACK_1_TO_SPDIF |
+ CAPTURE_0_FROM_I2S_2 |
+ CAPTURE_1_FROM_SPDIF;
break;
}
if (id->driver_data == MODEL_MERIDIAN ||
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 162/260] ALSA: hda - Add Dell Latitude E6400 model quirk
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (160 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 161/260] ALSA: oxygen: fix analog capture on Claro halo cards Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 163/260] ALSA: prevent heap corruption in snd_ctl_new() Paul Gortmaker
` (99 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Luke Yelavich, Takashi Iwai, Paul Gortmaker
From: Luke Yelavich <luke.yelavich@canonical.com>
commit 0f9f1ee9d1412d45a22bfd69dfd4d4324b506e9e upstream.
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/643891
Set the Dell Latitude E6400 (1028:0233) SSID to use AD1984_DELL_DESKTOP
Signed-off-by: Luke Yelavich <luke.yelavich@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/pci/hda/patch_analog.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index e9fdfc4..ca61b88 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3629,6 +3629,7 @@ static struct snd_pci_quirk ad1984_cfg_tbl[] = {
/* Lenovo Thinkpad T61/X61 */
SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD),
SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP),
+ SND_PCI_QUIRK(0x1028, 0x0233, "Dell Latitude E6400", AD1984_DELL_DESKTOP),
{}
};
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 163/260] ALSA: prevent heap corruption in snd_ctl_new()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (161 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 162/260] ALSA: hda - Add Dell Latitude E6400 model quirk Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 164/260] ALSA: rawmidi: fix oops (use after free) when unloading a driver module Paul Gortmaker
` (98 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Rosenberg, Takashi Iwai, Paul Gortmaker
From: Dan Rosenberg <drosenberg@vsecurity.com>
commit 5591bf07225523600450edd9e6ad258bb877b779 upstream.
The snd_ctl_new() function in sound/core/control.c allocates space for a
snd_kcontrol struct by performing arithmetic operations on a
user-provided size without checking for integer overflow. If a user
provides a large enough size, an overflow will occur, the allocated
chunk will be too small, and a second user-influenced value will be
written repeatedly past the bounds of this chunk. This code is
reachable by unprivileged users who have permission to open
a /dev/snd/controlC* device (on many distros, this is group "audio") via
the SNDRV_CTL_IOCTL_ELEM_ADD and SNDRV_CTL_IOCTL_ELEM_REPLACE ioctls.
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/core/control.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/sound/core/control.c b/sound/core/control.c
index 439ce64..85abc46 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -31,6 +31,7 @@
/* max number of user-defined controls */
#define MAX_USER_CONTROLS 32
+#define MAX_CONTROL_COUNT 1028
struct snd_kctl_ioctl {
struct list_head list; /* list of all ioctls */
@@ -191,6 +192,10 @@ static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control,
if (snd_BUG_ON(!control || !control->count))
return NULL;
+
+ if (control->count > MAX_CONTROL_COUNT)
+ return NULL;
+
kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL);
if (kctl == NULL) {
snd_printk(KERN_ERR "Cannot allocate control instance\n");
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 164/260] ALSA: rawmidi: fix oops (use after free) when unloading a driver module
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (162 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 163/260] ALSA: prevent heap corruption in snd_ctl_new() Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 165/260] USB: fix bug in initialization of interface minor numbers Paul Gortmaker
` (97 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Clemens Ladisch, Takashi Iwai, Paul Gortmaker
From: Clemens Ladisch <clemens@ladisch.de>
commit aa73aec6c385e2c797ac25cc7ccf0318031de7c8 upstream.
When a driver module is unloaded and the last still open file is a raw
MIDI device, the card and its devices will be actually freed in the
snd_card_file_remove() call when that file is closed. Afterwards, rmidi
and rmidi->card point into freed memory, so the module pointer is likely
to be garbage.
(This was introduced by commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a.)
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Reported-by: Krzysztof Foltman <wdev@foltman.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
sound/core/rawmidi.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 0f5a194..5fac1a3 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -531,13 +531,15 @@ static int snd_rawmidi_release(struct inode *inode, struct file *file)
{
struct snd_rawmidi_file *rfile;
struct snd_rawmidi *rmidi;
+ struct module *module;
rfile = file->private_data;
rmidi = rfile->rmidi;
rawmidi_release_priv(rfile);
kfree(rfile);
+ module = rmidi->card->module;
snd_card_file_remove(rmidi->card, file);
- module_put(rmidi->card->module);
+ module_put(module);
return 0;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 165/260] USB: fix bug in initialization of interface minor numbers
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (163 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 164/260] ALSA: rawmidi: fix oops (use after free) when unloading a driver module Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 166/260] usb: musb: gadget: fix kernel panic if using out ep with FIFO_TXRX style Paul Gortmaker
` (96 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Alan Stern, Jiri Kosina, Greg Kroah-Hartman,
Paul Gortmaker
From: Alan Stern <stern@rowland.harvard.edu>
commit 0026e00523a85b90a92a93ddf6660939ecef3e54 upstream.
Recent changes in the usbhid layer exposed a bug in usbcore. If
CONFIG_USB_DYNAMIC_MINORS is enabled then an interface may be assigned
a minor number of 0. However interfaces that aren't registered as USB
class devices also have their minor number set to 0, during
initialization. As a result usb_find_interface() may return the
wrong interface, leading to a crash.
This patch (as1418) fixes the problem by initializing every
interface's minor number to -1. It also cleans up the
usb_register_dev() function, which besides being somewhat awkwardly
written, does not unwind completely on all its error paths.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Philip J. Turmel <philip@turmel.org>
Tested-by: Gabriel Craciunescu <nix.or.die@googlemail.com>
Tested-by: Alex Riesen <raa.lkml@gmail.com>
Tested-by: Matthias Bayer <jackdachef@gmail.com>
CC: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/core/file.c | 35 ++++++++++++++++-------------------
drivers/usb/core/message.c | 1 +
2 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index f06f5db..1e6ccef 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -159,9 +159,9 @@ void usb_major_cleanup(void)
int usb_register_dev(struct usb_interface *intf,
struct usb_class_driver *class_driver)
{
- int retval = -EINVAL;
+ int retval;
int minor_base = class_driver->minor_base;
- int minor = 0;
+ int minor;
char name[20];
char *temp;
@@ -173,12 +173,17 @@ int usb_register_dev(struct usb_interface *intf,
*/
minor_base = 0;
#endif
- intf->minor = -1;
-
- dbg ("looking for a minor, starting at %d", minor_base);
if (class_driver->fops == NULL)
- goto exit;
+ return -EINVAL;
+ if (intf->minor >= 0)
+ return -EADDRINUSE;
+
+ retval = init_usb_class();
+ if (retval)
+ return retval;
+
+ dev_dbg(&intf->dev, "looking for a minor, starting at %d", minor_base);
down_write(&minor_rwsem);
for (minor = minor_base; minor < MAX_USB_MINORS; ++minor) {
@@ -186,20 +191,12 @@ int usb_register_dev(struct usb_interface *intf,
continue;
usb_minors[minor] = class_driver->fops;
-
- retval = 0;
+ intf->minor = minor;
break;
}
up_write(&minor_rwsem);
-
- if (retval)
- goto exit;
-
- retval = init_usb_class();
- if (retval)
- goto exit;
-
- intf->minor = minor;
+ if (intf->minor < 0)
+ return -EXFULL;
/* create a usb class device for this usb interface */
snprintf(name, sizeof(name), class_driver->name, minor - minor_base);
@@ -213,11 +210,11 @@ int usb_register_dev(struct usb_interface *intf,
"%s", temp);
if (IS_ERR(intf->usb_dev)) {
down_write(&minor_rwsem);
- usb_minors[intf->minor] = NULL;
+ usb_minors[minor] = NULL;
+ intf->minor = -1;
up_write(&minor_rwsem);
retval = PTR_ERR(intf->usb_dev);
}
-exit:
return retval;
}
EXPORT_SYMBOL_GPL(usb_register_dev);
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 794dca2..ad1f359 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1817,6 +1817,7 @@ free_interfaces:
intf->dev.groups = usb_interface_groups;
intf->dev.dma_mask = dev->dev.dma_mask;
INIT_WORK(&intf->reset_ws, __usb_queue_reset_device);
+ intf->minor = -1;
device_initialize(&intf->dev);
dev_set_name(&intf->dev, "%d-%s:%d.%d",
dev->bus->busnum, dev->devpath,
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 166/260] usb: musb: gadget: fix kernel panic if using out ep with FIFO_TXRX style
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (164 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 165/260] USB: fix bug in initialization of interface minor numbers Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 167/260] usb: musb: gadget: restart request on clearing endpoint halt Paul Gortmaker
` (95 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ming Lei, David Brownell, Anand Gadiyar,
Mike Frysinger, Sergei Shtylyov, Felipe Balbi, Greg Kroah-Hartman,
Paul Gortmaker
From: Ming Lei <tom.leiming@gmail.com>
commit bd2e74d657fc7d514881cc2117e323790b257914 upstream.
For shared fifo hw endpoint(with FIFO_TXRX style), only ep_in
field of musb_hw_ep is intialized in musb_g_init_endpoints, and
ep_out is not initialized, but musb_g_rx and rxstate may access
ep_out field of musb_hw_ep by the method below:
musb_ep = &musb->endpoints[epnum].ep_out
which can cause the kernel panic[1] below, this patch fixes the issue
by getting 'musb_ep' from '&musb->endpoints[epnum].ep_in' for shared fifo
endpoint.
[1], kernel panic
[root@OMAP3EVM /]# musb_interrupt 1583: ** IRQ peripheral usb0008 tx0000 rx4000
musb_stage0_irq 460: <== Power=f0, DevCtl=99, int_usb=0x8
musb_g_rx 772: <== (null), rxcsr 4007 ffffffe8
musb_g_rx 786: iso overrun on ffffffe8
Unable to handle kernel NULL pointer dereference at virtual address 00000008
pgd = c0004000
[00000008] *pgd=00000000
Internal error: Oops: 17 [#1] PREEMPT
last sysfs file: /sys/devices/platform/musb_hdrc/usb1/usb_device/usbdev1.1/dev
Modules linked in: g_zero
CPU: 0 Tainted: G W (2.6.35-rc6-gkh-wl+ #92)
PC is at musb_g_rx+0xfc/0x2ec
LR is at vprintk+0x3f4/0x458
pc : [<c02c07a4>] lr : [<c006ccb0>] psr: 20000193
sp : c760bd78 ip : c03c9d70 fp : c760bdbc
r10: 00000000 r9 : fa0ab1e0 r8 : 0000000e
r7 : c7e80158 r6 : ffffffe8 r5 : 00000001 r4 : 00004003
r3 : 00010003 r2 : c760bcd8 r1 : c03cd030 r0 : 0000002e
Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 10c5387d Table: 8778c019 DAC: 00000017
Process kmemleak (pid: 421, stack limit = 0xc760a2e8)
Stack: (0xc760bd78 to 0xc760c000)
bd60: ffffffe8 c04b1b58
bd80: ffffffe8 c7c01ac0 00000000 c7e80d24 c0084238 00000001 00000001 c7e80158
bda0: 0000000e 00000008 00000099 000000f0 c760be04 c760bdc0 c02bcd68 c02c06b4
bdc0: 00000099 00000008 00004000 c760bdd8 c03cc4f8 00000000 00000002 c7e80158
bde0: c7d2e300 60000193 c760a000 0000005c 00000000 00000000 c760be24 c760be08
be00: c02bcecc c02bc1ac c7d2e300 c7d2e300 0000005c c760a000 c760be54 c760be28
be20: c00ad698 c02bce6c 00000000 c7d2e300 c067c258 0000005c c067c294 00000001
be40: c760a000 00000000 c760be74 c760be58 c00af984 c00ad5fc 0000005c 00000000
be60: 00000000 00000002 c760be8c c760be78 c0039080 c00af8d0 ffffffff fa200000
be80: c760beec c760be90 c0039b6c c003900c 00000001 00000000 c7d1e240 00000000
bea0: 00000000 c068bae8 00000000 60000013 00000001 00000000 00000000 c760beec
bec0: c0064ecc c760bed8 c00ff7d0 c003a0a8 60000013 ffffffff 00000000 c068bae8
bee0: c760bf24 c760bef0 c00ff7d0 c0064ec4 00000001 00000000 c00ff700 00000000
bf00: c0087f00 00000000 60000013 c0d76a70 c0e23795 00000001 c760bf4c c760bf28
bf20: c00ffdd8 c00ff70c c068bb08 c068bae8 60000013 c0100938 c068bb30 00000000
bf40: c760bf84 c760bf50 c010014c c00ffd84 00000001 00000000 c010000c 00012c00
bf60: c7c33f04 00012c00 c7c33f04 00000000 c0100938 00000000 c760bf9c c760bf88
bf80: c01009a8 c0100018 c760bfa8 c7c33f04 c760bff4 c760bfa0 c0088000 c0100944
bfa0: c760bf98 00000000 00000000 00000001 dead4ead ffffffff ffffffff c08ba2bc
bfc0: 00000000 c049e7fa 00000000 c0087f70 c760bfd0 c760bfd0 c7c33f04 c0087f70
bfe0: c006f5e8 00000013 00000000 c760bff8 c006f5e8 c0087f7c 7f0004ff df2000ff
Backtrace:
[<c02c06a8>] (musb_g_rx+0x0/0x2ec) from [<c02bcd68>] (musb_interrupt+0xbc8/0xcc0)
[<c02bc1a0>] (musb_interrupt+0x0/0xcc0) from [<c02bcecc>] (generic_interrupt+0x6c/0x84)
[<c02bce60>] (generic_interrupt+0x0/0x84) from [<c00ad698>] (handle_IRQ_event+0xa8/0x1ec)
r7:c760a000 r6:0000005c r5:c7d2e300 r4:c7d2e300
[<c00ad5f0>] (handle_IRQ_event+0x0/0x1ec) from [<c00af984>] (handle_level_irq+0xc0/0x13c)
[<c00af8c4>] (handle_level_irq+0x0/0x13c) from [<c0039080>] (asm_do_IRQ+0x80/0xa0)
r7:00000002 r6:00000000 r5:00000000 r4:0000005c
[<c0039000>] (asm_do_IRQ+0x0/0xa0) from [<c0039b6c>] (__irq_svc+0x4c/0xb4)
Exception stack(0xc760be90 to 0xc760bed8)
be80: 00000001 00000000 c7d1e240 00000000
bea0: 00000000 c068bae8 00000000 60000013 00000001 00000000 00000000 c760beec
bec0: c0064ecc c760bed8 c00ff7d0 c003a0a8 60000013 ffffffff
r5:fa200000 r4:ffffffff
[<c0064eb8>] (sub_preempt_count+0x0/0x100) from [<c00ff7d0>] (find_and_get_object+0xd0/0x110)
r5:c068bae8 r4:00000000
[<c00ff700>] (find_and_get_object+0x0/0x110) from [<c00ffdd8>] (scan_block+0x60/0x104)
r8:00000001 r7:c0e23795 r6:c0d76a70 r5:60000013 r4:00000000
[<c00ffd78>] (scan_block+0x0/0x104) from [<c010014c>] (kmemleak_scan+0x140/0x484)
[<c010000c>] (kmemleak_scan+0x0/0x484) from [<c01009a8>] (kmemleak_scan_thread+0x70/0xcc)
r8:00000000 r7:c0100938 r6:00000000 r5:c7c33f04 r4:00012c00
[<c0100938>] (kmemleak_scan_thread+0x0/0xcc) from [<c0088000>] (kthread+0x90/0x98)
r5:c7c33f04 r4:c760bfa8
[<c0087f70>] (kthread+0x0/0x98) from [<c006f5e8>] (do_exit+0x0/0x684)
r7:00000013 r6:c006f5e8 r5:c0087f70 r4:c7c33f04
Code: e3002312 e58d6000 e2833e16 eb0422d5 (e5963020)
---[ end trace f3d5e96f75c297b7 ]---
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Reviewed-by: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Anand Gadiyar <gadiyar@ti.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/musb/musb_gadget.c | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 6fca870..de0ca90 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -568,11 +568,19 @@ static void rxstate(struct musb *musb, struct musb_request *req)
{
const u8 epnum = req->epnum;
struct usb_request *request = &req->request;
- struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
+ struct musb_ep *musb_ep;
void __iomem *epio = musb->endpoints[epnum].regs;
unsigned fifo_count = 0;
- u16 len = musb_ep->packet_sz;
+ u16 len;
u16 csr = musb_readw(epio, MUSB_RXCSR);
+ struct musb_hw_ep *hw_ep = &musb->endpoints[epnum];
+
+ if (hw_ep->is_shared_fifo)
+ musb_ep = &hw_ep->ep_in;
+ else
+ musb_ep = &hw_ep->ep_out;
+
+ len = musb_ep->packet_sz;
/* We shouldn't get here while DMA is active, but we do... */
if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) {
@@ -740,9 +748,15 @@ void musb_g_rx(struct musb *musb, u8 epnum)
u16 csr;
struct usb_request *request;
void __iomem *mbase = musb->mregs;
- struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
+ struct musb_ep *musb_ep;
void __iomem *epio = musb->endpoints[epnum].regs;
struct dma_channel *dma;
+ struct musb_hw_ep *hw_ep = &musb->endpoints[epnum];
+
+ if (hw_ep->is_shared_fifo)
+ musb_ep = &hw_ep->ep_in;
+ else
+ musb_ep = &hw_ep->ep_out;
musb_ep_select(mbase, epnum);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 167/260] usb: musb: gadget: restart request on clearing endpoint halt
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (165 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 166/260] usb: musb: gadget: fix kernel panic if using out ep with FIFO_TXRX style Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 168/260] oprofile: Add Support for Intel CPU Family 6 / Model 29 Paul Gortmaker
` (94 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Sergei Shtylyov, Felipe Balbi, Greg Kroah-Hartman,
Paul Gortmaker
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
commit a666e3e6098a9f56310e4ec2705f1dad124a34b5 upstream.
Commit 46034dca515bc4ddca0399ae58106d1f5f0d809f (USB: musb_gadget_ep0: stop
abusing musb_gadget_set_halt()) forgot to restart a queued request after
clearing the endpoint halt feature. This results in a couple of USB resets
while enumerating the file-backed storage gadget due to CSW packet not being
sent for the MODE SENSE(10) command.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/musb/musb_gadget.c | 2 +-
drivers/usb/musb/musb_gadget.h | 2 ++
drivers/usb/musb/musb_gadget_ep0.c | 9 +++++++++
3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index de0ca90..180da4e 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1095,7 +1095,7 @@ struct free_record {
/*
* Context: controller locked, IRQs blocked.
*/
-static void musb_ep_restart(struct musb *musb, struct musb_request *req)
+void musb_ep_restart(struct musb *musb, struct musb_request *req)
{
DBG(3, "<== %s request %p len %u on hw_ep%d\n",
req->tx ? "TX/IN" : "RX/OUT",
diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h
index c8b1403..572b1da 100644
--- a/drivers/usb/musb/musb_gadget.h
+++ b/drivers/usb/musb/musb_gadget.h
@@ -105,4 +105,6 @@ extern void musb_gadget_cleanup(struct musb *);
extern void musb_g_giveback(struct musb_ep *, struct usb_request *, int);
+extern void musb_ep_restart(struct musb *, struct musb_request *);
+
#endif /* __MUSB_GADGET_H */
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index 53d0645..2eb90b3 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -261,6 +261,7 @@ __acquires(musb->lock)
ctrlrequest->wIndex & 0x0f;
struct musb_ep *musb_ep;
struct musb_hw_ep *ep;
+ struct musb_request *request;
void __iomem *regs;
int is_in;
u16 csr;
@@ -302,6 +303,14 @@ __acquires(musb->lock)
musb_writew(regs, MUSB_RXCSR, csr);
}
+ /* Maybe start the first request in the queue */
+ request = to_musb_request(
+ next_request(musb_ep));
+ if (!musb_ep->busy && request) {
+ DBG(3, "restarting the request\n");
+ musb_ep_restart(musb, request);
+ }
+
/* select ep0 again */
musb_ep_select(mbase, 0);
} break;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 168/260] oprofile: Add Support for Intel CPU Family 6 / Model 29
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (166 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 167/260] usb: musb: gadget: restart request on clearing endpoint halt Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 169/260] RDMA/cxgb3: Turn off RX coalescing for iWARP connections Paul Gortmaker
` (93 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jiri Olsa, Robert Richter, Paul Gortmaker
From: Jiri Olsa <jolsa@redhat.com>
commit bb7ab785ad05a97a2c9ffb3a06547ed39f3133e8 upstream.
This patch adds CPU type detection for dunnington processor (Family 6
/ Model 29) to be identified as core 2 family cpu type (wikipedia
source).
I tested oprofile on Intel(R) Xeon(R) CPU E7440 reporting itself as
model 29, and it runs without an issue.
Spec:
http://www.intel.com/Assets/en_US/PDF/specupdate/320336.pdf
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/oprofile/nmi_int.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 238526b..ca6b336 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -624,6 +624,7 @@ static int __init ppro_init(char **cpu_type)
case 0x0f:
case 0x16:
case 0x17:
+ case 0x1d:
*cpu_type = "i386/core_2";
break;
case 0x1a:
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 169/260] RDMA/cxgb3: Turn off RX coalescing for iWARP connections
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (167 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 168/260] oprofile: Add Support for Intel CPU Family 6 / Model 29 Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 170/260] mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove Paul Gortmaker
` (92 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Steve Wise, Roland Dreier, Paul Gortmaker
From: Steve Wise <swise@opengridcomputing.com>
commit bec658ff31453a5726b1c188674d587a5d40c482 upstream.
The HW by default has RX coalescing on. For iWARP connections, this
causes a 100ms delay in connection establishement due to the ingress
MPA Start message being stalled in HW. So explicitly turn RX
coalescing off when setting up iWARP connections.
This was causing very bad performance for NP64 gather operations using
Open MPI, due to the way it sets up connections on larger jobs.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/infiniband/hw/cxgb3/iwch_cm.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index 4fef032..025c3f8 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -487,7 +487,8 @@ static int send_connect(struct iwch_ep *ep)
V_MSS_IDX(mtu_idx) |
V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx);
opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10);
- opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor);
+ opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) |
+ V_CONG_CONTROL_FLAVOR(cong_flavor);
skb->priority = CPL_PRIORITY_SETUP;
set_arp_failure_handler(skb, act_open_req_arp_failure);
@@ -1304,7 +1305,8 @@ static void accept_cr(struct iwch_ep *ep, __be32 peer_ip, struct sk_buff *skb)
V_MSS_IDX(mtu_idx) |
V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx);
opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10);
- opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor);
+ opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) |
+ V_CONG_CONTROL_FLAVOR(cong_flavor);
rpl = cplhdr(skb);
rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 170/260] mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (168 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 169/260] RDMA/cxgb3: Turn off RX coalescing for iWARP connections Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 171/260] x86/amd-iommu: Set iommu configuration flags in enable-loop Paul Gortmaker
` (91 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Marek Szyprowski, Kyungmin Park, Andrew Morton,
Chris Ball, Paul Gortmaker
From: Marek Szyprowski <m.szyprowski@samsung.com>
commit 9320f7cbbdd5febf013b0e91db29189724057738 upstream.
If not all clocks have been defined in platform data, the driver will
cause a null pointer dereference when it is removed. This patch fixes
this issue.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/mmc/host/sdhci-s3c.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 9bf1ddf..4dbcf01 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -380,8 +380,10 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
sdhci_remove_host(host, 1);
for (ptr = 0; ptr < 3; ptr++) {
- clk_disable(sc->clk_bus[ptr]);
- clk_put(sc->clk_bus[ptr]);
+ if (sc->clk_bus[ptr]) {
+ clk_disable(sc->clk_bus[ptr]);
+ clk_put(sc->clk_bus[ptr]);
+ }
}
clk_disable(sc->clk_io);
clk_put(sc->clk_io);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 171/260] x86/amd-iommu: Set iommu configuration flags in enable-loop
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (169 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 170/260] mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 172/260] x86/amd-iommu: Fix rounding-bug in __unmap_single Paul Gortmaker
` (90 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Joerg Roedel, Paul Gortmaker
From: Joerg Roedel <joerg.roedel@amd.com>
commit e9bf51971157e367aabfc111a8219db010f69cd4 upstream.
This patch moves the setting of the configuration and
feature flags out out the acpi table parsing path and moves
it into the iommu-enable path. This is needed to reliably
fix resume-from-s3.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/include/asm/amd_iommu_types.h | 3 ++
arch/x86/kernel/amd_iommu_init.c | 49 +++++++++++++++++--------------
2 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index 86a0ff0..a325556 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -334,6 +334,9 @@ struct amd_iommu {
/* capabilities of that IOMMU read from ACPI */
u32 cap;
+ /* flags read from acpi table */
+ u8 acpi_flags;
+
/*
* Capability pointer. There could be more than one IOMMU per PCI
* device function if there are more than one AMD IOMMU capability
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 6f8ce75..b53f5c2 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -648,29 +648,9 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
struct ivhd_entry *e;
/*
- * First set the recommended feature enable bits from ACPI
- * into the IOMMU control registers
+ * First save the recommended feature enable bits from ACPI
*/
- h->flags & IVHD_FLAG_HT_TUN_EN_MASK ?
- iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) :
- iommu_feature_disable(iommu, CONTROL_HT_TUN_EN);
-
- h->flags & IVHD_FLAG_PASSPW_EN_MASK ?
- iommu_feature_enable(iommu, CONTROL_PASSPW_EN) :
- iommu_feature_disable(iommu, CONTROL_PASSPW_EN);
-
- h->flags & IVHD_FLAG_RESPASSPW_EN_MASK ?
- iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) :
- iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN);
-
- h->flags & IVHD_FLAG_ISOC_EN_MASK ?
- iommu_feature_enable(iommu, CONTROL_ISOC_EN) :
- iommu_feature_disable(iommu, CONTROL_ISOC_EN);
-
- /*
- * make IOMMU memory accesses cache coherent
- */
- iommu_feature_enable(iommu, CONTROL_COHERENT_EN);
+ iommu->acpi_flags = h->flags;
/*
* Done. Now parse the device entries
@@ -1115,6 +1095,30 @@ static void init_device_table(void)
}
}
+static void iommu_init_flags(struct amd_iommu *iommu)
+{
+ iommu->acpi_flags & IVHD_FLAG_HT_TUN_EN_MASK ?
+ iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) :
+ iommu_feature_disable(iommu, CONTROL_HT_TUN_EN);
+
+ iommu->acpi_flags & IVHD_FLAG_PASSPW_EN_MASK ?
+ iommu_feature_enable(iommu, CONTROL_PASSPW_EN) :
+ iommu_feature_disable(iommu, CONTROL_PASSPW_EN);
+
+ iommu->acpi_flags & IVHD_FLAG_RESPASSPW_EN_MASK ?
+ iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) :
+ iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN);
+
+ iommu->acpi_flags & IVHD_FLAG_ISOC_EN_MASK ?
+ iommu_feature_enable(iommu, CONTROL_ISOC_EN) :
+ iommu_feature_disable(iommu, CONTROL_ISOC_EN);
+
+ /*
+ * make IOMMU memory accesses cache coherent
+ */
+ iommu_feature_enable(iommu, CONTROL_COHERENT_EN);
+}
+
/*
* This function finally enables all IOMMUs found in the system after
* they have been initialized
@@ -1125,6 +1129,7 @@ static void enable_iommus(void)
for_each_iommu(iommu) {
iommu_disable(iommu);
+ iommu_init_flags(iommu);
iommu_set_device_table(iommu);
iommu_enable_command_buffer(iommu);
iommu_enable_event_buffer(iommu);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 172/260] x86/amd-iommu: Fix rounding-bug in __unmap_single
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (170 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 171/260] x86/amd-iommu: Set iommu configuration flags in enable-loop Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 173/260] x86/amd-iommu: Work around S3 BIOS bug Paul Gortmaker
` (89 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Joerg Roedel, Paul Gortmaker
From: Joerg Roedel <joerg.roedel@amd.com>
commit 04e0463e088b41060c08c255eb0d3278a504f094 upstream.
In the __unmap_single function the dma_addr is rounded down
to a page boundary before the dma pages are unmapped. The
address is later also used to flush the TLB entries for that
mapping. But without the offset into the dma page the amount
of pages to flush might be miscalculated in the TLB flushing
path. This patch fixes this bug by using the original
address to flush the TLB.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/amd_iommu.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 29e5e6e..1aae617 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1886,6 +1886,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom,
size_t size,
int dir)
{
+ dma_addr_t flush_addr;
dma_addr_t i, start;
unsigned int pages;
@@ -1893,6 +1894,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom,
(dma_addr + size > dma_dom->aperture_size))
return;
+ flush_addr = dma_addr;
pages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
dma_addr &= PAGE_MASK;
start = dma_addr;
@@ -1907,7 +1909,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom,
dma_ops_free_addresses(dma_dom, dma_addr, pages);
if (amd_iommu_unmap_flush || dma_dom->need_flush) {
- iommu_flush_pages(&dma_dom->domain, dma_addr, size);
+ iommu_flush_pages(&dma_dom->domain, flush_addr, size);
dma_dom->need_flush = false;
}
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 173/260] x86/amd-iommu: Work around S3 BIOS bug
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (171 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 172/260] x86/amd-iommu: Fix rounding-bug in __unmap_single Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 174/260] tracing/x86: Don't use mcount in pvclock.c Paul Gortmaker
` (88 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Joerg Roedel, Paul Gortmaker
From: Joerg Roedel <joerg.roedel@amd.com>
commit 4c894f47bb49284008073d351c0ddaac8860864e upstream.
This patch adds a workaround for an IOMMU BIOS problem to
the AMD IOMMU driver. The result of the bug is that the
IOMMU does not execute commands anymore when the system
comes out of the S3 state resulting in system failure. The
bug in the BIOS is that is does not restore certain hardware
specific registers correctly. This workaround reads out the
contents of these registers at boot time and restores them
on resume from S3. The workaround is limited to the specific
IOMMU chipset where this problem occurs.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/include/asm/amd_iommu_proto.h | 6 ++++++
arch/x86/include/asm/amd_iommu_types.h | 9 +++++++++
arch/x86/kernel/amd_iommu_init.c | 18 ++++++++++++++++++
include/linux/pci_ids.h | 3 +++
4 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h
index d2544f1..cb03037 100644
--- a/arch/x86/include/asm/amd_iommu_proto.h
+++ b/arch/x86/include/asm/amd_iommu_proto.h
@@ -38,4 +38,10 @@ static inline void amd_iommu_stats_init(void) { }
#endif /* !CONFIG_AMD_IOMMU_STATS */
+static inline bool is_rd890_iommu(struct pci_dev *pdev)
+{
+ return (pdev->vendor == PCI_VENDOR_ID_ATI) &&
+ (pdev->device == PCI_DEVICE_ID_RD890_IOMMU);
+}
+
#endif /* _ASM_X86_AMD_IOMMU_PROTO_H */
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index a325556..942f595 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -380,6 +380,15 @@ struct amd_iommu {
/* default dma_ops domain for that IOMMU */
struct dma_ops_domain *default_dom;
+
+ /*
+ * This array is required to work around a potential BIOS bug.
+ * The BIOS may miss to restore parts of the PCI configuration
+ * space when the system resumes from S3. The result is that the
+ * IOMMU does not execute commands anymore which leads to system
+ * failure.
+ */
+ u32 cache_cfg[4];
};
/*
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index b53f5c2..fa749f7 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -631,6 +631,13 @@ static void __init init_iommu_from_pci(struct amd_iommu *iommu)
iommu->last_device = calc_devid(MMIO_GET_BUS(range),
MMIO_GET_LD(range));
iommu->evt_msi_num = MMIO_MSI_NUM(misc);
+
+ if (is_rd890_iommu(iommu->dev)) {
+ pci_read_config_dword(iommu->dev, 0xf0, &iommu->cache_cfg[0]);
+ pci_read_config_dword(iommu->dev, 0xf4, &iommu->cache_cfg[1]);
+ pci_read_config_dword(iommu->dev, 0xf8, &iommu->cache_cfg[2]);
+ pci_read_config_dword(iommu->dev, 0xfc, &iommu->cache_cfg[3]);
+ }
}
/*
@@ -1119,6 +1126,16 @@ static void iommu_init_flags(struct amd_iommu *iommu)
iommu_feature_enable(iommu, CONTROL_COHERENT_EN);
}
+static void iommu_apply_quirks(struct amd_iommu *iommu)
+{
+ if (is_rd890_iommu(iommu->dev)) {
+ pci_write_config_dword(iommu->dev, 0xf0, iommu->cache_cfg[0]);
+ pci_write_config_dword(iommu->dev, 0xf4, iommu->cache_cfg[1]);
+ pci_write_config_dword(iommu->dev, 0xf8, iommu->cache_cfg[2]);
+ pci_write_config_dword(iommu->dev, 0xfc, iommu->cache_cfg[3]);
+ }
+}
+
/*
* This function finally enables all IOMMUs found in the system after
* they have been initialized
@@ -1129,6 +1146,7 @@ static void enable_iommus(void)
for_each_iommu(iommu) {
iommu_disable(iommu);
+ iommu_apply_quirks(iommu);
iommu_init_flags(iommu);
iommu_set_device_table(iommu);
iommu_enable_command_buffer(iommu);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 42b28cb..829ac3f 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -393,6 +393,9 @@
#define PCI_DEVICE_ID_VLSI_82C147 0x0105
#define PCI_DEVICE_ID_VLSI_VAS96011 0x0702
+/* AMD RD890 Chipset */
+#define PCI_DEVICE_ID_RD890_IOMMU 0x5a23
+
#define PCI_VENDOR_ID_ADL 0x1005
#define PCI_DEVICE_ID_ADL_2301 0x2301
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 174/260] tracing/x86: Don't use mcount in pvclock.c
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (172 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 173/260] x86/amd-iommu: Work around S3 BIOS bug Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 175/260] tracing/x86: Don't use mcount in kvmclock.c Paul Gortmaker
` (87 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jeremy Fitzhardinge, Jeremy Fitzhardinge,
Steven Rostedt, Paul Gortmaker
From: Jeremy Fitzhardinge <jeremy@goop.org>
commit 9ecd4e1689208afe9b059a5ce1333acb2f42c4d2 upstream.
When using a paravirt clock, pvclock.c can be used by sched_clock(),
which in turn is used by the tracing mechanism for timestamps,
which leads to infinite recursion.
Disable mcount/tracing for pvclock.o.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
LKML-Reference: <4C9A9A3F.4040201@goop.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/Makefile | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 4c58352..ea3f79b 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -11,6 +11,7 @@ ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_tsc.o = -pg
CFLAGS_REMOVE_rtc.o = -pg
CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
+CFLAGS_REMOVE_pvclock.o = -pg
CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_early_printk.o = -pg
endif
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 175/260] tracing/x86: Don't use mcount in kvmclock.c
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (173 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 174/260] tracing/x86: Don't use mcount in pvclock.c Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 176/260] v4l1: fix 32-bit compat microcode loading translation Paul Gortmaker
` (86 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Steven Rostedt, Jeremy Fitzhardinge, Avi Kivity,
Steven Rostedt, Paul Gortmaker
From: Steven Rostedt <srostedt@redhat.com>
commit 258af47479980d8238a04568b94a4e55aa1cb537 upstream.
The guest can use the paravirt clock in kvmclock.c which is used
by sched_clock(), which in turn is used by the tracing mechanism
for timestamps, which leads to infinite recursion.
Disable mcount/tracing for kvmclock.o.
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/Makefile | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index ea3f79b..fbe45d0 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -12,6 +12,7 @@ CFLAGS_REMOVE_tsc.o = -pg
CFLAGS_REMOVE_rtc.o = -pg
CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
CFLAGS_REMOVE_pvclock.o = -pg
+CFLAGS_REMOVE_kvmclock.o = -pg
CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_early_printk.o = -pg
endif
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 176/260] v4l1: fix 32-bit compat microcode loading translation
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (174 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 175/260] tracing/x86: Don't use mcount in kvmclock.c Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 177/260] V4L/DVB: cx231xx: Avoid an OOPS when card is unknown (card=0) Paul Gortmaker
` (85 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Linus Torvalds, Mauro Carvalho Chehab,
Paul Gortmaker
From: Linus Torvalds <torvalds@linux-foundation.org>
commit 3e645d6b485446c54c6745c5e2cf5c528fe4deec upstream.
The compat code for the VIDIOCSMICROCODE ioctl is totally buggered.
It's only used by the VIDEO_STRADIS driver, and that one is scheduled to
staging and eventually removed unless somebody steps up to maintain it
(at which point it should use request_firmware() rather than some magic
ioctl). So we'll get rid of it eventually.
But in the meantime, the compatibility ioctl code is broken, and this
tries to get it to at least limp along (even if Mauro suggested just
deleting it entirely, which may be the right thing to do - I don't think
the compatibility translation code has ever worked unless you were very
lucky).
Reported-by: Kees Cook <kees.cook@canonical.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/media/video/v4l2-compat-ioctl32.c | 32 +++++++++++++++++++----------
1 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c
index f77f84b..e6a5d55 100644
--- a/drivers/media/video/v4l2-compat-ioctl32.c
+++ b/drivers/media/video/v4l2-compat-ioctl32.c
@@ -193,17 +193,24 @@ static int put_video_window32(struct video_window *kp, struct video_window32 __u
struct video_code32 {
char loadwhat[16]; /* name or tag of file being passed */
compat_int_t datasize;
- unsigned char *data;
+ compat_uptr_t data;
};
-static int get_microcode32(struct video_code *kp, struct video_code32 __user *up)
+static struct video_code __user *get_microcode32(struct video_code32 *kp)
{
- if (!access_ok(VERIFY_READ, up, sizeof(struct video_code32)) ||
- copy_from_user(kp->loadwhat, up->loadwhat, sizeof(up->loadwhat)) ||
- get_user(kp->datasize, &up->datasize) ||
- copy_from_user(kp->data, up->data, up->datasize))
- return -EFAULT;
- return 0;
+ struct video_code __user *up;
+
+ up = compat_alloc_user_space(sizeof(*up));
+
+ /*
+ * NOTE! We don't actually care if these fail. If the
+ * user address is invalid, the native ioctl will do
+ * the error handling for us
+ */
+ (void) copy_to_user(up->loadwhat, kp->loadwhat, sizeof(up->loadwhat));
+ (void) put_user(kp->datasize, &up->datasize);
+ (void) put_user(compat_ptr(kp->data), &up->data);
+ return up;
}
#define VIDIOCGTUNER32 _IOWR('v', 4, struct video_tuner32)
@@ -744,7 +751,7 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
struct video_tuner vt;
struct video_buffer vb;
struct video_window vw;
- struct video_code vc;
+ struct video_code32 vc;
struct video_audio va;
#endif
struct v4l2_format v2f;
@@ -823,8 +830,11 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
break;
case VIDIOCSMICROCODE:
- err = get_microcode32(&karg.vc, up);
- compatible_arg = 0;
+ /* Copy the 32-bit "video_code32" to kernel space */
+ if (copy_from_user(&karg.vc, up, sizeof(karg.vc)))
+ return -EFAULT;
+ /* Convert the 32-bit version to a 64-bit version in user space */
+ up = get_microcode32(&karg.vc);
break;
case VIDIOCSFREQ:
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 177/260] V4L/DVB: cx231xx: Avoid an OOPS when card is unknown (card=0)
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (175 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 176/260] v4l1: fix 32-bit compat microcode loading translation Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 178/260] Input: joydev - fix JSIOCSAXMAP ioctl Paul Gortmaker
` (84 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Mauro Carvalho Chehab, Paul Gortmaker
From: Mauro Carvalho Chehab <mchehab@redhat.com>
commit c10469c637602c2385e2993d8c730cc44fd47d23 upstream.
As reported by: Carlos Americo Domiciano <c_domiciano@yahoo.com.br>:
[ 220.033500] cx231xx v4l2 driver loaded.
[ 220.033571] cx231xx #0: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 6 interfaces
[ 220.033577] cx231xx #0: registering interface 0
[ 220.033591] cx231xx #0: registering interface 1
[ 220.033654] cx231xx #0: registering interface 6
[ 220.033910] cx231xx #0: Identified as Unknown CX231xx video grabber (card=0)
[ 220.033946] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 220.033955] IP: [<ffffffffa0d3c8bd>] cx231xx_pre_card_setup+0x5d/0xb0 [cx231xx]
Thanks-to: Carlos Americo Domiciano <c_domiciano@yahoo.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/media/video/cx231xx/cx231xx-cards.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 6bdc0ef..f78c07c 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -226,14 +226,16 @@ void cx231xx_pre_card_setup(struct cx231xx *dev)
dev->board.name, dev->model);
/* set the direction for GPIO pins */
- cx231xx_set_gpio_direction(dev, dev->board.tuner_gpio->bit, 1);
- cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 1);
- cx231xx_set_gpio_direction(dev, dev->board.tuner_sif_gpio, 1);
+ if (dev->board.tuner_gpio) {
+ cx231xx_set_gpio_direction(dev, dev->board.tuner_gpio->bit, 1);
+ cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 1);
+ cx231xx_set_gpio_direction(dev, dev->board.tuner_sif_gpio, 1);
- /* request some modules if any required */
+ /* request some modules if any required */
- /* reset the Tuner */
- cx231xx_gpio_set(dev, dev->board.tuner_gpio);
+ /* reset the Tuner */
+ cx231xx_gpio_set(dev, dev->board.tuner_gpio);
+ }
/* set the mode to Analog mode initially */
cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 178/260] Input: joydev - fix JSIOCSAXMAP ioctl
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (176 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 177/260] V4L/DVB: cx231xx: Avoid an OOPS when card is unknown (card=0) Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 179/260] x86, hpet: Fix bogus error check in hpet_assign_irq() Paul Gortmaker
` (83 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Kenneth Waters, Dmitry Torokhov, Paul Gortmaker
From: Kenneth Waters <kwwaters@gmail.com>
commit d2520a426dc3033c00077e923a553fc6c98c7564 upstream.
Fixed JSIOCSAXMAP ioctl to update absmap, the map from hardware axis to
event axis in addition to abspam. This fixes a regression introduced
by 999b874f.
Signed-off-by: Kenneth Waters <kwwaters@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/input/joydev.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 423e0e6..0325480 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -483,6 +483,9 @@ static int joydev_handle_JSIOCSAXMAP(struct joydev *joydev,
memcpy(joydev->abspam, abspam, len);
+ for (i = 0; i < joydev->nabs; i++)
+ joydev->absmap[joydev->abspam[i]] = i;
+
out:
kfree(abspam);
return retval;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 179/260] x86, hpet: Fix bogus error check in hpet_assign_irq()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (177 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 178/260] Input: joydev - fix JSIOCSAXMAP ioctl Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 180/260] x86, irq: Plug memory leak in sparse irq Paul Gortmaker
` (82 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Thomas Gleixner, Venkatesh Pallipadi,
H. Peter Anvin, Paul Gortmaker
From: Thomas Gleixner <tglx@linutronix.de>
commit 021989622810b02aab4b24f91e1f5ada2b654579 upstream.
create_irq() returns -1 if the interrupt allocation failed, but the
code checks for irq == 0.
Use create_irq_nr() instead.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Venkatesh Pallipadi <venki@google.com>
LKML-Reference: <alpine.LFD.2.00.1009282310360.2416@localhost6.localdomain6>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/hpet.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 5294b58..c5f8121 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -499,7 +499,7 @@ static int hpet_assign_irq(struct hpet_dev *dev)
{
unsigned int irq;
- irq = create_irq();
+ irq = create_irq_nr(0, -1);
if (!irq)
return -EINVAL;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 180/260] x86, irq: Plug memory leak in sparse irq
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (178 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 179/260] x86, hpet: Fix bogus error check in hpet_assign_irq() Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 181/260] ubd: fix incorrect sector handling during request restart Paul Gortmaker
` (81 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Thomas Gleixner, Yinghai Lu, H. Peter Anvin,
Paul Gortmaker
From: Thomas Gleixner <tglx@linutronix.de>
commit 1cf180c94e9166cda083ff65333883ab3648e852 upstream.
free_irq_cfg() is not freeing the cpumask_vars in irq_cfg. Fixing this
triggers a use after free caused by the fact that copying struct
irq_cfg is done with memcpy, which copies the pointer not the cpumask.
Fix both places.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
LKML-Reference: <alpine.LFD.2.00.1009282052570.2416@localhost6.localdomain6>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/apic/io_apic.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index abb136a..469d45a 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -303,14 +303,19 @@ void arch_init_copy_chip_data(struct irq_desc *old_desc,
old_cfg = old_desc->chip_data;
- memcpy(cfg, old_cfg, sizeof(struct irq_cfg));
+ cfg->vector = old_cfg->vector;
+ cfg->move_in_progress = old_cfg->move_in_progress;
+ cpumask_copy(cfg->domain, old_cfg->domain);
+ cpumask_copy(cfg->old_domain, old_cfg->old_domain);
init_copy_irq_2_pin(old_cfg, cfg, node);
}
-static void free_irq_cfg(struct irq_cfg *old_cfg)
+static void free_irq_cfg(struct irq_cfg *cfg)
{
- kfree(old_cfg);
+ free_cpumask_var(cfg->domain);
+ free_cpumask_var(cfg->old_domain);
+ kfree(cfg);
}
void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 181/260] ubd: fix incorrect sector handling during request restart
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (179 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 180/260] x86, irq: Plug memory leak in sparse irq Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 182/260] ring-buffer: Fix typo of time extends per page Paul Gortmaker
` (80 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Tejun Heo, Jens Axboe, Paul Gortmaker
From: Tejun Heo <tj@kernel.org>
commit 47526903feb52f4c26a6350370bdf74e337fcdb1 upstream.
Commit f81f2f7c (ubd: drop unnecessary rq->sector manipulation)
dropped request->sector manipulation in preparation for global request
handling cleanup; unfortunately, it incorrectly assumed that the
updated sector wasn't being used.
ubd tries to issue as many requests as possible to io_thread. When
issuing fails due to memory pressure or other reasons, the device is
put on the restart list and issuing stops. On IO completion, devices
on the restart list are scanned and IO issuing is restarted.
ubd issues IOs sg-by-sg and issuing can be stopped in the middle of a
request, so each device on the restart queue needs to remember where
to restart in its current request. ubd needs to keep track of the
issue position itself because,
* blk_rq_pos(req) is now updated by the block layer to keep track of
_completion_ position.
* Multiple io_req's for the current request may be in flight, so it's
difficult to tell where blk_rq_pos(req) currently is.
Add ubd->rq_pos to keep track of the issue position and use it to
correctly restart io_req issue.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Richard Weinberger <richard@nod.at>
Tested-by: Richard Weinberger <richard@nod.at>
Tested-by: Chris Frey <cdfrey@foursquare.net>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/um/drivers/ubd_kern.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index da992a3..3d63b83 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -162,6 +162,7 @@ struct ubd {
struct scatterlist sg[MAX_SG];
struct request *request;
int start_sg, end_sg;
+ sector_t rq_pos;
};
#define DEFAULT_COW { \
@@ -186,6 +187,7 @@ struct ubd {
.request = NULL, \
.start_sg = 0, \
.end_sg = 0, \
+ .rq_pos = 0, \
}
/* Protected by ubd_lock */
@@ -1223,7 +1225,6 @@ static void do_ubd_request(struct request_queue *q)
{
struct io_thread_req *io_req;
struct request *req;
- sector_t sector;
int n;
while(1){
@@ -1234,12 +1235,12 @@ static void do_ubd_request(struct request_queue *q)
return;
dev->request = req;
+ dev->rq_pos = blk_rq_pos(req);
dev->start_sg = 0;
dev->end_sg = blk_rq_map_sg(q, req, dev->sg);
}
req = dev->request;
- sector = blk_rq_pos(req);
while(dev->start_sg < dev->end_sg){
struct scatterlist *sg = &dev->sg[dev->start_sg];
@@ -1251,10 +1252,9 @@ static void do_ubd_request(struct request_queue *q)
return;
}
prepare_request(req, io_req,
- (unsigned long long)sector << 9,
+ (unsigned long long)dev->rq_pos << 9,
sg->offset, sg->length, sg_page(sg));
- sector += sg->length >> 9;
n = os_write_file(thread_fd, &io_req,
sizeof(struct io_thread_req *));
if(n != sizeof(struct io_thread_req *)){
@@ -1267,6 +1267,7 @@ static void do_ubd_request(struct request_queue *q)
return;
}
+ dev->rq_pos += sg->length >> 9;
dev->start_sg++;
}
dev->end_sg = 0;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 182/260] ring-buffer: Fix typo of time extends per page
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (180 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 181/260] ubd: fix incorrect sector handling during request restart Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 183/260] dmaengine: fix interrupt clearing for mv_xor Paul Gortmaker
` (79 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Steven Rostedt, Thomas Gleixner, Steven Rostedt,
Paul Gortmaker
From: Steven Rostedt <srostedt@redhat.com>
commit d01343244abdedd18303d0323b518ed9cdcb1988 upstream.
Time stamps for the ring buffer are created by the difference between
two events. Each page of the ring buffer holds a full 64 bit timestamp.
Each event has a 27 bit delta stamp from the last event. The unit of time
is nanoseconds, so 27 bits can hold ~134 milliseconds. If two events
happen more than 134 milliseconds apart, a time extend is inserted
to add more bits for the delta. The time extend has 59 bits, which
is good for ~18 years.
Currently the time extend is committed separately from the event.
If an event is discarded before it is committed, due to filtering,
the time extend still exists. If all events are being filtered, then
after ~134 milliseconds a new time extend will be added to the buffer.
This can only happen till the end of the page. Since each page holds
a full timestamp, there is no reason to add a time extend to the
beginning of a page. Time extends can only fill a page that has actual
data at the beginning, so there is no fear that time extends will fill
more than a page without any data.
When reading an event, a loop is made to skip over time extends
since they are only used to maintain the time stamp and are never
given to the caller. As a paranoid check to prevent the loop running
forever, with the knowledge that time extends may only fill a page,
a check is made that tests the iteration of the loop, and if the
iteration is more than the number of time extends that can fit in a page
a warning is printed and the ring buffer is disabled (all of ftrace
is also disabled with it).
There is another event type that is called a TIMESTAMP which can
hold 64 bits of data in the theoretical case that two events happen
18 years apart. This code has not been implemented, but the name
of this event exists, as well as the structure for it. The
size of a TIMESTAMP is 16 bytes, where as a time extend is only
8 bytes. The macro used to calculate how many time extends can fit on
a page used the TIMESTAMP size instead of the time extend size
cutting the amount in half.
The following test case can easily trigger the warning since we only
need to have half the page filled with time extends to trigger the
warning:
# cd /sys/kernel/debug/tracing/
# echo function > current_tracer
# echo 'common_pid < 0' > events/ftrace/function/filter
# echo > trace
# echo 1 > trace_marker
# sleep 120
# cat trace
Enabling the function tracer and then setting the filter to only trace
functions where the process id is negative (no events), then clearing
the trace buffer to ensure that we have nothing in the buffer,
then write to trace_marker to add an event to the beginning of a page,
sleep for 2 minutes (only 35 seconds is probably needed, but this
guarantees the bug), and then finally reading the trace which will
trigger the bug.
This patch fixes the typo and prevents the false positive of that warning.
Reported-by: Hans J. Koch <hjk@linutronix.de>
Tested-by: Hans J. Koch <hjk@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/trace/ring_buffer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 1b6197a..f25b8af 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -399,7 +399,7 @@ static inline int test_time_stamp(u64 delta)
#define BUF_MAX_DATA_SIZE (BUF_PAGE_SIZE - (sizeof(u32) * 2))
/* Max number of timestamps that can fit on a page */
-#define RB_TIMESTAMPS_PER_PAGE (BUF_PAGE_SIZE / RB_LEN_TIME_STAMP)
+#define RB_TIMESTAMPS_PER_PAGE (BUF_PAGE_SIZE / RB_LEN_TIME_EXTEND)
int ring_buffer_print_page_header(struct trace_seq *s)
{
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 183/260] dmaengine: fix interrupt clearing for mv_xor
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (181 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 182/260] ring-buffer: Fix typo of time extends per page Paul Gortmaker
@ 2011-01-02 7:17 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 184/260] hrtimer: Preserve timer state in remove_hrtimer() Paul Gortmaker
` (78 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:17 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Simon Guinot, Dan Williams, Paul Gortmaker
From: Simon Guinot <sguinot@lacie.com>
commit cc60f8878eab892c03d06b10f389232b9b66bd83 upstream.
When using simultaneously the two DMA channels on a same engine, some
transfers are never completed. For example, an endless lock can occur
while writing heavily on a RAID5 array (with async-tx offload support
enabled).
Note that this issue can also be reproduced by using the DMA test
client.
On a same engine, the interrupt cause register is shared between two
DMA channels. This patch make sure that the cause bit is only cleared
for the requested channel.
Signed-off-by: Simon Guinot <sguinot@lacie.com>
Tested-by: Luc Saillard <luc@saillard.org>
Acked-by: saeed bishara <saeed.bishara@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/dma/mv_xor.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index e2fd34d..ba28b29 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -162,7 +162,7 @@ static int mv_is_err_intr(u32 intr_cause)
static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan)
{
- u32 val = (1 << (1 + (chan->idx * 16)));
+ u32 val = ~(1 << (chan->idx * 16));
dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val);
__raw_writel(val, XOR_INTR_CAUSE(chan));
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 184/260] hrtimer: Preserve timer state in remove_hrtimer()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (182 preceding siblings ...)
2011-01-02 7:17 ` [34-longterm 183/260] dmaengine: fix interrupt clearing for mv_xor Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 185/260] i2c-pca: Fix waitforcompletion() return value Paul Gortmaker
` (77 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Salman Qazi, akpm, Peter Zijlstra, Thomas Gleixner,
Paul Gortmaker
From: Salman Qazi <sqazi@google.com>
commit f13d4f979c518119bba5439dd2364d76d31dcd3f upstream.
The race is described as follows:
CPU X CPU Y
remove_hrtimer
// state & QUEUED == 0
timer->state = CALLBACK
unlock timer base
timer->f(n) //very long
hrtimer_start
lock timer base
remove_hrtimer // no effect
hrtimer_enqueue
timer->state = CALLBACK |
QUEUED
unlock timer base
hrtimer_start
lock timer base
remove_hrtimer
mode = INACTIVE
// CALLBACK bit lost!
switch_hrtimer_base
CALLBACK bit not set:
timer->base
changes to a
different CPU.
lock this CPU's timer base
The bug was introduced with commit ca109491f (hrtimer: removing all ur
callback modes) in 2.6.29
[ tglx: Feed new state via local variable and add a comment. ]
Signed-off-by: Salman Qazi <sqazi@google.com>
Cc: akpm@linux-foundation.org
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20101012142351.8485.21823.stgit@dungbeetle.mtv.corp.google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/hrtimer.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 0086628..3c727aa 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -936,6 +936,7 @@ static inline int
remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base)
{
if (hrtimer_is_queued(timer)) {
+ unsigned long state;
int reprogram;
/*
@@ -949,8 +950,13 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base)
debug_deactivate(timer);
timer_stats_hrtimer_clear_start_info(timer);
reprogram = base->cpu_base == &__get_cpu_var(hrtimer_bases);
- __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE,
- reprogram);
+ /*
+ * We must preserve the CALLBACK state flag here,
+ * otherwise we could move the timer base in
+ * switch_hrtimer_base.
+ */
+ state = timer->state & HRTIMER_STATE_CALLBACK;
+ __remove_hrtimer(timer, base, state, reprogram);
return 1;
}
return 0;
@@ -1237,6 +1243,9 @@ static void __run_hrtimer(struct hrtimer *timer, ktime_t *now)
BUG_ON(timer->state != HRTIMER_STATE_CALLBACK);
enqueue_hrtimer(timer, base);
}
+
+ WARN_ON_ONCE(!(timer->state & HRTIMER_STATE_CALLBACK));
+
timer->state &= ~HRTIMER_STATE_CALLBACK;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 185/260] i2c-pca: Fix waitforcompletion() return value
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (183 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 184/260] hrtimer: Preserve timer state in remove_hrtimer() Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 186/260] ocfs2: Don't walk off the end of fast symlinks Paul Gortmaker
` (76 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Yegor Yefremov, Yegor Yefremov, Jean Delvare,
Paul Gortmaker
From: Yegor Yefremov <yegor_sub1@visionsystems.de>
commit 6abb930af064fb1cf4177d32e2c7bfb89eee0fe5 upstream.
ret is still -1, if during the polling read_byte() returns at once
with I2C_PCA_CON_SI set. So ret > 0 would lead *_waitforcompletion()
to return 0, in spite of the proper behavior.
The routine was rewritten, so that ret has always a proper value,
before returning.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/i2c/busses/i2c-pca-isa.c | 12 ++++++++----
drivers/i2c/busses/i2c-pca-platform.c | 11 +++++++----
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c
index f7346a9..62a5ce5 100644
--- a/drivers/i2c/busses/i2c-pca-isa.c
+++ b/drivers/i2c/busses/i2c-pca-isa.c
@@ -71,8 +71,8 @@ static int pca_isa_readbyte(void *pd, int reg)
static int pca_isa_waitforcompletion(void *pd)
{
- long ret = ~0;
unsigned long timeout;
+ long ret;
if (irq > -1) {
ret = wait_event_timeout(pca_wait,
@@ -81,11 +81,15 @@ static int pca_isa_waitforcompletion(void *pd)
} else {
/* Do polling */
timeout = jiffies + pca_isa_ops.timeout;
- while (((pca_isa_readbyte(pd, I2C_PCA_CON)
- & I2C_PCA_CON_SI) == 0)
- && (ret = time_before(jiffies, timeout)))
+ do {
+ ret = time_before(jiffies, timeout);
+ if (pca_isa_readbyte(pd, I2C_PCA_CON)
+ & I2C_PCA_CON_SI)
+ break;
udelay(100);
+ } while (ret);
}
+
return ret > 0;
}
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c
index 5b2213d..1d8c208 100644
--- a/drivers/i2c/busses/i2c-pca-platform.c
+++ b/drivers/i2c/busses/i2c-pca-platform.c
@@ -80,8 +80,8 @@ static void i2c_pca_pf_writebyte32(void *pd, int reg, int val)
static int i2c_pca_pf_waitforcompletion(void *pd)
{
struct i2c_pca_pf_data *i2c = pd;
- long ret = ~0;
unsigned long timeout;
+ long ret;
if (i2c->irq) {
ret = wait_event_timeout(i2c->wait,
@@ -90,10 +90,13 @@ static int i2c_pca_pf_waitforcompletion(void *pd)
} else {
/* Do polling */
timeout = jiffies + i2c->adap.timeout;
- while (((i2c->algo_data.read_byte(i2c, I2C_PCA_CON)
- & I2C_PCA_CON_SI) == 0)
- && (ret = time_before(jiffies, timeout)))
+ do {
+ ret = time_before(jiffies, timeout);
+ if (i2c->algo_data.read_byte(i2c, I2C_PCA_CON)
+ & I2C_PCA_CON_SI)
+ break;
udelay(100);
+ } while (ret);
}
return ret > 0;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 186/260] ocfs2: Don't walk off the end of fast symlinks.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (184 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 185/260] i2c-pca: Fix waitforcompletion() return value Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 187/260] wext: fix potential private ioctl memory content leak Paul Gortmaker
` (75 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Joel Becker, Paul Gortmaker
From: Joel Becker <joel.becker@oracle.com>
commit 1fc8a117865b54590acd773a55fbac9221b018f0 upstream.
ocfs2 fast symlinks are NUL terminated strings stored inline in the
inode data area. However, disk corruption or a local attacker could, in
theory, remove that NUL. Because we're using strlen() (my fault,
introduced in a731d1 when removing vfs_follow_link()), we could walk off
the end of that string.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/ocfs2/symlink.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index 32499d21..9975457 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -128,7 +128,7 @@ static void *ocfs2_fast_follow_link(struct dentry *dentry,
}
/* Fast symlinks can't be large */
- len = strlen(target);
+ len = strnlen(target, ocfs2_fast_symlink_chars(inode->i_sb));
link = kzalloc(len + 1, GFP_NOFS);
if (!link) {
status = -ENOMEM;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 187/260] wext: fix potential private ioctl memory content leak
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (185 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 186/260] ocfs2: Don't walk off the end of fast symlinks Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 188/260] atl1: fix resume Paul Gortmaker
` (74 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Johannes Berg, John W. Linville, Paul Gortmaker
From: Johannes Berg <johannes.berg@intel.com>
commit df6d02300f7c2fbd0fbe626d819c8e5237d72c62 upstream.
When a driver doesn't fill the entire buffer, old
heap contents may remain, and if it also doesn't
update the length properly, this old heap content
will be copied back to userspace.
It is very unlikely that this happens in any of
the drivers using private ioctls since it would
show up as junk being reported by iwpriv, but it
seems better to be safe here, so use kzalloc.
Reported-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/wireless/wext-priv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/wireless/wext-priv.c b/net/wireless/wext-priv.c
index 3feb28e..674d426 100644
--- a/net/wireless/wext-priv.c
+++ b/net/wireless/wext-priv.c
@@ -152,7 +152,7 @@ static int ioctl_private_iw_point(struct iw_point *iwp, unsigned int cmd,
} else if (!iwp->pointer)
return -EFAULT;
- extra = kmalloc(extra_size, GFP_KERNEL);
+ extra = kzalloc(extra_size, GFP_KERNEL);
if (!extra)
return -ENOMEM;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 188/260] atl1: fix resume
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (186 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 187/260] wext: fix potential private ioctl memory content leak Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 189/260] x86, AMD, MCE thresholding: Fix the MCi_MISCj iteration order Paul Gortmaker
` (73 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Luca Tettamanti, David S. Miller, Paul Gortmaker
From: Luca Tettamanti <kronos.it@gmail.com>
commit ec5a32f67c603b11d68eb283d94eb89a4f6cfce1 upstream.
adapter->cmb.cmb is initialized when the device is opened and freed when
it's closed. Accessing it unconditionally during resume results either
in a crash (NULL pointer dereference, when the interface has not been
opened yet) or data corruption (when the interface has been used and
brought down adapter->cmb.cmb points to a deallocated memory area).
Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
Acked-by: Chris Snook <chris.snook@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/atlx/atl1.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 0ebd820..9d9ba41 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2849,10 +2849,11 @@ static int atl1_resume(struct pci_dev *pdev)
pci_enable_wake(pdev, PCI_D3cold, 0);
atl1_reset_hw(&adapter->hw);
- adapter->cmb.cmb->int_stats = 0;
- if (netif_running(netdev))
+ if (netif_running(netdev)) {
+ adapter->cmb.cmb->int_stats = 0;
atl1_up(adapter);
+ }
netif_device_attach(netdev);
return 0;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 189/260] x86, AMD, MCE thresholding: Fix the MCi_MISCj iteration order
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (187 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 188/260] atl1: fix resume Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 190/260] De-pessimize rds_page_copy_user Paul Gortmaker
` (72 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Borislav Petkov, Ingo Molnar, Paul Gortmaker
From: Borislav Petkov <borislav.petkov@amd.com>
commit 6dcbfe4f0b4e17e289d56fa534b7ce5a6b7f63a3 upstream.
This fixes possible cases of not collecting valid error info in
the MCE error thresholding groups on F10h hardware.
The current code contains a subtle problem of checking only the
Valid bit of MSR0000_0413 (which is MC4_MISC0 - DRAM
thresholding group) in its first iteration and breaking out if
the bit is cleared.
But (!), this MSR contains an offset value, BlkPtr[31:24], which
points to the remaining MSRs in this thresholding group which
might contain valid information too. But if we bail out only
after we checked the valid bit in the first MSR and not the
block pointer too, we miss that other information.
The thing is, MC4_MISC0[BlkPtr] is not predicated on
MCi_STATUS[MiscV] or MC4_MISC0[Valid] and should be checked
prior to iterating over the MCI_MISCj thresholding group,
irrespective of the MC4_MISC0[Valid] setting.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/cpu/mcheck/mce_amd.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 224392d..f80ff85 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -141,6 +141,7 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
address = (low & MASK_BLKPTR_LO) >> 21;
if (!address)
break;
+
address += MCG_XBLK_ADDR;
} else
++address;
@@ -148,12 +149,8 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
if (rdmsr_safe(address, &low, &high))
break;
- if (!(high & MASK_VALID_HI)) {
- if (block)
- continue;
- else
- break;
- }
+ if (!(high & MASK_VALID_HI))
+ continue;
if (!(high & MASK_CNTP_HI) ||
(high & MASK_LOCKED_HI))
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 190/260] De-pessimize rds_page_copy_user
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (188 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 189/260] x86, AMD, MCE thresholding: Fix the MCi_MISCj iteration order Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 191/260] drm/radeon: fix PCI ID 5657 to be an RV410 Paul Gortmaker
` (71 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Linus Torvalds, Paul Gortmaker
From: Linus Torvalds <torvalds@linux-foundation.org>
commit 799c10559d60f159ab2232203f222f18fa3c4a5f upstream.
Don't try to "optimize" rds_page_copy_user() by using kmap_atomic() and
the unsafe atomic user mode accessor functions. It's actually slower
than the straightforward code on any reasonable modern CPU.
Back when the code was written (although probably not by the time it was
actually merged, though), 32-bit x86 may have been the dominant
architecture. And there kmap_atomic() can be a lot faster than kmap()
(unless you have very good locality, in which case the virtual address
caching by kmap() can overcome all the downsides).
But these days, x86-64 may not be more populous, but it's getting there
(and if you care about performance, it's definitely already there -
you'd have upgraded your CPU's already in the last few years). And on
x86-64, the non-kmap_atomic() version is faster, simply because the code
is simpler and doesn't have the "re-try page fault" case.
People with old hardware are not likely to care about RDS anyway, and
the optimization for the 32-bit case is simply buggy, since it doesn't
verify the user addresses properly.
Reported-by: Dan Rosenberg <drosenberg@vsecurity.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/rds/page.c | 27 +++++++--------------------
1 files changed, 7 insertions(+), 20 deletions(-)
diff --git a/net/rds/page.c b/net/rds/page.c
index 595a952..1dfbfea 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -57,30 +57,17 @@ int rds_page_copy_user(struct page *page, unsigned long offset,
unsigned long ret;
void *addr;
- if (to_user)
+ addr = kmap(page);
+ if (to_user) {
rds_stats_add(s_copy_to_user, bytes);
- else
+ ret = copy_to_user(ptr, addr + offset, bytes);
+ } else {
rds_stats_add(s_copy_from_user, bytes);
-
- addr = kmap_atomic(page, KM_USER0);
- if (to_user)
- ret = __copy_to_user_inatomic(ptr, addr + offset, bytes);
- else
- ret = __copy_from_user_inatomic(addr + offset, ptr, bytes);
- kunmap_atomic(addr, KM_USER0);
-
- if (ret) {
- addr = kmap(page);
- if (to_user)
- ret = copy_to_user(ptr, addr + offset, bytes);
- else
- ret = copy_from_user(addr + offset, ptr, bytes);
- kunmap(page);
- if (ret)
- return -EFAULT;
+ ret = copy_from_user(addr + offset, ptr, bytes);
}
+ kunmap(page);
- return 0;
+ return ret ? -EFAULT : 0;
}
EXPORT_SYMBOL_GPL(rds_page_copy_user);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 191/260] drm/radeon: fix PCI ID 5657 to be an RV410
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (189 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 190/260] De-pessimize rds_page_copy_user Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 192/260] xfrm4: strip ECN bits from tos field Paul Gortmaker
` (70 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Dave Airlie, Paul Gortmaker
From: Dave Airlie <airlied@redhat.com>
commit f459ffbdfd04edb4a8ce6eea33170eb057a5e695 upstream.
fixes https://bugzilla.kernel.org/show_bug.cgi?id=19012
cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/drm/drm_pciids.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 3a9940e..883c1d4 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -85,7 +85,6 @@
{0x1002, 0x5460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
{0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
{0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
- {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
{0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
{0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
{0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
@@ -103,6 +102,7 @@
{0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
{0x1002, 0x5652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
{0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+ {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
{0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \
{0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \
{0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 192/260] xfrm4: strip ECN bits from tos field
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (190 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 191/260] drm/radeon: fix PCI ID 5657 to be an RV410 Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 193/260] tcp: Fix >4GB writes on 64-bit Paul Gortmaker
` (69 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Ulrich Weber, David S. Miller, Paul Gortmaker
From: Ulrich Weber <uweber@astaro.com>
commit 94e2238969e89f5112297ad2a00103089dde7e8f upstream.
otherwise ECT(1) bit will get interpreted as RTO_ONLINK
and routing will fail with XfrmOutBundleGenError.
Signed-off-by: Ulrich Weber <uweber@astaro.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/ipv4/xfrm4_policy.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index e4a1483..0670587 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -82,7 +82,7 @@ __xfrm4_find_bundle(struct flowi *fl, struct xfrm_policy *policy)
static int xfrm4_get_tos(struct flowi *fl)
{
- return fl->fl4_tos;
+ return IPTOS_RT_MASK & fl->fl4_tos; /* Strip ECN bits */
}
static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst,
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 193/260] tcp: Fix >4GB writes on 64-bit.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (191 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 192/260] xfrm4: strip ECN bits from tos field Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 194/260] net: Fix the condition passed to sk_wait_event() Paul Gortmaker
` (68 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, David S. Miller, Paul Gortmaker
From: David S. Miller <davem@davemloft.net>
commit 01db403cf99f739f86903314a489fb420e0e254f upstream.
Fixes kernel bugzilla #16603
tcp_sendmsg() truncates iov_len to an 'int' which a 4GB write to write
zero bytes, for example.
There is also the problem higher up of how verify_iovec() works. It
wants to prevent the total length from looking like an error return
value.
However it does this using 'int', but syscalls return 'long' (and
thus signed 64-bit on 64-bit machines). So it could trigger
false-positives on 64-bit as written. So fix it to use 'long'.
Reported-by: Olaf Bonorden <bono@onlinehome.de>
Reported-by: Daniel Büse <dbuese@gmx.de>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/socket.h | 2 +-
net/core/iovec.c | 5 +++--
net/ipv4/tcp.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 354cc56..1b5034a 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -314,7 +314,7 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
int offset,
unsigned int len, __wsum *csump);
-extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);
+extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);
extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
int offset, int len);
diff --git a/net/core/iovec.c b/net/core/iovec.c
index 1e7f4e9..b5b28f0 100644
--- a/net/core/iovec.c
+++ b/net/core/iovec.c
@@ -35,9 +35,10 @@
* in any case.
*/
-int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)
+long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)
{
- int size, err, ct;
+ int size, ct;
+ long err;
if (m->msg_namelen) {
if (mode == VERIFY_READ) {
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4a638f0..1b40924 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -938,7 +938,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
sg = sk->sk_route_caps & NETIF_F_SG;
while (--iovlen >= 0) {
- int seglen = iov->iov_len;
+ size_t seglen = iov->iov_len;
unsigned char __user *from = iov->iov_base;
iov++;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 194/260] net: Fix the condition passed to sk_wait_event()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (192 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 193/260] tcp: Fix >4GB writes on 64-bit Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 195/260] Phonet: Correct header retrieval after pskb_may_pull Paul Gortmaker
` (67 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Nagendra Tomar, David S. Miller, Paul Gortmaker
From: Nagendra Tomar <tomer_iisc@yahoo.com>
commit 482964e56e1320cb7952faa1932d8ecf59c4bf75 upstream.
This patch fixes the condition (3rd arg) passed to sk_wait_event() in
sk_stream_wait_memory(). The incorrect check in sk_stream_wait_memory()
causes the following soft lockup in tcp_sendmsg() when the global tcp
memory pool has exhausted.
>>> snip <<<
localhost kernel: BUG: soft lockup - CPU#3 stuck for 11s! [sshd:6429]
localhost kernel: CPU 3:
localhost kernel: RIP: 0010:[sk_stream_wait_memory+0xcd/0x200] [sk_stream_wait_memory+0xcd/0x200] sk_stream_wait_memory+0xcd/0x200
localhost kernel:
localhost kernel: Call Trace:
localhost kernel: [sk_stream_wait_memory+0x1b1/0x200] sk_stream_wait_memory+0x1b1/0x200
localhost kernel: [<ffffffff802557c0>] autoremove_wake_function+0x0/0x40
localhost kernel: [ipv6:tcp_sendmsg+0x6e6/0xe90] tcp_sendmsg+0x6e6/0xce0
localhost kernel: [sock_aio_write+0x126/0x140] sock_aio_write+0x126/0x140
localhost kernel: [xfs:do_sync_write+0xf1/0x130] do_sync_write+0xf1/0x130
localhost kernel: [<ffffffff802557c0>] autoremove_wake_function+0x0/0x40
localhost kernel: [hrtimer_start+0xe3/0x170] hrtimer_start+0xe3/0x170
localhost kernel: [vfs_write+0x185/0x190] vfs_write+0x185/0x190
localhost kernel: [sys_write+0x50/0x90] sys_write+0x50/0x90
localhost kernel: [system_call+0x7e/0x83] system_call+0x7e/0x83
>>> snip <<<
What is happening is, that the sk_wait_event() condition passed from
sk_stream_wait_memory() evaluates to true for the case of tcp global memory
exhaustion. This is because both sk_stream_memory_free() and vm_wait are true
which causes sk_wait_event() to *not* call schedule_timeout().
Hence sk_stream_wait_memory() returns immediately to the caller w/o sleeping.
This causes the caller to again try allocation, which again fails and again
calls sk_stream_wait_memory(), and so on.
[ Bug introduced by commit c1cbe4b7ad0bc4b1d98ea708a3fecb7362aa4088
("[NET]: Avoid atomic xchg() for non-error case") -DaveM ]
Signed-off-by: Nagendra Singh Tomar <tomer_iisc@yahoo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/core/stream.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/stream.c b/net/core/stream.c
index a37debf..e48c85f 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -140,10 +140,10 @@ int sk_stream_wait_memory(struct sock *sk, long *timeo_p)
set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
sk->sk_write_pending++;
- sk_wait_event(sk, ¤t_timeo, !sk->sk_err &&
- !(sk->sk_shutdown & SEND_SHUTDOWN) &&
- sk_stream_memory_free(sk) &&
- vm_wait);
+ sk_wait_event(sk, ¤t_timeo, sk->sk_err ||
+ (sk->sk_shutdown & SEND_SHUTDOWN) ||
+ (sk_stream_memory_free(sk) &&
+ !vm_wait));
sk->sk_write_pending--;
if (vm_wait) {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 195/260] Phonet: Correct header retrieval after pskb_may_pull
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (193 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 194/260] net: Fix the condition passed to sk_wait_event() Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 196/260] net: Fix IPv6 PMTU disc. w/ asymmetric routes Paul Gortmaker
` (66 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Kumar Sanghvi, David S. Miller, Paul Gortmaker
From: Kumar Sanghvi <kumar.sanghvi@stericsson.com>
commit a91e7d471e2e384035b9746ea707ccdcd353f5dd upstream.
Retrieve the header after doing pskb_may_pull since, pskb_may_pull
could change the buffer structure.
This is based on the comment given by Eric Dumazet on Phonet
Pipe controller patch for a similar problem.
Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/phonet/pep.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index e2a9576..dc1e8ae 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -225,12 +225,13 @@ static void pipe_grant_credits(struct sock *sk)
static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb)
{
struct pep_sock *pn = pep_sk(sk);
- struct pnpipehdr *hdr = pnp_hdr(skb);
+ struct pnpipehdr *hdr;
int wake = 0;
if (!pskb_may_pull(skb, sizeof(*hdr) + 4))
return -EINVAL;
+ hdr = pnp_hdr(skb);
if (hdr->data[0] != PN_PEP_TYPE_COMMON) {
LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n",
(unsigned)hdr->data[0]);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 196/260] net: Fix IPv6 PMTU disc. w/ asymmetric routes
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (194 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 195/260] Phonet: Correct header retrieval after pskb_may_pull Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 197/260] ip: fix truesize mismatch in ip fragmentation Paul Gortmaker
` (65 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Maciej Żenczykowski, David S. Miller,
Paul Gortmaker
From: Maciej Żenczykowski <maze@google.com>
commit ae878ae280bea286ff2b1e1cb6e609dd8cb4501d upstream.
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/ipv6/route.c | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 40f6f13..4f4b21d 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1561,14 +1561,13 @@ out:
* i.e. Path MTU discovery
*/
-void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
- struct net_device *dev, u32 pmtu)
+static void rt6_do_pmtu_disc(struct in6_addr *daddr, struct in6_addr *saddr,
+ struct net *net, u32 pmtu, int ifindex)
{
struct rt6_info *rt, *nrt;
- struct net *net = dev_net(dev);
int allfrag = 0;
- rt = rt6_lookup(net, daddr, saddr, dev->ifindex, 0);
+ rt = rt6_lookup(net, daddr, saddr, ifindex, 0);
if (rt == NULL)
return;
@@ -1636,6 +1635,27 @@ out:
dst_release(&rt->u.dst);
}
+void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
+ struct net_device *dev, u32 pmtu)
+{
+ struct net *net = dev_net(dev);
+
+ /*
+ * RFC 1981 states that a node "MUST reduce the size of the packets it
+ * is sending along the path" that caused the Packet Too Big message.
+ * Since it's not possible in the general case to determine which
+ * interface was used to send the original packet, we update the MTU
+ * on the interface that will be used to send future packets. We also
+ * update the MTU on the interface that received the Packet Too Big in
+ * case the original packet was forced out that interface with
+ * SO_BINDTODEVICE or similar. This is the next best thing to the
+ * correct behaviour, which would be to update the MTU on all
+ * interfaces.
+ */
+ rt6_do_pmtu_disc(daddr, saddr, net, pmtu, 0);
+ rt6_do_pmtu_disc(daddr, saddr, net, pmtu, dev->ifindex);
+}
+
/*
* Misc support functions
*/
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 197/260] ip: fix truesize mismatch in ip fragmentation
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (195 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 196/260] net: Fix IPv6 PMTU disc. w/ asymmetric routes Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 198/260] net: clear heap allocations for privileged ethtool actions Paul Gortmaker
` (64 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Dumazet, Jarek Poplawski, Patrick McHardy,
David S. Miller, Paul Gortmaker
From: Eric Dumazet <eric.dumazet@gmail.com>
commit 3d13008e7345fa7a79d8f6438150dc15d6ba6e9d upstream.
Special care should be taken when slow path is hit in ip_fragment() :
When walking through frags, we transfert truesize ownership from skb to
frags. Then if we hit a slow_path condition, we must undo this or risk
uncharging frags->truesize twice, and in the end, having negative socket
sk_wmem_alloc counter, or even freeing socket sooner than expected.
Many thanks to Nick Bowler, who provided a very clean bug report and
test program.
Thanks to Jarek for reviewing my first patch and providing a V2
While Nick bisection pointed to commit 2b85a34e911 (net: No more
expensive sock_hold()/sock_put() on each tx), underlying bug is older
(2.6.12-rc5)
A side effect is to extend work done in commit b2722b1c3a893e
(ip_fragment: also adjust skb->truesize for packets not owned by a
socket) to ipv6 as well.
Reported-and-bisected-by: Nick Bowler <nbowler@elliptictech.com>
Tested-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jarek Poplawski <jarkao2@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/ipv4/ip_output.c | 19 +++++++++++++------
net/ipv6/ip6_output.c | 18 +++++++++++++-----
2 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index d1bcc9f..e8a6860 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -479,9 +479,8 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
* we can switch to copy when see the first bad fragment.
*/
if (skb_has_frags(skb)) {
- struct sk_buff *frag;
+ struct sk_buff *frag, *frag2;
int first_len = skb_pagelen(skb);
- int truesizes = 0;
if (first_len - hlen > mtu ||
((first_len - hlen) & 7) ||
@@ -494,18 +493,18 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
if (frag->len > mtu ||
((frag->len & 7) && frag->next) ||
skb_headroom(frag) < hlen)
- goto slow_path;
+ goto slow_path_clean;
/* Partially cloned skb? */
if (skb_shared(frag))
- goto slow_path;
+ goto slow_path_clean;
BUG_ON(frag->sk);
if (skb->sk) {
frag->sk = skb->sk;
frag->destructor = sock_wfree;
}
- truesizes += frag->truesize;
+ skb->truesize -= frag->truesize;
}
/* Everything is OK. Generate! */
@@ -515,7 +514,6 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
frag = skb_shinfo(skb)->frag_list;
skb_frag_list_init(skb);
skb->data_len = first_len - skb_headlen(skb);
- skb->truesize -= truesizes;
skb->len = first_len;
iph->tot_len = htons(first_len);
iph->frag_off = htons(IP_MF);
@@ -567,6 +565,15 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
}
IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
return err;
+
+slow_path_clean:
+ skb_walk_frags(skb, frag2) {
+ if (frag2 == frag)
+ break;
+ frag2->sk = NULL;
+ frag2->destructor = NULL;
+ skb->truesize += frag2->truesize;
+ }
}
slow_path:
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 75d5ef8..60daecc 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -646,7 +646,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
if (skb_has_frags(skb)) {
int first_len = skb_pagelen(skb);
- int truesizes = 0;
+ struct sk_buff *frag2;
if (first_len - hlen > mtu ||
((first_len - hlen) & 7) ||
@@ -658,18 +658,18 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
if (frag->len > mtu ||
((frag->len & 7) && frag->next) ||
skb_headroom(frag) < hlen)
- goto slow_path;
+ goto slow_path_clean;
/* Partially cloned skb? */
if (skb_shared(frag))
- goto slow_path;
+ goto slow_path_clean;
BUG_ON(frag->sk);
if (skb->sk) {
frag->sk = skb->sk;
frag->destructor = sock_wfree;
- truesizes += frag->truesize;
}
+ skb->truesize -= frag->truesize;
}
err = 0;
@@ -700,7 +700,6 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
first_len = skb_pagelen(skb);
skb->data_len = first_len - skb_headlen(skb);
- skb->truesize -= truesizes;
skb->len = first_len;
ipv6_hdr(skb)->payload_len = htons(first_len -
sizeof(struct ipv6hdr));
@@ -763,6 +762,15 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
IPSTATS_MIB_FRAGFAILS);
dst_release(&rt->u.dst);
return err;
+
+slow_path_clean:
+ skb_walk_frags(skb, frag2) {
+ if (frag2 == frag)
+ break;
+ frag2->sk = NULL;
+ frag2->destructor = NULL;
+ skb->truesize += frag2->truesize;
+ }
}
slow_path:
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 198/260] net: clear heap allocations for privileged ethtool actions
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (196 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 197/260] ip: fix truesize mismatch in ip fragmentation Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 199/260] tcp: Fix race in tcp_poll Paul Gortmaker
` (63 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Kees Cook, David S. Miller, Paul Gortmaker
From: Kees Cook <kees.cook@canonical.com>
commit b00916b189d13a615ff05c9242201135992fcda3 upstream.
Several other ethtool functions leave heap uncleared (potentially) by
drivers. Some interfaces appear safe (eeprom, etc), in that the sizes
are well controlled. In some situations (e.g. unchecked error conditions),
the heap will remain unchanged in areas before copying back to userspace.
Note that these are less of an issue since these all require CAP_NET_ADMIN.
[PG: 34 doesn't have ethtool_get_rxnfc(), drop that chunk]
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/core/ethtool.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index f4d6a12..5328c62 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -464,7 +464,7 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr)
gstrings.len = ret;
- data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);
+ data = kzalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);
if (!data)
return -ENOMEM;
@@ -701,7 +701,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
if (regs.len > reglen)
regs.len = reglen;
- regbuf = kmalloc(reglen, GFP_USER);
+ regbuf = kzalloc(reglen, GFP_USER);
if (!regbuf)
return -ENOMEM;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 199/260] tcp: Fix race in tcp_poll
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (197 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 198/260] net: clear heap allocations for privileged ethtool actions Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 200/260] netxen: dont set skb->truesize Paul Gortmaker
` (62 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Tom Marshall, Eric Dumazet, David S. Miller,
Paul Gortmaker
From: Tom Marshall <tdm.code@gmail.com>
commit a4d258036ed9b2a1811c3670c6099203a0f284a0 upstream.
If a RST comes in immediately after checking sk->sk_err, tcp_poll will
return POLLIN but not POLLOUT. Fix this by checking sk->sk_err at the end
of tcp_poll. Additionally, ensure the correct order of operations on SMP
machines with memory barriers.
Signed-off-by: Tom Marshall <tdm.code@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/ipv4/tcp.c | 7 +++++--
net/ipv4/tcp_input.c | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1b40924..3fa16d9 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -388,8 +388,6 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
*/
mask = 0;
- if (sk->sk_err)
- mask = POLLERR;
/*
* POLLHUP is certainly not done right. But poll() doesn't
@@ -459,6 +457,11 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
if (tp->urg_data & TCP_URG_VALID)
mask |= POLLPRI;
}
+ /* This barrier is coupled with smp_wmb() in tcp_reset() */
+ smp_rmb();
+ if (sk->sk_err)
+ mask |= POLLERR;
+
return mask;
}
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index f240f57..dd0c9af 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4040,6 +4040,8 @@ static void tcp_reset(struct sock *sk)
default:
sk->sk_err = ECONNRESET;
}
+ /* This barrier is coupled with smp_rmb() in tcp_poll() */
+ smp_wmb();
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_error_report(sk);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 200/260] netxen: dont set skb->truesize
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (198 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 199/260] tcp: Fix race in tcp_poll Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 201/260] rose: Fix signedness issues wrt. digi count Paul Gortmaker
` (61 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Eric Dumazet, David S. Miller, Paul Gortmaker
From: Eric Dumazet <eric.dumazet@gmail.com>
commit 7e96dc7045bff8758804b047c0dfb6868f182500 upstream.
skb->truesize is set in core network.
Dont change it unless dealing with fragments.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/netxen/netxen_nic_init.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 02876f5..00001bf 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1402,7 +1402,6 @@ netxen_process_rcv(struct netxen_adapter *adapter,
if (pkt_offset)
skb_pull(skb, pkt_offset);
- skb->truesize = skb->len + sizeof(struct sk_buff);
skb->protocol = eth_type_trans(skb, netdev);
napi_gro_receive(&sds_ring->napi, skb);
@@ -1464,8 +1463,6 @@ netxen_process_lro(struct netxen_adapter *adapter,
skb_put(skb, lro_length + data_offset);
- skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb);
-
skb_pull(skb, l2_hdr_offset);
skb->protocol = eth_type_trans(skb, netdev);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 201/260] rose: Fix signedness issues wrt. digi count.
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (199 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 200/260] netxen: dont set skb->truesize Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 202/260] net: blackhole route should always be recalculated Paul Gortmaker
` (60 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, David S. Miller, Paul Gortmaker
From: David S. Miller <davem@davemloft.net>
commit 9828e6e6e3f19efcb476c567b9999891d051f52f upstream.
Just use explicit casts, since we really can't change the
types of structures exported to userspace which have been
around for 15 years or so.
Reported-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/rose/af_rose.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 4fb711a..d325c9d 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -679,7 +679,7 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1)
return -EINVAL;
- if (addr->srose_ndigis > ROSE_MAX_DIGIS)
+ if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS)
return -EINVAL;
if ((dev = rose_dev_get(&addr->srose_addr)) == NULL) {
@@ -739,7 +739,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1)
return -EINVAL;
- if (addr->srose_ndigis > ROSE_MAX_DIGIS)
+ if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS)
return -EINVAL;
/* Source + Destination digis should not exceed ROSE_MAX_DIGIS */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 202/260] net: blackhole route should always be recalculated
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (200 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 201/260] rose: Fix signedness issues wrt. digi count Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 203/260] skge: add quirk to limit DMA Paul Gortmaker
` (59 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jianzhao Wang, Nicolas Dichtel, David S. Miller,
Paul Gortmaker
From: Jianzhao Wang <jianzhao.wang@6wind.com>
commit ae2688d59b5f861dc70a091d003773975d2ae7fb upstream.
Blackhole routes are used when xfrm_lookup() returns -EREMOTE (error
triggered by IKE for example), hence this kind of route is always
temporary and so we should check if a better route exists for next
packets.
Bug has been introduced by commit d11a4dc18bf41719c9f0d7ed494d295dd2973b92.
Signed-off-by: Jianzhao Wang <jianzhao.wang@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/ipv4/route.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index cb562fd..325b43c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2758,6 +2758,11 @@ slow_output:
EXPORT_SYMBOL_GPL(__ip_route_output_key);
+static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 cookie)
+{
+ return NULL;
+}
+
static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
{
}
@@ -2766,7 +2771,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = {
.family = AF_INET,
.protocol = cpu_to_be16(ETH_P_IP),
.destroy = ipv4_dst_destroy,
- .check = ipv4_dst_check,
+ .check = ipv4_blackhole_dst_check,
.update_pmtu = ipv4_rt_blackhole_update_pmtu,
.entries = ATOMIC_INIT(0),
};
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 203/260] skge: add quirk to limit DMA
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (201 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 202/260] net: blackhole route should always be recalculated Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 204/260] r8169: allocate with GFP_KERNEL flag when able to sleep Paul Gortmaker
` (58 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Stanislaw Gruszka, David S. Miller, Paul Gortmaker
From: Stanislaw Gruszka <sgruszka@redhat.com>
commit 392bd0cb000d4aac9e88e4f50823db85e7220688 upstream.
Skge devices installed on some Gigabyte motherboards are not able to
perform 64 dma correctly due to board PCI implementation, so limit
DMA to 32bit if such boards are detected.
Bug was reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=447489
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Tested-by: Luya Tshimbalanga <luya@fedoraproject.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/skge.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 50eb706..e13cbd9 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -43,6 +43,7 @@
#include <linux/seq_file.h>
#include <linux/mii.h>
#include <linux/slab.h>
+#include <linux/dmi.h>
#include <asm/irq.h>
#include "skge.h"
@@ -3868,6 +3869,8 @@ static void __devinit skge_show_addr(struct net_device *dev)
netif_info(skge, probe, skge->netdev, "addr %pM\n", dev->dev_addr);
}
+static int only_32bit_dma;
+
static int __devinit skge_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
@@ -3889,7 +3892,7 @@ static int __devinit skge_probe(struct pci_dev *pdev,
pci_set_master(pdev);
- if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
+ if (!only_32bit_dma && !pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
using_dac = 1;
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
} else if (!(err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
@@ -4147,8 +4150,21 @@ static struct pci_driver skge_driver = {
.shutdown = skge_shutdown,
};
+static struct dmi_system_id skge_32bit_dma_boards[] = {
+ {
+ .ident = "Gigabyte nForce boards",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co"),
+ DMI_MATCH(DMI_BOARD_NAME, "nForce"),
+ },
+ },
+ {}
+};
+
static int __init skge_init_module(void)
{
+ if (dmi_check_system(skge_32bit_dma_boards))
+ only_32bit_dma = 1;
skge_debug_init();
return pci_register_driver(&skge_driver);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 204/260] r8169: allocate with GFP_KERNEL flag when able to sleep
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (202 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 203/260] skge: add quirk to limit DMA Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 205/260] bsg: fix incorrect device_status value Paul Gortmaker
` (57 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Stanislaw Gruszka, David S. Miller, Paul Gortmaker
From: Stanislaw Gruszka <sgruszka@redhat.com>
commit aeb19f6052b5e5c8a24aa444fbff73b84341beac upstream.
We have fedora bug report where driver fail to initialize after
suspend/resume because of memory allocation errors:
https://bugzilla.redhat.com/show_bug.cgi?id=629158
To fix use GFP_KERNEL allocation where possible.
Tested-by: Neal Becker <ndbecker2@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/r8169.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 17382c3..0fa0598 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3970,7 +3970,7 @@ static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev,
struct net_device *dev,
struct RxDesc *desc, int rx_buf_sz,
- unsigned int align)
+ unsigned int align, gfp_t gfp)
{
struct sk_buff *skb;
dma_addr_t mapping;
@@ -3978,7 +3978,7 @@ static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev,
pad = align ? align : NET_IP_ALIGN;
- skb = netdev_alloc_skb(dev, rx_buf_sz + pad);
+ skb = __netdev_alloc_skb(dev, rx_buf_sz + pad, gfp);
if (!skb)
goto err_out;
@@ -4009,7 +4009,7 @@ static void rtl8169_rx_clear(struct rtl8169_private *tp)
}
static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
- u32 start, u32 end)
+ u32 start, u32 end, gfp_t gfp)
{
u32 cur;
@@ -4024,7 +4024,7 @@ static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
skb = rtl8169_alloc_rx_skb(tp->pci_dev, dev,
tp->RxDescArray + i,
- tp->rx_buf_sz, tp->align);
+ tp->rx_buf_sz, tp->align, gfp);
if (!skb)
break;
@@ -4052,7 +4052,7 @@ static int rtl8169_init_ring(struct net_device *dev)
memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info));
memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *));
- if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC)
+ if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC, GFP_KERNEL) != NUM_RX_DESC)
goto err_out;
rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
@@ -4553,7 +4553,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
count = cur_rx - tp->cur_rx;
tp->cur_rx = cur_rx;
- delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx);
+ delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx, GFP_ATOMIC);
if (!delta && count)
netif_info(tp, intr, dev, "no Rx buffer allocated\n");
tp->dirty_rx += delta;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 205/260] bsg: fix incorrect device_status value
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (203 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 204/260] r8169: allocate with GFP_KERNEL flag when able to sleep Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 206/260] powerpc: Initialise paca->kstack before early_setup_secondary Paul Gortmaker
` (56 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, FUJITA Tomonori, James Bottomley, Paul Gortmaker
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
commit 478971600e47cb83ff2d3c63c5c24f2b04b0d6a1 upstream.
bsg incorrectly returns sg's masked_status value for device_status.
[jejb: fix up expression logic]
Reported-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
block/bsg.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/block/bsg.c b/block/bsg.c
index 82d5882..0c00870 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -426,7 +426,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
/*
* fill in all the output members
*/
- hdr->device_status = status_byte(rq->errors);
+ hdr->device_status = rq->errors & 0xff;
hdr->transport_status = host_byte(rq->errors);
hdr->driver_status = driver_byte(rq->errors);
hdr->info = 0;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 206/260] powerpc: Initialise paca->kstack before early_setup_secondary
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (204 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 205/260] bsg: fix incorrect device_status value Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 207/260] powerpc: Don't use kernel stack with translation off Paul Gortmaker
` (55 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Matt Evans, Benjamin Herrenschmidt, Paul Gortmaker
From: Matt Evans <matt@ozlabs.org>
commit f761622e59433130bc33ad086ce219feee9eb961 upstream.
As early setup calls down to slb_initialize(), we must have kstack
initialised before checking "should we add a bolted SLB entry for our kstack?"
Failing to do so means stack access requires an SLB miss exception to refill
an entry dynamically, if the stack isn't accessible via SLB(0) (kernel text
& static data). It's not always allowable to take such a miss, and
intermittent crashes will result.
Primary CPUs don't have this issue; an SLB entry is not bolted for their
stack anyway (as that lives within SLB(0)). This patch therefore only
affects the init of secondaries.
Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/powerpc/kernel/head_64.S | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index bed9a29..579751e 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -572,9 +572,6 @@ __secondary_start:
/* Set thread priority to MEDIUM */
HMT_MEDIUM
- /* Do early setup for that CPU (stab, slb, hash table pointer) */
- bl .early_setup_secondary
-
/* Initialize the kernel stack. Just a repeat for iSeries. */
LOAD_REG_ADDR(r3, current_set)
sldi r28,r24,3 /* get current_set[cpu#] */
@@ -582,6 +579,9 @@ __secondary_start:
addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
std r1,PACAKSAVE(r13)
+ /* Do early setup for that CPU (stab, slb, hash table pointer) */
+ bl .early_setup_secondary
+
/* Clear backchain so we get nice backtraces */
li r7,0
mtlr r7
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 207/260] powerpc: Don't use kernel stack with translation off
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (205 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 206/260] powerpc: Initialise paca->kstack before early_setup_secondary Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 208/260] b44: fix carrier detection on bind Paul Gortmaker
` (54 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Michael Neuling, Benjamin Herrenschmidt,
Paul Gortmaker
From: Michael Neuling <mikey@neuling.org>
commit 54a834043314c257210db2a9d59f8cc605571639 upstream.
In f761622e59433130bc33ad086ce219feee9eb961 we changed
early_setup_secondary so it's called using the proper kernel stack
rather than the emergency one.
Unfortunately, this stack pointer can't be used when translation is off
on PHYP as this stack pointer might be outside the RMO. This results in
the following on all non zero cpus:
cpu 0x1: Vector: 300 (Data Access) at [c00000001639fd10]
pc: 000000000001c50c
lr: 000000000000821c
sp: c00000001639ff90
msr: 8000000000001000
dar: c00000001639ffa0
dsisr: 42000000
current = 0xc000000016393540
paca = 0xc000000006e00200
pid = 0, comm = swapper
The original patch was only tested on bare metal system, so it never
caught this problem.
This changes __secondary_start so that we calculate the new stack
pointer but only start using it after we've called early_setup_secondary.
With this patch, the above problem goes away.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/powerpc/kernel/head_64.S | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 579751e..ad90636 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -575,13 +575,19 @@ __secondary_start:
/* Initialize the kernel stack. Just a repeat for iSeries. */
LOAD_REG_ADDR(r3, current_set)
sldi r28,r24,3 /* get current_set[cpu#] */
- ldx r1,r3,r28
- addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
- std r1,PACAKSAVE(r13)
+ ldx r14,r3,r28
+ addi r14,r14,THREAD_SIZE-STACK_FRAME_OVERHEAD
+ std r14,PACAKSAVE(r13)
/* Do early setup for that CPU (stab, slb, hash table pointer) */
bl .early_setup_secondary
+ /*
+ * setup the new stack pointer, but *don't* use this until
+ * translation is on.
+ */
+ mr r1, r14
+
/* Clear backchain so we get nice backtraces */
li r7,0
mtlr r7
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 208/260] b44: fix carrier detection on bind
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (206 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 207/260] powerpc: Don't use kernel stack with translation off Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 209/260] ACPI: enable repeated PCIEXP wakeup by clearing PCIEXP_WAKE_STS on resume Paul Gortmaker
` (53 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Paul Fertser, David S. Miller, Paul Gortmaker
From: Paul Fertser <fercerpav@gmail.com>
commit bcf64aa379fcadd074449cbf0c049da70071b06f upstream.
For carrier detection to work properly when binding the driver with a cable
unplugged, netif_carrier_off() should be called after register_netdev(),
not before.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/b44.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 69d9f3d..7a4d680 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2170,8 +2170,6 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
dev->irq = sdev->irq;
SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);
- netif_carrier_off(dev);
-
err = ssb_bus_powerup(sdev->bus, 0);
if (err) {
dev_err(sdev->dev,
@@ -2211,6 +2209,8 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
goto err_out_powerdown;
}
+ netif_carrier_off(dev);
+
ssb_set_drvdata(sdev, dev);
/* Chip reset provides power to the b44 MAC & PCI cores, which
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 209/260] ACPI: enable repeated PCIEXP wakeup by clearing PCIEXP_WAKE_STS on resume
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (207 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 208/260] b44: fix carrier detection on bind Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 210/260] intel_idle: PCI quirk to prevent Lenovo Ideapad s10-3 boot hang Paul Gortmaker
` (52 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Colin Ian King, Len Brown, Paul Gortmaker
From: Colin Ian King <colin.king@canonical.com>
commit 573b638158029898caf9470c8214b7ddd29751e3 upstream.
Section 4.7.3.1.1 (PM1 Status Registers) of version 4.0 of
the ACPI spec concerning PCIEXP_WAKE_STS points out in
in the final note field in table 4-11 that if this bit is
set to 1 and the system is put into a sleeping state then
the system will not automatically wake.
This bit gets set by hardware to indicate that the system
woke up due to a PCI Express wakeup event, so clear it during
acpi_hw_clear_acpi_status() calls to enable subsequent
resumes to work.
BugLink: http://bugs.launchpad.net/bugs/613381
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/acpi/acpica/aclocal.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 24b8faa..3a739ba 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -848,6 +848,7 @@ struct acpi_bit_register_info {
ACPI_BITMASK_POWER_BUTTON_STATUS | \
ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
ACPI_BITMASK_RT_CLOCK_STATUS | \
+ ACPI_BITMASK_PCIEXP_WAKE_DISABLE | \
ACPI_BITMASK_WAKE_STATUS)
#define ACPI_BITMASK_TIMER_ENABLE 0x0001
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 210/260] intel_idle: PCI quirk to prevent Lenovo Ideapad s10-3 boot hang
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (208 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 209/260] ACPI: enable repeated PCIEXP wakeup by clearing PCIEXP_WAKE_STS on resume Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 211/260] ACPI: EC: add Vista incompatibility DMI entry for Toshiba Satellite L355 Paul Gortmaker
` (51 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Len Brown, Paul Gortmaker
From: Len Brown <len.brown@intel.com>
commit 4731fdcf6f7bdab3e369a3f844d4ea4d4017284d upstream.
When the Lenovo Ideapad S10-3 is booted with HT enabled,
it hits a boot hang in the intel_idle driver.
This occurs when entering ATM-C4 for the first time,
unless BM_STS is first cleared.
acpi_idle doesn't see this because it first checks
and clears BM_STS, but it would hit the same hang
if that check were disabled.
http://bugs.meego.com/show_bug.cgi?id=7093
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/634702
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/pci/quirks.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index c582935..4a120b7 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -150,6 +150,26 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_d
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs);
/*
+ * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear
+ * for some HT machines to use C4 w/o hanging.
+ */
+static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev)
+{
+ u32 pmbase;
+ u16 pm1a;
+
+ pci_read_config_dword(dev, 0x40, &pmbase);
+ pmbase = pmbase & 0xff80;
+ pm1a = inw(pmbase);
+
+ if (pm1a & 0x10) {
+ dev_info(&dev->dev, FW_BUG "TigerPoint LPC.BM_STS cleared\n");
+ outw(0x10, pmbase);
+ }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts);
+
+/*
* Chipsets where PCI->PCI transfers vanish or hang
*/
static void __devinit quirk_nopcipci(struct pci_dev *dev)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 211/260] ACPI: EC: add Vista incompatibility DMI entry for Toshiba Satellite L355
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (209 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 210/260] intel_idle: PCI quirk to prevent Lenovo Ideapad s10-3 boot hang Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 212/260] ACPI: delete ZEPTO idle=nomwait DMI quirk Paul Gortmaker
` (50 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Len Brown, Paul Gortmaker
From: Len Brown <len.brown@intel.com>
commit 7a1d602f5fc35d14907b7da98d5627acb69589d1 upstream.
https://bugzilla.kernel.org/show_bug.cgi?id=12641
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/acpi/blacklist.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index 2815df6..6931946 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -218,6 +218,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
},
},
{
+ .callback = dmi_disable_osi_vista,
+ .ident = "Toshiba Satellite L355",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"),
+ },
+ },
+ {
.callback = dmi_disable_osi_win7,
.ident = "ASUS K50IJ",
.matches = {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 212/260] ACPI: delete ZEPTO idle=nomwait DMI quirk
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (210 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 211/260] ACPI: EC: add Vista incompatibility DMI entry for Toshiba Satellite L355 Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 213/260] ACPI: Disable Windows Vista compatibility for Toshiba P305D Paul Gortmaker
` (49 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Len Brown, Paul Gortmaker
From: Len Brown <len.brown@intel.com>
commit 64a32307b710c100beb101e9c78f8022f0e8ba61 upstream.
per comments in the bug report, this entry
seems to hurt at much as it helps.
https://bugzilla.kernel.org/show_bug.cgi?id=10807
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/acpi/processor_core.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index e9699aa..b618f88 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -29,12 +29,6 @@ static int set_no_mwait(const struct dmi_system_id *id)
static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = {
{
- set_no_mwait, "IFL91 board", {
- DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
- DMI_MATCH(DMI_SYS_VENDOR, "ZEPTO"),
- DMI_MATCH(DMI_PRODUCT_VERSION, "3215W"),
- DMI_MATCH(DMI_BOARD_NAME, "IFL91") }, NULL},
- {
set_no_mwait, "Extensa 5220", {
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 213/260] ACPI: Disable Windows Vista compatibility for Toshiba P305D
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (211 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 212/260] ACPI: delete ZEPTO idle=nomwait DMI quirk Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 214/260] x86: detect scattered cpuid features earlier Paul Gortmaker
` (48 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel; +Cc: stable-review, Zhang Rui, Len Brown, Paul Gortmaker
From: Zhang Rui <rui.zhang@intel.com>
commit 337279ce3aa85d81d34c0f837d1c204df105103b upstream.
Disable the Windows Vista (SP1) compatibility for Toshiba P305D.
http://bugzilla.kernel.org/show_bug.cgi?id=14736
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/acpi/blacklist.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index 6931946..ab645bb 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -233,6 +233,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"),
},
},
+ {
+ .callback = dmi_disable_osi_vista,
+ .ident = "Toshiba P305D",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"),
+ },
+ },
/*
* BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 214/260] x86: detect scattered cpuid features earlier
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (212 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 213/260] ACPI: Disable Windows Vista compatibility for Toshiba P305D Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 215/260] setup_arg_pages: diagnose excessive argument size Paul Gortmaker
` (47 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jacob Pan, H. Peter Anvin, Paul Gortmaker
From: Jacob Pan <jacob.jun.pan@linux.intel.com>
commit 1dedefd1a066a795a87afca9c0236e1a94de9bf6 upstream.
Some extra CPU features such as ARAT is needed in early boot so
that x86_init function pointers can be set up properly.
http://lkml.org/lkml/2010/5/18/519
At start_kernel() level, this patch moves init_scattered_cpuid_features()
from check_bugs() to setup_arch() -> early_cpu_init() which is earlier than
platform specific x86_init layer setup. Suggested by HPA.
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
LKML-Reference: <1274295685-6774-2-git-send-email-jacob.jun.pan@linux.intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/cpu/common.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index c4329af..497c3b2 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -576,6 +576,7 @@ void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
if (c->extended_cpuid_level >= 0x80000007)
c->x86_power = cpuid_edx(0x80000007);
+ init_scattered_cpuid_features(c);
}
static void __cpuinit identify_cpu_without_cpuid(struct cpuinfo_x86 *c)
@@ -731,7 +732,6 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
get_model_name(c); /* Default name */
- init_scattered_cpuid_features(c);
detect_nopl(c);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 215/260] setup_arg_pages: diagnose excessive argument size
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (213 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 214/260] x86: detect scattered cpuid features earlier Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 216/260] execve: improve interactivity with large arguments Paul Gortmaker
` (46 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Roland McGrath, Linus Torvalds, Paul Gortmaker
From: Roland McGrath <roland@redhat.com>
commit 1b528181b2ffa14721fb28ad1bd539fe1732c583 upstream.
The CONFIG_STACK_GROWSDOWN variant of setup_arg_pages() does not
check the size of the argument/environment area on the stack.
When it is unworkably large, shift_arg_pages() hits its BUG_ON.
This is exploitable with a very large RLIMIT_STACK limit, to
create a crash pretty easily.
Check that the initial stack is not too large to make it possible
to map in any executable. We're not checking that the actual
executable (or intepreter, for binfmt_elf) will fit. So those
mappings might clobber part of the initial stack mapping. But
that is just userland lossage that userland made happen, not a
kernel problem.
Signed-off-by: Roland McGrath <roland@redhat.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/exec.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c
index e6e94c6..b884fde 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -593,6 +593,11 @@ int setup_arg_pages(struct linux_binprm *bprm,
#else
stack_top = arch_align_stack(stack_top);
stack_top = PAGE_ALIGN(stack_top);
+
+ if (unlikely(stack_top < mmap_min_addr) ||
+ unlikely(vma->vm_end - vma->vm_start >= stack_top - mmap_min_addr))
+ return -ENOMEM;
+
stack_shift = vma->vm_end - stack_top;
bprm->p -= stack_shift;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 216/260] execve: improve interactivity with large arguments
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (214 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 215/260] setup_arg_pages: diagnose excessive argument size Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 217/260] execve: make responsive to SIGKILL " Paul Gortmaker
` (45 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Roland McGrath, Linus Torvalds, Paul Gortmaker
From: Roland McGrath <roland@redhat.com>
commit 7993bc1f4663c0db67bb8f0d98e6678145b387cd upstream.
This adds a preemption point during the copying of the argument and
environment strings for execve, in copy_strings(). There is already
a preemption point in the count() loop, so this doesn't add any new
points in the abstract sense.
When the total argument+environment strings are very large, the time
spent copying them can be much more than a normal user time slice.
So this change improves the interactivity of the rest of the system
when one process is doing an execve with very large arguments.
Signed-off-by: Roland McGrath <roland@redhat.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/exec.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c
index b884fde..b187ab0 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -419,6 +419,8 @@ static int copy_strings(int argc, char __user * __user * argv,
while (len > 0) {
int offset, bytes_to_copy;
+ cond_resched();
+
offset = pos % PAGE_SIZE;
if (offset == 0)
offset = PAGE_SIZE;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 217/260] execve: make responsive to SIGKILL with large arguments
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (215 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 216/260] execve: improve interactivity with large arguments Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 218/260] mm: Move vma_stack_continue into mm.h Paul Gortmaker
` (44 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Roland McGrath, Linus Torvalds, Paul Gortmaker
From: Roland McGrath <roland@redhat.com>
commit 9aea5a65aa7a1af9a4236dfaeb0088f1624f9919 upstream.
An execve with a very large total of argument/environment strings
can take a really long time in the execve system call. It runs
uninterruptibly to count and copy all the strings. This change
makes it abort the exec quickly if sent a SIGKILL.
Note that this is the conservative change, to interrupt only for
SIGKILL, by using fatal_signal_pending(). It would be perfectly
correct semantics to let any signal interrupt the string-copying in
execve, i.e. use signal_pending() instead of fatal_signal_pending().
We'll save that change for later, since it could have user-visible
consequences, such as having a timer set too quickly make it so that
an execve can never complete, though it always happened to work before.
Signed-off-by: Roland McGrath <roland@redhat.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/exec.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c
index b187ab0..afd9977 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -376,6 +376,9 @@ static int count(char __user * __user * argv, int max)
argv++;
if (i++ >= max)
return -E2BIG;
+
+ if (fatal_signal_pending(current))
+ return -ERESTARTNOHAND;
cond_resched();
}
}
@@ -419,6 +422,10 @@ static int copy_strings(int argc, char __user * __user * argv,
while (len > 0) {
int offset, bytes_to_copy;
+ if (fatal_signal_pending(current)) {
+ ret = -ERESTARTNOHAND;
+ goto out;
+ }
cond_resched();
offset = pos % PAGE_SIZE;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 218/260] mm: Move vma_stack_continue into mm.h
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (216 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 217/260] execve: make responsive to SIGKILL " Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 219/260] staging: usbip: Notify usb core of port status changes Paul Gortmaker
` (43 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Stefan Bader, Linus Torvalds, Paul Gortmaker
From: Stefan Bader <stefan.bader@canonical.com>
commit 39aa3cb3e8250db9188a6f1e3fb62ffa1a717678 upstream.
So it can be used by all that need to check for that.
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/proc/task_mmu.c | 3 ++-
include/linux/mm.h | 6 ++++++
mm/mlock.c | 6 ------
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 3544f60..971fd7a 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -224,7 +224,8 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
/* We don't show the stack guard page in /proc/maps */
start = vma->vm_start;
if (vma->vm_flags & VM_GROWSDOWN)
- start += PAGE_SIZE;
+ if (!vma_stack_continue(vma->vm_prev, vma->vm_start))
+ start += PAGE_SIZE;
seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
start,
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 04fb7f6..433d7e2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -859,6 +859,12 @@ int set_page_dirty(struct page *page);
int set_page_dirty_lock(struct page *page);
int clear_page_dirty_for_io(struct page *page);
+/* Is the vma a continuation of the stack vma above it? */
+static inline int vma_stack_continue(struct vm_area_struct *vma, unsigned long addr)
+{
+ return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
+}
+
extern unsigned long move_page_tables(struct vm_area_struct *vma,
unsigned long old_addr, struct vm_area_struct *new_vma,
unsigned long new_addr, unsigned long len);
diff --git a/mm/mlock.c b/mm/mlock.c
index 5e57ebc..6fe7001 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -135,12 +135,6 @@ void munlock_vma_page(struct page *page)
}
}
-/* Is the vma a continuation of the stack vma above it? */
-static inline int vma_stack_continue(struct vm_area_struct *vma, unsigned long addr)
-{
- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
-}
-
static inline int stack_guard_page(struct vm_area_struct *vma, unsigned long addr)
{
return (vma->vm_flags & VM_GROWSDOWN) &&
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 219/260] staging: usbip: Notify usb core of port status changes
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (217 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 218/260] mm: Move vma_stack_continue into mm.h Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 220/260] staging: usbip: Process event flags without delay Paul Gortmaker
` (42 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Max Vozeler, Greg Kroah-Hartman, Paul Gortmaker
From: Max Vozeler <mvz@vozeler.com>
commit 0c9a32f0192e656daa2ff3c9149f6d71b4a1b873 upstream.
This patch changes vhci to behave like dummy and
other hcds when disconnecting a device.
Previously detaching a device from the root hub
did not notify the usb core of the disconnect and
left the device visible.
Signed-off-by: Max Vozeler <mvz@vozeler.com>
Reported-by: Marco Lancione <marco@optikam.com>
Tested-by: Luc Jalbert <ljalbert@optikam.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/staging/usbip/vhci_hcd.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index 0b17661..7604519 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -164,6 +164,8 @@ void rh_port_disconnect(int rhport)
* spin_unlock(&vdev->ud.lock); */
spin_unlock_irqrestore(&the_controller->lock, flags);
+
+ usb_hcd_poll_rh_status(vhci_to_hcd(the_controller));
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 220/260] staging: usbip: Process event flags without delay
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (218 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 219/260] staging: usbip: Notify usb core of port status changes Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 221/260] powerpc/perf: Fix sampling enable for PPC970 Paul Gortmaker
` (41 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Max Vozeler, Greg Kroah-Hartman, Paul Gortmaker
From: Max Vozeler <mvz@vozeler.com>
commit 584c5b7cf06194464240280483ee0376cdddbbae upstream.
The way the event handler works can cause it to delay
events until eventual wakeup for another event.
For example, on device detach (vhci):
- Write to sysfs detach file
-> usbip_event_add(VDEV_EVENT_DOWN)
-> wakeup()
#define VDEV_EVENT_DOWN (USBIP_EH_SHUTDOWN | USBIP_EH_RESET).
- Event thread wakes up and passes the event to
event_handler() to process.
- It processes and clears the USBIP_EH_SHUTDOWN
flag then returns.
- The outer event loop (event_handler_loop()) calls
wait_event_interruptible().
The processing of the second flag which is part of
VDEV_EVENT_DOWN (USBIP_EH_RESET) did not happen yet.
It is delayed until the next event.
This means the ->reset callback may not happen for
a long time (if ever), leaving the usbip port in a
weird state which prevents its reuse.
This patch changes the handler to process all flags
before waiting for another wakeup.
I have verified this change to fix a problem which
prevented reattach of a usbip device. It also helps
for socket errors which missed the RESET as well.
The delayed event processing also affects the stub
side of usbip and the error handling there.
Signed-off-by: Max Vozeler <mvz@vozeler.com>
Reported-by: Marco Lancione <marco@optikam.com>
Tested-by: Luc Jalbert <ljalbert@optikam.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/staging/usbip/usbip_event.c | 16 +++-------------
1 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
index a2566f1..af3832b 100644
--- a/drivers/staging/usbip/usbip_event.c
+++ b/drivers/staging/usbip/usbip_event.c
@@ -38,21 +38,13 @@ static int event_handler(struct usbip_device *ud)
ud->eh_ops.shutdown(ud);
ud->event &= ~USBIP_EH_SHUTDOWN;
-
- break;
}
- /* Stop the error handler. */
- if (ud->event & USBIP_EH_BYE)
- return -1;
-
/* Reset the device. */
if (ud->event & USBIP_EH_RESET) {
ud->eh_ops.reset(ud);
ud->event &= ~USBIP_EH_RESET;
-
- break;
}
/* Mark the device as unusable. */
@@ -60,13 +52,11 @@ static int event_handler(struct usbip_device *ud)
ud->eh_ops.unusable(ud);
ud->event &= ~USBIP_EH_UNUSABLE;
-
- break;
}
- /* NOTREACHED */
- printk(KERN_ERR "%s: unknown event\n", __func__);
- return -1;
+ /* Stop the error handler. */
+ if (ud->event & USBIP_EH_BYE)
+ return -1;
}
return 0;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 221/260] powerpc/perf: Fix sampling enable for PPC970
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (219 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 220/260] staging: usbip: Process event flags without delay Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 222/260] pcmcia: synclink_cs: fix information leak to userland Paul Gortmaker
` (40 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Paul Mackerras, Benjamin Herrenschmidt,
Paul Gortmaker
From: Paul Mackerras <paulus@samba.org>
commit 9f5f9ffe50e90ed73040d2100db8bfc341cee352 upstream.
The logic to distinguish marked instruction events from ordinary events
on PPC970 and derivatives was flawed. The result is that instruction
sampling didn't get enabled in the PMU for some marked instruction
events, so they would never trigger. This fixes it by adding the
appropriate break statements in the switch statement.
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/powerpc/kernel/ppc970-pmu.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/ppc970-pmu.c b/arch/powerpc/kernel/ppc970-pmu.c
index 8eff48e..3fee685 100644
--- a/arch/powerpc/kernel/ppc970-pmu.c
+++ b/arch/powerpc/kernel/ppc970-pmu.c
@@ -169,9 +169,11 @@ static int p970_marked_instr_event(u64 event)
switch (unit) {
case PM_VPU:
mask = 0x4c; /* byte 0 bits 2,3,6 */
+ break;
case PM_LSU0:
/* byte 2 bits 0,2,3,4,6; all of byte 1 */
mask = 0x085dff00;
+ break;
case PM_LSU1L:
mask = 0x50 << 24; /* byte 3 bits 4,6 */
break;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 222/260] pcmcia: synclink_cs: fix information leak to userland
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (220 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 221/260] powerpc/perf: Fix sampling enable for PPC970 Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 223/260] sched: Fix string comparison in /proc/sched_features Paul Gortmaker
` (39 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Vasiliy Kulikov, Dominik Brodowski, Paul Gortmaker
From: Vasiliy Kulikov <segooon@gmail.com>
commit 5b917a1420d3d1a9c8da49fb0090692dc9aaee86 upstream.
Structure new_line is copied to userland with some padding fields unitialized.
It leads to leaking of stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/char/pcmcia/synclink_cs.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index c31a0d9..1165503 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -4144,6 +4144,8 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (cmd != SIOCWANDEV)
return hdlc_ioctl(dev, ifr, cmd);
+ memset(&new_line, 0, size);
+
switch(ifr->ifr_settings.type) {
case IF_GET_IFACE: /* return current sync_serial_settings */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 223/260] sched: Fix string comparison in /proc/sched_features
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (221 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 222/260] pcmcia: synclink_cs: fix information leak to userland Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 224/260] bluetooth: Fix missing NULL check Paul Gortmaker
` (38 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Mathieu Desnoyers, Peter Zijlstra, Tony Lindgren,
Ingo Molnar, Paul Gortmaker
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
commit 7740191cd909b75d75685fb08a5d1f54b8a9d28b upstream.
Fix incorrect handling of the following case:
INTERACTIVE
INTERACTIVE_SOMETHING_ELSE
The comparison only checks up to each element's length.
Changelog since v1:
- Embellish using some Rostedtisms.
[ mingo: ^^ == smaller and cleaner ]
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tony Lindgren <tony@atomide.com>
LKML-Reference: <20100913214700.GB16118@Krystal>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/sched.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index dd7c170..12ee156 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -713,7 +713,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
size_t cnt, loff_t *ppos)
{
char buf[64];
- char *cmp = buf;
+ char *cmp;
int neg = 0;
int i;
@@ -724,6 +724,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
return -EFAULT;
buf[cnt] = 0;
+ cmp = strstrip(buf);
if (strncmp(buf, "NO_", 3) == 0) {
neg = 1;
@@ -731,9 +732,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
}
for (i = 0; sched_feat_names[i]; i++) {
- int len = strlen(sched_feat_names[i]);
-
- if (strncmp(cmp, sched_feat_names[i], len) == 0) {
+ if (strcmp(cmp, sched_feat_names[i]) == 0) {
if (neg)
sysctl_sched_features &= ~(1UL << i);
else
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 224/260] bluetooth: Fix missing NULL check
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (222 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 223/260] sched: Fix string comparison in /proc/sched_features Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 225/260] futex: Fix errors in nested key ref-counting Paul Gortmaker
` (37 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Alan Cox, Linus Torvalds, Paul Gortmaker
From: Alan Cox <alan@linux.intel.com>
commit c19483cc5e56ac5e22dd19cf25ba210ab1537773 upstream.
Fortunately this is only exploitable on very unusual hardware.
[Reported a while ago but nothing happened so just fixing it]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/bluetooth/hci_ldisc.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 76a1abb..283b127 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -258,9 +258,16 @@ static int hci_uart_tty_open(struct tty_struct *tty)
BT_DBG("tty %p", tty);
+ /* FIXME: This btw is bogus, nothing requires the old ldisc to clear
+ the pointer */
if (hu)
return -EEXIST;
+ /* Error if the tty has no write op instead of leaving an exploitable
+ hole */
+ if (tty->ops->write == NULL)
+ return -EOPNOTSUPP;
+
if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) {
BT_ERR("Can't allocate control structure");
return -ENFILE;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 225/260] futex: Fix errors in nested key ref-counting
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (223 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 224/260] bluetooth: Fix missing NULL check Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 226/260] mm, x86: Saving vmcore with non-lazy freeing of vmas Paul Gortmaker
` (36 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Darren Hart, Peter Zijlstra, Eric Dumazet,
John Kacur, Rusty Russell, Thomas Gleixner, Paul Gortmaker
From: Darren Hart <dvhart@linux.intel.com>
commit 7ada876a8703f23befbb20a7465a702ee39b1704 upstream.
futex_wait() is leaking key references due to futex_wait_setup()
acquiring an additional reference via the queue_lock() routine. The
nested key ref-counting has been masking bugs and complicating code
analysis. queue_lock() is only called with a previously ref-counted
key, so remove the additional ref-counting from the queue_(un)lock()
functions.
Also futex_wait_requeue_pi() drops one key reference too many in
unqueue_me_pi(). Remove the key reference handling from
unqueue_me_pi(). This was paired with a queue_lock() in
futex_lock_pi(), so the count remains unchanged.
Document remaining nested key ref-counting sites.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Reported-and-tested-by: Matthieu Fertré<matthieu.fertre@kerlabs.com>
Reported-by: Louis Rilling<louis.rilling@kerlabs.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
LKML-Reference: <4CBB17A8.70401@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
kernel/futex.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index 6a3a5fa..e328f57 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1363,7 +1363,6 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
{
struct futex_hash_bucket *hb;
- get_futex_key_refs(&q->key);
hb = hash_futex(&q->key);
q->lock_ptr = &hb->lock;
@@ -1375,7 +1374,6 @@ static inline void
queue_unlock(struct futex_q *q, struct futex_hash_bucket *hb)
{
spin_unlock(&hb->lock);
- drop_futex_key_refs(&q->key);
}
/**
@@ -1480,8 +1478,6 @@ static void unqueue_me_pi(struct futex_q *q)
q->pi_state = NULL;
spin_unlock(q->lock_ptr);
-
- drop_futex_key_refs(&q->key);
}
/*
@@ -1812,7 +1808,10 @@ static int futex_wait(u32 __user *uaddr, int fshared,
}
retry:
- /* Prepare to wait on uaddr. */
+ /*
+ * Prepare to wait on uaddr. On success, holds hb lock and increments
+ * q.key refs.
+ */
ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);
if (ret)
goto out;
@@ -1822,24 +1821,23 @@ retry:
/* If we were woken (and unqueued), we succeeded, whatever. */
ret = 0;
+ /* unqueue_me() drops q.key ref */
if (!unqueue_me(&q))
- goto out_put_key;
+ goto out;
ret = -ETIMEDOUT;
if (to && !to->task)
- goto out_put_key;
+ goto out;
/*
* We expect signal_pending(current), but we might be the
* victim of a spurious wakeup as well.
*/
- if (!signal_pending(current)) {
- put_futex_key(fshared, &q.key);
+ if (!signal_pending(current))
goto retry;
- }
ret = -ERESTARTSYS;
if (!abs_time)
- goto out_put_key;
+ goto out;
restart = ¤t_thread_info()->restart_block;
restart->fn = futex_wait_restart;
@@ -1856,8 +1854,6 @@ retry:
ret = -ERESTART_RESTARTBLOCK;
-out_put_key:
- put_futex_key(fshared, &q.key);
out:
if (to) {
hrtimer_cancel(&to->timer);
@@ -2236,7 +2232,10 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,
q.rt_waiter = &rt_waiter;
q.requeue_pi_key = &key2;
- /* Prepare to wait on uaddr. */
+ /*
+ * Prepare to wait on uaddr. On success, increments q.key (key1) ref
+ * count.
+ */
ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);
if (ret)
goto out_key2;
@@ -2254,7 +2253,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,
* In order for us to be here, we know our q.key == key2, and since
* we took the hb->lock above, we also know that futex_requeue() has
* completed and we no longer have to concern ourselves with a wakeup
- * race with the atomic proxy lock acquition by the requeue code.
+ * race with the atomic proxy lock acquisition by the requeue code. The
+ * futex_requeue dropped our key1 reference and incremented our key2
+ * reference count.
*/
/* Check if the requeue code acquired the second futex for us. */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 226/260] mm, x86: Saving vmcore with non-lazy freeing of vmas
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (224 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 225/260] futex: Fix errors in nested key ref-counting Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 227/260] x86, cpu: Fix renamed, not-yet-shipping AMD CPUID feature bit Paul Gortmaker
` (35 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Cliff Wickman, Andrew Morton, kexec, Ingo Molnar,
Paul Gortmaker
From: Cliff Wickman <cpw@sgi.com>
commit 3ee48b6af49cf534ca2f481ecc484b156a41451d upstream.
During the reading of /proc/vmcore the kernel is doing
ioremap()/iounmap() repeatedly. And the buildup of un-flushed
vm_area_struct's is causing a great deal of overhead. (rb_next()
is chewing up most of that time).
This solution is to provide function set_iounmap_nonlazy(). It
causes a subsequent call to iounmap() to immediately purge the
vma area (with try_purge_vmap_area_lazy()).
With this patch we have seen the time for writing a 250MB
compressed dump drop from 71 seconds to 44 seconds.
Signed-off-by: Cliff Wickman <cpw@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: kexec@lists.infradead.org
LKML-Reference: <E1OwHZ4-0005WK-Tw@eag09.americas.sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/include/asm/io.h | 1 +
arch/x86/kernel/crash_dump_64.c | 1 +
mm/vmalloc.c | 9 +++++++++
3 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 30a3e97..6a45ec4 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -206,6 +206,7 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
extern void iounmap(volatile void __iomem *addr);
+extern void set_iounmap_nonlazy(void);
#ifdef __KERNEL__
diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c
index 045b36c..ce96a6b 100644
--- a/arch/x86/kernel/crash_dump_64.c
+++ b/arch/x86/kernel/crash_dump_64.c
@@ -46,6 +46,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
} else
memcpy(buf, vaddr + offset, csize);
+ set_iounmap_nonlazy();
iounmap(vaddr);
return csize;
}
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ae00746..20a402c 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -513,6 +513,15 @@ static atomic_t vmap_lazy_nr = ATOMIC_INIT(0);
static void purge_fragmented_blocks_allcpus(void);
/*
+ * called before a call to iounmap() if the caller wants vm_area_struct's
+ * immediately freed.
+ */
+void set_iounmap_nonlazy(void)
+{
+ atomic_set(&vmap_lazy_nr, lazy_max_pages()+1);
+}
+
+/*
* Purges all lazily-freed vmap areas.
*
* If sync is 0 then don't purge if there is already a purge in progress.
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 227/260] x86, cpu: Fix renamed, not-yet-shipping AMD CPUID feature bit
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (225 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 226/260] mm, x86: Saving vmcore with non-lazy freeing of vmas Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 228/260] x86, kexec: Make sure to stop all CPUs before exiting the kernel Paul Gortmaker
` (34 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Andre Przywara, H. Peter Anvin, Paul Gortmaker
From: Andre Przywara <andre.przywara@amd.com>
commit 7ef8aa72ab176e0288f363d1247079732c5d5792 upstream.
The AMD SSE5 feature set as-it has been replaced by some extensions
to the AVX instruction set. Thus the bit formerly advertised as SSE5
is re-used for one of these extensions (XOP).
Although this changes the /proc/cpuinfo output, it is not user visible, as
there are no CPUs (yet) having this feature.
To avoid confusion this should be added to the stable series, too.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
LKML-Reference: <1283778860-26843-2-git-send-email-andre.przywara@amd.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/include/asm/cpufeature.h | 2 +-
arch/x86/kvm/x86.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 0cd82d0..5d06401 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -150,7 +150,7 @@
#define X86_FEATURE_3DNOWPREFETCH (6*32+ 8) /* 3DNow prefetch instructions */
#define X86_FEATURE_OSVW (6*32+ 9) /* OS Visible Workaround */
#define X86_FEATURE_IBS (6*32+10) /* Instruction Based Sampling */
-#define X86_FEATURE_SSE5 (6*32+11) /* SSE-5 */
+#define X86_FEATURE_XOP (6*32+11) /* extended AVX instructions */
#define X86_FEATURE_SKINIT (6*32+12) /* SKINIT/STGI instructions */
#define X86_FEATURE_WDT (6*32+13) /* Watchdog timer */
#define X86_FEATURE_NODEID_MSR (6*32+19) /* NodeId MSR */
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index a6517a2..7ea2888 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1844,7 +1844,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
const u32 kvm_supported_word6_x86_features =
F(LAHF_LM) | F(CMP_LEGACY) | F(SVM) | 0 /* ExtApicSpace */ |
F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
- F(3DNOWPREFETCH) | 0 /* OSVW */ | 0 /* IBS */ | F(SSE5) |
+ F(3DNOWPREFETCH) | 0 /* OSVW */ | 0 /* IBS */ | F(XOP) |
0 /* SKINIT */ | 0 /* WDT */;
/* all calls to cpuid_count() should be made on the same cpu */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 228/260] x86, kexec: Make sure to stop all CPUs before exiting the kernel
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (226 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 227/260] x86, cpu: Fix renamed, not-yet-shipping AMD CPUID feature bit Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 229/260] x86, olpc: Don't retry EC commands forever Paul Gortmaker
` (33 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Alok Kataria, Eric W. Biederman,
Jeremy Fitzhardinge, H. Peter Anvin, Paul Gortmaker
From: Alok Kataria <akataria@vmware.com>
commit 76fac077db6b34e2c6383a7b4f3f4f7b7d06d8ce upstream.
x86 smp_ops now has a new op, stop_other_cpus which takes a parameter
"wait" this allows the caller to specify if it wants to stop until all
the cpus have processed the stop IPI. This is required specifically
for the kexec case where we should wait for all the cpus to be stopped
before starting the new kernel. We now wait for the cpus to stop in
all cases except for panic/kdump where we expect things to be broken
and we are doing our best to make things work anyway.
This patch fixes a legitimate regression, which was introduced during
2.6.30, by commit id 4ef702c10b5df18ab04921fc252c26421d4d6c75.
Signed-off-by: Alok N Kataria <akataria@vmware.com>
LKML-Reference: <1286833028.1372.20.camel@ank32.eng.vmware.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/include/asm/smp.h | 9 +++++++--
arch/x86/kernel/reboot.c | 2 +-
arch/x86/kernel/smp.c | 15 +++++++++------
arch/x86/xen/enlighten.c | 2 +-
arch/x86/xen/smp.c | 6 +++---
5 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 4cfc908..4c2f63c 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -50,7 +50,7 @@ struct smp_ops {
void (*smp_prepare_cpus)(unsigned max_cpus);
void (*smp_cpus_done)(unsigned max_cpus);
- void (*smp_send_stop)(void);
+ void (*stop_other_cpus)(int wait);
void (*smp_send_reschedule)(int cpu);
int (*cpu_up)(unsigned cpu);
@@ -73,7 +73,12 @@ extern struct smp_ops smp_ops;
static inline void smp_send_stop(void)
{
- smp_ops.smp_send_stop();
+ smp_ops.stop_other_cpus(0);
+}
+
+static inline void stop_other_cpus(void)
+{
+ smp_ops.stop_other_cpus(1);
}
static inline void smp_prepare_boot_cpu(void)
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 8e1aac8..ff8cc40 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -633,7 +633,7 @@ void native_machine_shutdown(void)
/* O.K Now that I'm on the appropriate processor,
* stop all of the others.
*/
- smp_send_stop();
+ stop_other_cpus();
#endif
lapic_shutdown();
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index d801210..513deac 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -159,10 +159,10 @@ asmlinkage void smp_reboot_interrupt(void)
irq_exit();
}
-static void native_smp_send_stop(void)
+static void native_stop_other_cpus(int wait)
{
unsigned long flags;
- unsigned long wait;
+ unsigned long timeout;
if (reboot_force)
return;
@@ -179,9 +179,12 @@ static void native_smp_send_stop(void)
if (num_online_cpus() > 1) {
apic->send_IPI_allbutself(REBOOT_VECTOR);
- /* Don't wait longer than a second */
- wait = USEC_PER_SEC;
- while (num_online_cpus() > 1 && wait--)
+ /*
+ * Don't wait longer than a second if the caller
+ * didn't ask us to wait.
+ */
+ timeout = USEC_PER_SEC;
+ while (num_online_cpus() > 1 && (wait || timeout--))
udelay(1);
}
@@ -227,7 +230,7 @@ struct smp_ops smp_ops = {
.smp_prepare_cpus = native_smp_prepare_cpus,
.smp_cpus_done = native_smp_cpus_done,
- .smp_send_stop = native_smp_send_stop,
+ .stop_other_cpus = native_stop_other_cpus,
.smp_send_reschedule = native_smp_send_reschedule,
.cpu_up = native_cpu_up,
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 27dff06..4d32089 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1001,7 +1001,7 @@ static void xen_reboot(int reason)
struct sched_shutdown r = { .reason = reason };
#ifdef CONFIG_SMP
- smp_send_stop();
+ stop_other_cpus();
#endif
if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r))
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index a29693f..d2dfbf5 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -398,9 +398,9 @@ static void stop_self(void *v)
BUG();
}
-static void xen_smp_send_stop(void)
+static void xen_stop_other_cpus(int wait)
{
- smp_call_function(stop_self, NULL, 0);
+ smp_call_function(stop_self, NULL, wait);
}
static void xen_smp_send_reschedule(int cpu)
@@ -468,7 +468,7 @@ static const struct smp_ops xen_smp_ops __initdata = {
.cpu_disable = xen_cpu_disable,
.play_dead = xen_play_dead,
- .smp_send_stop = xen_smp_send_stop,
+ .stop_other_cpus = xen_stop_other_cpus,
.smp_send_reschedule = xen_smp_send_reschedule,
.send_call_func_ipi = xen_smp_send_call_function_ipi,
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 229/260] x86, olpc: Don't retry EC commands forever
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (227 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 228/260] x86, kexec: Make sure to stop all CPUs before exiting the kernel Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 230/260] x86, mtrr: Assume SYS_CFG[Tom2ForceMemTypeWB] exists on all future AMD CPUs Paul Gortmaker
` (32 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Paul Fox, Daniel Drake, dilinger, Ingo Molnar,
Paul Gortmaker
From: Paul Fox <pgf@laptop.org>
commit 286e5b97eb22baab9d9a41ca76c6b933a484252c upstream.
Avoids a potential infinite loop.
It was observed once, during an EC hacking/debugging
session - not in regular operation.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Cc: dilinger@queued.net
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/olpc.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c
index 8297160..a23b382 100644
--- a/arch/x86/kernel/olpc.c
+++ b/arch/x86/kernel/olpc.c
@@ -117,6 +117,7 @@ int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
unsigned long flags;
int ret = -EIO;
int i;
+ int restarts = 0;
spin_lock_irqsave(&ec_lock, flags);
@@ -173,7 +174,9 @@ restart:
if (wait_on_obf(0x6c, 1)) {
printk(KERN_ERR "olpc-ec: timeout waiting for"
" EC to provide data!\n");
- goto restart;
+ if (restarts++ < 10)
+ goto restart;
+ goto err;
}
outbuf[i] = inb(0x68);
printk(KERN_DEBUG "olpc-ec: received 0x%x\n",
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 230/260] x86, mtrr: Assume SYS_CFG[Tom2ForceMemTypeWB] exists on all future AMD CPUs
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (228 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 229/260] x86, olpc: Don't retry EC commands forever Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 231/260] x86, intr-remap: Set redirection hint in the IRTE Paul Gortmaker
` (31 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Andreas Herrmann, H. Peter Anvin, Paul Gortmaker
From: Andreas Herrmann <andreas.herrmann3@amd.com>
commit 3fdbf004c1706480a7c7fac3c9d836fa6df20d7d upstream.
Instead of adapting the CPU family check in amd_special_default_mtrr()
for each new CPU family assume that all new AMD CPUs support the
necessary bits in SYS_CFG MSR.
Tom2Enabled is architectural (defined in APM Vol.2).
Tom2ForceMemTypeWB is defined in all BKDGs starting with K8 NPT.
In pre K8-NPT BKDG this bit is reserved (read as zero).
W/o this adaption Linux would unnecessarily complain about bad MTRR
settings on every new AMD CPU family, e.g.
[ 0.000000] WARNING: BIOS bug: CPU MTRRs don't cover all of memory, losing 4863MB of RAM.
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
LKML-Reference: <20100930123235.GB20545@loge.amd.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/cpu/mtrr/cleanup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 06130b5..a670384 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -827,7 +827,7 @@ int __init amd_special_default_mtrr(void)
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
return 0;
- if (boot_cpu_data.x86 < 0xf || boot_cpu_data.x86 > 0x11)
+ if (boot_cpu_data.x86 < 0xf)
return 0;
/* In case some hypervisor doesn't pass SYSCFG through: */
if (rdmsr_safe(MSR_K8_SYSCFG, &l, &h) < 0)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 231/260] x86, intr-remap: Set redirection hint in the IRTE
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (229 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 230/260] x86, mtrr: Assume SYS_CFG[Tom2ForceMemTypeWB] exists on all future AMD CPUs Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 232/260] x86, kdump: Change copy_oldmem_page() to use cached addressing Paul Gortmaker
` (30 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Suresh Siddha, Weidong Han, H. Peter Anvin,
Paul Gortmaker
From: Suresh Siddha <suresh.b.siddha@intel.com>
commit 75e3cfbed6f71a8f151dc6e413b6ce3c390030cb upstream.
Currently the redirection hint in the interrupt-remapping table entry
is set to 0, which means the remapped interrupt is directed to the
processors listed in the destination. So in logical flat mode
in the presence of intr-remapping, this results in a single
interrupt multi-casted to multiple cpu's as specified by the destination
bit mask. But what we really want is to send that interrupt to one of the cpus
based on the lowest priority delivery mode.
Set the redirection hint in the IRTE to '1' to indicate that we want
the remapped interrupt to be directed to only one of the processors
listed in the destination.
This fixes the issue of same interrupt getting delivered to multiple cpu's
in the logical flat mode in the presence of interrupt-remapping. While
there is no functional issue observed with this behavior, this will
impact performance of such configurations (<=8 cpu's using logical flat
mode in the presence of interrupt-remapping)
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <20100827181049.013051492@sbsiddha-MOBL3.sc.intel.com>
Cc: Weidong Han <weidong.han@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/apic/io_apic.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 469d45a..38128cc 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1401,6 +1401,7 @@ int setup_ioapic_entry(int apic_id, int irq,
irte.dlvry_mode = apic->irq_delivery_mode;
irte.vector = vector;
irte.dest_id = IRTE_DEST(destination);
+ irte.redir_hint = 1;
/* Set source-id of interrupt request */
set_ioapic_sid(&irte, apic_id);
@@ -3364,6 +3365,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
irte.dlvry_mode = apic->irq_delivery_mode;
irte.vector = cfg->vector;
irte.dest_id = IRTE_DEST(dest);
+ irte.redir_hint = 1;
/* Set source-id of interrupt request */
if (pdev)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 232/260] x86, kdump: Change copy_oldmem_page() to use cached addressing
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (230 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 231/260] x86, intr-remap: Set redirection hint in the IRTE Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 233/260] KVM: MMU: fix direct sp's access corrupted Paul Gortmaker
` (29 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Cliff Wickman, kexec, Ingo Molnar, Paul Gortmaker
From: Cliff Wickman <cpw@sgi.com>
commit 37a2f9f30a360fb03522d15c85c78265ccd80287 upstream.
The copy of /proc/vmcore to a user buffer proceeds much faster
if the kernel addresses memory as cached.
With this patch we have seen an increase in transfer rate from
less than 15MB/s to 80-460MB/s, depending on size of the
transfer. This makes a big difference in time needed to save a
system dump.
Signed-off-by: Cliff Wickman <cpw@sgi.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: kexec@lists.infradead.org
LKML-Reference: <E1OtMLz-0001yp-Ia@eag09.americas.sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kernel/crash_dump_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c
index ce96a6b..9948288 100644
--- a/arch/x86/kernel/crash_dump_64.c
+++ b/arch/x86/kernel/crash_dump_64.c
@@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
if (!csize)
return 0;
- vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
+ vaddr = ioremap_cache(pfn << PAGE_SHIFT, PAGE_SIZE);
if (!vaddr)
return -ENOMEM;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 233/260] KVM: MMU: fix direct sp's access corrupted
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (231 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 232/260] x86, kdump: Change copy_oldmem_page() to use cached addressing Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 234/260] KVM: MMU: fix conflict access permissions in direct sp Paul Gortmaker
` (28 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Xiao Guangrong, Marcelo Tosatti, Paul Gortmaker
From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
commit 9e7b0e7fba45ca3c6357aeb7091ebc281f1de365 upstream.
If the mapping is writable but the dirty flag is not set, we will find
the read-only direct sp and setup the mapping, then if the write #PF
occur, we will mark this mapping writable in the read-only direct sp,
now, other real read-only mapping will happily write it without #PF.
It may hurt guest's COW
Fixed by re-install the mapping when write #PF occur.
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kvm/paging_tmpl.h | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 81eab9a..a535c87 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -318,8 +318,32 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
break;
}
- if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep))
- continue;
+ if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep)) {
+ struct kvm_mmu_page *child;
+ unsigned direct_access;
+
+ if (level != gw->level)
+ continue;
+
+ /*
+ * For the direct sp, if the guest pte's dirty bit
+ * changed form clean to dirty, it will corrupt the
+ * sp's access: allow writable in the read-only sp,
+ * so we should update the spte at this point to get
+ * a new sp with the correct access.
+ */
+ direct_access = gw->pt_access & gw->pte_access;
+ if (!is_dirty_gpte(gw->ptes[gw->level - 1]))
+ direct_access &= ~ACC_WRITE_MASK;
+
+ child = page_header(*sptep & PT64_BASE_ADDR_MASK);
+ if (child->role.access == direct_access)
+ continue;
+
+ mmu_page_remove_parent_pte(child, sptep);
+ __set_spte(sptep, shadow_trap_nonpresent_pte);
+ kvm_flush_remote_tlbs(vcpu->kvm);
+ }
if (is_large_pte(*sptep)) {
rmap_remove(vcpu->kvm, sptep);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 234/260] KVM: MMU: fix conflict access permissions in direct sp
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (232 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 233/260] KVM: MMU: fix direct sp's access corrupted Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 235/260] KVM: VMX: Fix host GDT.LIMIT corruption Paul Gortmaker
` (27 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Xiao Guangrong, Marcelo Tosatti, Paul Gortmaker
From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
commit 5fd5387c89ec99ff6cb82d2477ffeb7211b781c2 upstream.
In no-direct mapping, we mark sp is 'direct' when we mapping the
guest's larger page, but its access is encoded form upper page-struct
entire not include the last mapping, it will cause access conflict.
For example, have this mapping:
[W]
/ PDE1 -> |---|
P[W] | | LPA
\ PDE2 -> |---|
[R]
P have two children, PDE1 and PDE2, both PDE1 and PDE2 mapping the
same lage page(LPA). The P's access is WR, PDE1's access is WR,
PDE2's access is RO(just consider read-write permissions here)
When guest access PDE1, we will create a direct sp for LPA, the sp's
access is from P, is W, then we will mark the ptes is W in this sp.
Then, guest access PDE2, we will find LPA's shadow page, is the same as
PDE's, and mark the ptes is RO.
So, if guest access PDE1, the incorrect #PF is occured.
Fixed by encode the last mapping access into direct shadow page
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kvm/paging_tmpl.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index a535c87..2bd2b3e 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -356,6 +356,8 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
direct = 1;
if (!is_dirty_gpte(gw->ptes[level - delta]))
access &= ~ACC_WRITE_MASK;
+ access &= gw->pte_access;
+
table_gfn = gpte_to_gfn(gw->ptes[level - delta]);
/* advance table_gfn when emulating 1gb pages with 4k */
if (delta == 0)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 235/260] KVM: VMX: Fix host GDT.LIMIT corruption
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (233 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 234/260] KVM: MMU: fix conflict access permissions in direct sp Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 236/260] KVM: x86: Fix SVM VMCB reset Paul Gortmaker
` (26 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Avi Kivity, Marcelo Tosatti, Paul Gortmaker
From: Avi Kivity <avi@redhat.com>
commit 3444d7da1839b851eefedd372978d8a982316c36 upstream.
vmx does not restore GDT.LIMIT to the host value, instead it sets it to 64KB.
This means host userspace can learn a few bits of host memory.
Fix by reloading GDTR when we load other host state.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kvm/vmx.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 3c86c42..11db911 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -170,6 +170,7 @@ static u64 construct_eptp(unsigned long root_hpa);
static DEFINE_PER_CPU(struct vmcs *, vmxarea);
static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
static DEFINE_PER_CPU(struct list_head, vcpus_on_cpu);
+static DEFINE_PER_CPU(struct desc_ptr, host_gdt);
static unsigned long *vmx_io_bitmap_a;
static unsigned long *vmx_io_bitmap_b;
@@ -717,6 +718,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
}
#endif
+ load_gdt(&__get_cpu_var(host_gdt));
}
static void vmx_load_host_state(struct vcpu_vmx *vmx)
@@ -1218,6 +1220,8 @@ static int hardware_enable(void *garbage)
ept_sync_global();
+ store_gdt(&__get_cpu_var(host_gdt));
+
return 0;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 236/260] KVM: x86: Fix SVM VMCB reset
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (234 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 235/260] KVM: VMX: Fix host GDT.LIMIT corruption Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 237/260] KVM: x86: Move TSC reset out of vmcb_init Paul Gortmaker
` (25 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Zachary Amsden, Marcelo Tosatti, Paul Gortmaker
From: Zachary Amsden <zamsden@redhat.com>
commit 58877679fd393d3ef71aa383031ac7817561463d upstream.
On reset, VMCB TSC should be set to zero. Instead, code was setting
tsc_offset to zero, which passes through the underlying TSC.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kvm/svm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 49dabc1..508e136 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -632,7 +632,7 @@ static void init_vmcb(struct vcpu_svm *svm)
control->iopm_base_pa = iopm_base;
control->msrpm_base_pa = __pa(svm->msrpm);
- control->tsc_offset = 0;
+ control->tsc_offset = 0-native_read_tsc();
control->int_ctl = V_INTR_MASKING_MASK;
init_seg(&save->es);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 237/260] KVM: x86: Move TSC reset out of vmcb_init
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (235 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 236/260] KVM: x86: Fix SVM VMCB reset Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 238/260] KVM: Fix fs/gs reload oops with invalid ldt Paul Gortmaker
` (24 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Zachary Amsden, Marcelo Tosatti, Paul Gortmaker
From: Zachary Amsden <zamsden@redhat.com>
commit 47008cd887c1836bcadda123ba73e1863de7a6c4 upstream.
The VMCB is reset whenever we receive a startup IPI, so Linux is setting
TSC back to zero happens very late in the boot process and destabilizing
the TSC. Instead, just set TSC to zero once at VCPU creation time.
Why the separate patch? So git-bisect is your friend.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/kvm/svm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 508e136..80453d4 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -632,7 +632,6 @@ static void init_vmcb(struct vcpu_svm *svm)
control->iopm_base_pa = iopm_base;
control->msrpm_base_pa = __pa(svm->msrpm);
- control->tsc_offset = 0-native_read_tsc();
control->int_ctl = V_INTR_MASKING_MASK;
init_seg(&save->es);
@@ -766,6 +765,7 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT;
svm->asid_generation = 0;
init_vmcb(svm);
+ svm->vmcb->control.tsc_offset = 0-native_read_tsc();
fx_init(&svm->vcpu);
svm->vcpu.arch.apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 238/260] KVM: Fix fs/gs reload oops with invalid ldt
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (236 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 237/260] KVM: x86: Move TSC reset out of vmcb_init Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 239/260] pipe: fix failure to return error code on ->confirm() Paul Gortmaker
` (23 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Avi Kivity, Marcelo Tosatti, Paul Gortmaker
From: Avi Kivity <avi@redhat.com>
commit 9581d442b9058d3699b4be568b6e5eae38a41493 upstream.
kvm reloads the host's fs and gs blindly, however the underlying segment
descriptors may be invalid due to the user modifying the ldt after loading
them.
Fix by using the safe accessors (loadsegment() and load_gs_index()) instead
of home grown unsafe versions.
This is CVE-2010-3698.
KVM-Stable-Tag.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/x86/include/asm/kvm_host.h | 24 ------------------------
arch/x86/kvm/svm.c | 15 ++++++++++-----
arch/x86/kvm/vmx.c | 24 +++++++++---------------
3 files changed, 19 insertions(+), 44 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 63400e6..9a6c267 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -691,20 +691,6 @@ static inline struct kvm_mmu_page *page_header(hpa_t shadow_page)
return (struct kvm_mmu_page *)page_private(page);
}
-static inline u16 kvm_read_fs(void)
-{
- u16 seg;
- asm("mov %%fs, %0" : "=g"(seg));
- return seg;
-}
-
-static inline u16 kvm_read_gs(void)
-{
- u16 seg;
- asm("mov %%gs, %0" : "=g"(seg));
- return seg;
-}
-
static inline u16 kvm_read_ldt(void)
{
u16 ldt;
@@ -712,16 +698,6 @@ static inline u16 kvm_read_ldt(void)
return ldt;
}
-static inline void kvm_load_fs(u16 sel)
-{
- asm("mov %0, %%fs" : : "rm"(sel));
-}
-
-static inline void kvm_load_gs(u16 sel)
-{
- asm("mov %0, %%gs" : : "rm"(sel));
-}
-
static inline void kvm_load_ldt(u16 sel)
{
asm("lldt %0" : : "rm"(sel));
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 80453d4..0d93929 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2821,8 +2821,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
sync_lapic_to_cr8(vcpu);
save_host_msrs(vcpu);
- fs_selector = kvm_read_fs();
- gs_selector = kvm_read_gs();
+ savesegment(fs, fs_selector);
+ savesegment(gs, gs_selector);
ldt_selector = kvm_read_ldt();
svm->vmcb->save.cr2 = vcpu->arch.cr2;
/* required for live migration with NPT */
@@ -2909,10 +2909,15 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp;
vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip;
- kvm_load_fs(fs_selector);
- kvm_load_gs(gs_selector);
- kvm_load_ldt(ldt_selector);
load_host_msrs(vcpu);
+ loadsegment(fs, fs_selector);
+#ifdef CONFIG_X86_64
+ load_gs_index(gs_selector);
+ wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
+#else
+ loadsegment(gs, gs_selector);
+#endif
+ kvm_load_ldt(ldt_selector);
reload_tss(vcpu);
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 11db911..2cfa656 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -651,7 +651,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
*/
vmx->host_state.ldt_sel = kvm_read_ldt();
vmx->host_state.gs_ldt_reload_needed = vmx->host_state.ldt_sel;
- vmx->host_state.fs_sel = kvm_read_fs();
+ savesegment(fs, vmx->host_state.fs_sel);
if (!(vmx->host_state.fs_sel & 7)) {
vmcs_write16(HOST_FS_SELECTOR, vmx->host_state.fs_sel);
vmx->host_state.fs_reload_needed = 0;
@@ -659,7 +659,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
vmcs_write16(HOST_FS_SELECTOR, 0);
vmx->host_state.fs_reload_needed = 1;
}
- vmx->host_state.gs_sel = kvm_read_gs();
+ savesegment(gs, vmx->host_state.gs_sel);
if (!(vmx->host_state.gs_sel & 7))
vmcs_write16(HOST_GS_SELECTOR, vmx->host_state.gs_sel);
else {
@@ -689,27 +689,21 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
static void __vmx_load_host_state(struct vcpu_vmx *vmx)
{
- unsigned long flags;
-
if (!vmx->host_state.loaded)
return;
++vmx->vcpu.stat.host_state_reload;
vmx->host_state.loaded = 0;
if (vmx->host_state.fs_reload_needed)
- kvm_load_fs(vmx->host_state.fs_sel);
+ loadsegment(fs, vmx->host_state.fs_sel);
if (vmx->host_state.gs_ldt_reload_needed) {
kvm_load_ldt(vmx->host_state.ldt_sel);
- /*
- * If we have to reload gs, we must take care to
- * preserve our gs base.
- */
- local_irq_save(flags);
- kvm_load_gs(vmx->host_state.gs_sel);
#ifdef CONFIG_X86_64
- wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE));
+ load_gs_index(vmx->host_state.gs_sel);
+ wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
+#else
+ loadsegment(gs, vmx->host_state.gs_sel);
#endif
- local_irq_restore(flags);
}
reload_tss();
#ifdef CONFIG_X86_64
@@ -2414,8 +2408,8 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */
vmcs_write16(HOST_DS_SELECTOR, __KERNEL_DS); /* 22.2.4 */
vmcs_write16(HOST_ES_SELECTOR, __KERNEL_DS); /* 22.2.4 */
- vmcs_write16(HOST_FS_SELECTOR, kvm_read_fs()); /* 22.2.4 */
- vmcs_write16(HOST_GS_SELECTOR, kvm_read_gs()); /* 22.2.4 */
+ vmcs_write16(HOST_FS_SELECTOR, 0); /* 22.2.4 */
+ vmcs_write16(HOST_GS_SELECTOR, 0); /* 22.2.4 */
vmcs_write16(HOST_SS_SELECTOR, __KERNEL_DS); /* 22.2.4 */
#ifdef CONFIG_X86_64
rdmsrl(MSR_FS_BASE, a);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 239/260] pipe: fix failure to return error code on ->confirm()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (237 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 238/260] KVM: Fix fs/gs reload oops with invalid ldt Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 240/260] p54usb: fix off-by-one on !CONFIG_PM Paul Gortmaker
` (22 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Nicolas Kaiser, Jens Axboe, Paul Gortmaker
From: Nicolas Kaiser <nikai@nikai.net>
commit e5953cbdff26f7cbae7eff30cd9b18c4e19b7594 upstream.
The arguments were transposed, we want to assign the error code to
'ret', which is being returned.
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
fs/pipe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/pipe.c b/fs/pipe.c
index 37ba29f..8087027 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -363,7 +363,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
error = ops->confirm(pipe, buf);
if (error) {
if (!ret)
- error = ret;
+ ret = error;
break;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 240/260] p54usb: fix off-by-one on !CONFIG_PM
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (238 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 239/260] pipe: fix failure to return error code on ->confirm() Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 241/260] p54usb: add five more USBIDs Paul Gortmaker
` (21 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Christian Lamparter, John W. Linville,
Paul Gortmaker
From: Christian Lamparter <chunkeey@googlemail.com>
commit 11791a6f7534906b4a01ffb54ba0b02ca39398ef upstream.
The ISL3887 chip needs a USB reset, whenever the
usb-frontend module "p54usb" is reloaded.
This patch fixes an off-by-one bug, if the user
is running a kernel without the CONFIG_PM option
set and for some reason (e.g.: compat-wireless)
wants to switch between different p54usb modules.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/wireless/p54/p54usb.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 186dc71..602498a 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -931,8 +931,8 @@ static int __devinit p54u_probe(struct usb_interface *intf,
#ifdef CONFIG_PM
/* ISL3887 needs a full reset on resume */
udev->reset_resume = 1;
+#endif /* CONFIG_PM */
err = p54u_device_reset(dev);
-#endif
priv->hw_type = P54U_3887;
dev->extra_tx_headroom += sizeof(struct lm87_tx_hdr);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 241/260] p54usb: add five more USBIDs
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (239 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 240/260] p54usb: fix off-by-one on !CONFIG_PM Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 242/260] drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure Paul Gortmaker
` (20 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Christian Lamparter, John W. Linville,
Paul Gortmaker
From: Christian Lamparter <chunkeey@googlemail.com>
commit 1a92795dac419128eb511dce30a6aad672064b88 upstream.
Source:
http://www.wikidevi.com/wiki/Intersil/p54/usb/windows
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/wireless/p54/p54usb.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 602498a..84118ff 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -33,8 +33,17 @@ MODULE_ALIAS("prism54usb");
MODULE_FIRMWARE("isl3886usb");
MODULE_FIRMWARE("isl3887usb");
+/*
+ * Note:
+ *
+ * Always update our wiki's device list (located at:
+ * http://wireless.kernel.org/en/users/Drivers/p54/devices ),
+ * whenever you add a new device.
+ */
+
static struct usb_device_id p54u_table[] __devinitdata = {
/* Version 1 devices (pci chip + net2280) */
+ {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
{USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */
{USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */
{USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */
@@ -47,7 +56,9 @@ static struct usb_device_id p54u_table[] __devinitdata = {
{USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */
{USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */
{USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */
+ {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */
{USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */
+ {USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */
{USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */
{USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */
{USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */
@@ -60,6 +71,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
{USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */
{USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */
{USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */
+ {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */
{USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
{USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
{USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
@@ -79,6 +91,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
{USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
{USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
{USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
+ {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */
{USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
{USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */
{USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 242/260] drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (240 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 241/260] p54usb: add five more USBIDs Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 243/260] USB: ftdi_sio: Add PID for accesio products Paul Gortmaker
` (19 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Julia Lawall, John W. Linville, Paul Gortmaker
From: Julia Lawall <julia@diku.dk>
commit 0d91f22b75347d9503b17a42b6c74d3f7750acd6 upstream.
In this code, 0 is returned on memory allocation failure, even though other
failures return -ENOMEM or other similar values.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression ret;
expression x,e1,e2,e3;
@@
ret = 0
... when != ret = e1
*x = \(kmalloc\|kcalloc\|kzalloc\)(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/wireless/p54/eeprom.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
index 187e263..53d0f20 100644
--- a/drivers/net/wireless/p54/eeprom.c
+++ b/drivers/net/wireless/p54/eeprom.c
@@ -262,8 +262,10 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
list->max_entries = max_channel_num;
list->channels = kzalloc(sizeof(struct p54_channel_entry) *
max_channel_num, GFP_KERNEL);
- if (!list->channels)
+ if (!list->channels) {
+ ret = -ENOMEM;
goto free;
+ }
for (i = 0; i < max_channel_num; i++) {
if (i < priv->iq_autocal_len) {
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 243/260] USB: ftdi_sio: Add PID for accesio products
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (241 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 242/260] drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure Paul Gortmaker
@ 2011-01-02 7:18 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 244/260] USB: add PID for FTDI based OpenDCC hardware Paul Gortmaker
` (18 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:18 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Rich Mattes, Greg Kroah-Hartman, Paul Gortmaker
From: Rich Mattes <richmattes@gmail.com>
commit 3126d8236ca6f68eb8292c6af22c2e59afbeef24 upstream.
Adds support for Accesio USB to Serial adapters, which are built around
FTDI FT232 UARTs. Tested with the Accesio USB-COM-4SM.
Signed-off-by: Rich Mattes <richmattes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/ftdi_sio.c | 1 +
drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index fd5c874..9d810e8 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -757,6 +757,7 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) },
+ { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) },
{ USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 6eb1592..d3d2f48 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -1070,3 +1070,9 @@
* Submitted by John G. Rogers
*/
#define SEGWAY_RMP200_PID 0xe729
+
+
+/*
+ * Accesio USB Data Acquisition products (http://www.accesio.com/)
+ */
+#define ACCESIO_COM4SM_PID 0xD578
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 244/260] USB: add PID for FTDI based OpenDCC hardware
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (242 preceding siblings ...)
2011-01-02 7:18 ` [34-longterm 243/260] USB: ftdi_sio: Add PID for accesio products Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 245/260] USB: ftdi_sio: new VID/PIDs for various Papouch devices Paul Gortmaker
` (17 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Rainer Keller, Greg Kroah-Hartman, Paul Gortmaker
From: Rainer Keller <mail@rainerkeller.de>
commit 99c1e4f89d1033444ce4d0c064bd2826e81c3775 upstream.
The OpenDCC project is developing a new hardware. This patch adds its
PID to the list of known FTDI devices. The PID can be found at
http://www.opendcc.de/elektronik/usb/opendcc_usb.html
Signed-off-by: Rainer Keller <mail@rainerkeller.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/ftdi_sio.c | 1 +
drivers/usb/serial/ftdi_sio_ids.h | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 9d810e8..f2fbf78 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -182,6 +182,7 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) },
{ USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
{ USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index d3d2f48..a214917 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -61,6 +61,7 @@
#define FTDI_OPENDCC_SNIFFER_PID 0xBFD9
#define FTDI_OPENDCC_THROTTLE_PID 0xBFDA
#define FTDI_OPENDCC_GATEWAY_PID 0xBFDB
+#define FTDI_OPENDCC_GBM_PID 0xBFDC
/*
* RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 245/260] USB: ftdi_sio: new VID/PIDs for various Papouch devices
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (243 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 244/260] USB: add PID for FTDI based OpenDCC hardware Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 246/260] USB: ftdi_sio: add device ids for ScienceScope Paul Gortmaker
` (16 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Daniel Suchy, Greg Kroah-Hartman, Paul Gortmaker
From: Daniel Suchy <danny@danysek.cz>
commit 59c6ccd9f9aecfa59c99ceba6d4d34b180547a05 upstream.
This patch for FTDI USB serial driver ads new VID/PIDs used on various
devices manufactured by Papouch (http://www.papouch.com). These devices
have their own VID/PID, although they're using standard FTDI chip. In
ftdi_sio.c, I also made small cleanup to have declarations for all
Papouch devices together.
Signed-off-by: Daniel Suchy <danny@danysek.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/ftdi_sio.c | 30 +++++++++++++++++++++++++++++-
drivers/usb/serial/ftdi_sio_ids.h | 27 ++++++++++++++++++++++++++-
2 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index f2fbf78..d2ea458 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -681,7 +681,6 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) },
{ USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) },
- { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) },
@@ -722,8 +721,37 @@ static struct usb_device_id id_table_combined [] = {
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
{ USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
+
+ /* Papouch devices based on FTDI chip */
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) },
{ USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) },
{ USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) },
+ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) },
+
{ USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
{ USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index a214917..ff8a8ad 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -1030,9 +1030,34 @@
*/
#define PAPOUCH_VID 0x5050 /* Vendor ID */
+#define PAPOUCH_SB485_PID 0x0100 /* Papouch SB485 USB-485/422 Converter */
+#define PAPOUCH_AP485_PID 0x0101 /* AP485 USB-RS485 Converter */
+#define PAPOUCH_SB422_PID 0x0102 /* Papouch SB422 USB-RS422 Converter */
+#define PAPOUCH_SB485_2_PID 0x0103 /* Papouch SB485 USB-485/422 Converter */
+#define PAPOUCH_AP485_2_PID 0x0104 /* AP485 USB-RS485 Converter */
+#define PAPOUCH_SB422_2_PID 0x0105 /* Papouch SB422 USB-RS422 Converter */
+#define PAPOUCH_SB485S_PID 0x0106 /* Papouch SB485S USB-485/422 Converter */
+#define PAPOUCH_SB485C_PID 0x0107 /* Papouch SB485C USB-485/422 Converter */
+#define PAPOUCH_LEC_PID 0x0300 /* LEC USB Converter */
+#define PAPOUCH_SB232_PID 0x0301 /* Papouch SB232 USB-RS232 Converter */
#define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
-#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Quido 4/4 Module */
+#define PAPOUCH_IRAMP_PID 0x0500 /* Papouch IRAmp Duplex */
+#define PAPOUCH_DRAK5_PID 0x0700 /* Papouch DRAK5 */
+#define PAPOUCH_QUIDO8x8_PID 0x0800 /* Papouch Quido 8/8 Module */
+#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Papouch Quido 4/4 Module */
+#define PAPOUCH_QUIDO2x2_PID 0x0a00 /* Papouch Quido 2/2 Module */
+#define PAPOUCH_QUIDO10x1_PID 0x0b00 /* Papouch Quido 10/1 Module */
+#define PAPOUCH_QUIDO30x3_PID 0x0c00 /* Papouch Quido 30/3 Module */
+#define PAPOUCH_QUIDO60x3_PID 0x0d00 /* Papouch Quido 60(100)/3 Module */
+#define PAPOUCH_QUIDO2x16_PID 0x0e00 /* Papouch Quido 2/16 Module */
+#define PAPOUCH_QUIDO3x32_PID 0x0f00 /* Papouch Quido 3/32 Module */
+#define PAPOUCH_DRAK6_PID 0x1000 /* Papouch DRAK6 */
+#define PAPOUCH_UPSUSB_PID 0x8000 /* Papouch UPS-USB adapter */
+#define PAPOUCH_MU_PID 0x8001 /* MU controller */
+#define PAPOUCH_SIMUKEY_PID 0x8002 /* Papouch SimuKey */
#define PAPOUCH_AD4USB_PID 0x8003 /* AD4USB Measurement Module */
+#define PAPOUCH_GMUX_PID 0x8004 /* Papouch GOLIATH MUX */
+#define PAPOUCH_GMSR_PID 0x8005 /* Papouch GOLIATH MSR */
/*
* Marvell SheevaPlug
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 246/260] USB: ftdi_sio: add device ids for ScienceScope
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (244 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 245/260] USB: ftdi_sio: new VID/PIDs for various Papouch devices Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 247/260] usb: musb: blackfin: call gpio_free() on error path in musb_platform_init() Paul Gortmaker
` (15 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Greg Kroah-Hartman, Kuba Ober, Paul Gortmaker
From: Greg Kroah-Hartman <gregkh@suse.de>
commit 0f266abd70cd83571eca019f764b5f1992da7361 upstream.
This adds the requested device ids to the ftdi_sio driver.
Reported-by: Ewan Bingham <ewan@auc.co.uk>
Cc: Kuba Ober <kuba@mareimbrium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/ftdi_sio.c | 3 +++
drivers/usb/serial/ftdi_sio_ids.h | 5 +++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index d2ea458..55ff244 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -797,6 +797,9 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) },
+ { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) },
{ }, /* Optional parameter entry */
{ } /* Terminating entry */
};
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index ff8a8ad..4addf78 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -1102,3 +1102,8 @@
* Accesio USB Data Acquisition products (http://www.accesio.com/)
*/
#define ACCESIO_COM4SM_PID 0xD578
+
+/* www.sciencescope.co.uk educational dataloggers */
+#define FTDI_SCIENCESCOPE_LOGBOOKML_PID 0xFF18
+#define FTDI_SCIENCESCOPE_LS_LOGBOOK_PID 0xFF1C
+#define FTDI_SCIENCESCOPE_HS_LOGBOOK_PID 0xFF1D
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 247/260] usb: musb: blackfin: call gpio_free() on error path in musb_platform_init()
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (245 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 246/260] USB: ftdi_sio: add device ids for ScienceScope Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 248/260] USB: option: Add more ZTE modem USB id's Paul Gortmaker
` (14 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Sergei Shtylyov, Felipe Balbi, Greg Kroah-Hartman,
Paul Gortmaker
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
commit 00be545e49d83485d49a598d3b7e090088934be8 upstream.
Blackfin's musb_platform_init() needs to call gpio_free() for error cleanup iff
otg_get_transceiver() call returns NULL.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/musb/blackfin.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index ec8d324..6a9e891 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -289,8 +289,10 @@ int __init musb_platform_init(struct musb *musb)
usb_nop_xceiv_register();
musb->xceiv = otg_get_transceiver();
- if (!musb->xceiv)
+ if (!musb->xceiv) {
+ gpio_free(musb->config->gpio_vrsel);
return -ENODEV;
+ }
if (ANOMALY_05000346) {
bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 248/260] USB: option: Add more ZTE modem USB id's
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (246 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 247/260] usb: musb: blackfin: call gpio_free() on error path in musb_platform_init() Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 249/260] USB: cp210x: Add Renesas RX-Stick device ID Paul Gortmaker
` (13 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Paul Gortmaker
From: Mauro Carvalho Chehab <mchehab@redhat.com>
commit ecfa153ef616b901e86d9a051b329fcda7a6ce7b upstream.
There are lots of ZTE USB id's currently not covered by usb/serial. Adds them,
to allow those devices to work properly on Linux.
While here, put the USB ID's for 0x2002/0x2003 at the sorted order.
This patch is based on zte.c file found on MF645.
PS.: The ZTE driver is commenting the USB ID for 0x0053. It also adds, commented,
an USB ID for 0x0026.
Not sure why, but I think that 0053 is used by their devices in storage mode only.
So, I opted to keep the comment on this patch.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/option.c | 23 ++++++++++++++++++++---
1 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 0e8abb5..0e94896 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -616,6 +616,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0011, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff) },
@@ -627,38 +628,52 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0023, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff) },
- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) },
+ /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0032, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0033, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0034, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0037, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0038, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0039, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0040, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0042, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0043, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0044, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0048, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0049, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0050, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff) },
+ /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0056, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0064, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0065, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0079, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0082, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0083, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) },
- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) },
- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0087, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0106, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0108, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff) },
@@ -874,6 +889,8 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 249/260] USB: cp210x: Add Renesas RX-Stick device ID
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (247 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 248/260] USB: option: Add more ZTE modem USB id's Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 250/260] USB: cp210x: Add WAGO 750-923 Service Cable " Paul Gortmaker
` (12 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, DJ Delorie, Greg Kroah-Hartman, Paul Gortmaker
From: DJ Delorie <dj@delorie.com>
commit 2f1136d1d08a63dcdbcd462621373f30d8dfe590 upstream.
RX610 development board by Renesas
Bus 001 Device 024: ID 045b:0053 Hitachi, Ltd
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x045b Hitachi, Ltd
idProduct 0x0053
bcdDevice 1.00
iManufacturer 1 Silicon Labs
iProduct 2 RX-Stick
iSerial 3 0001
. . .
http://am.renesas.com/rx610stick
Signed-off-by: DJ Delorie <dj@delorie.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/cp210x.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index c39349f..05f7f48 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -56,6 +56,7 @@ static int cp210x_carrier_raised(struct usb_serial_port *p);
static int debug;
static const struct usb_device_id id_table[] = {
+ { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */
{ USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
{ USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
{ USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 250/260] USB: cp210x: Add WAGO 750-923 Service Cable device ID
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (248 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 249/260] USB: cp210x: Add Renesas RX-Stick device ID Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 251/260] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled Paul Gortmaker
` (11 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Anders Larsen, Greg Kroah-Hartman, Paul Gortmaker
From: Anders Larsen <al@alarsen.net>
commit 93ad03d60b5b18897030038234aa2ebae8234748 upstream.
The WAGO 750-923 USB Service Cable is used for configuration and firmware
updates of several industrial automation products from WAGO Kontakttechnik GmbH.
Bus 004 Device 002: ID 1be3:07a6
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1be3
idProduct 0x07a6
bcdDevice 1.00
iManufacturer 1 Silicon Labs
iProduct 2 WAGO USB Service Cable
iSerial 3 1277796751
. . .
Signed-off-by: Anders Larsen <al@alarsen.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/cp210x.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 05f7f48..e85e325 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -134,6 +134,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
{ USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
+ { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
{ USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
{ } /* Terminating Entry */
};
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 251/260] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (249 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 250/260] USB: cp210x: Add WAGO 750-923 Service Cable " Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-05 18:59 ` Jean-Christophe PLAGNIOL-VILLARD
2011-01-02 7:19 ` [34-longterm 252/260] USB: disable endpoints after unbinding interfaces, not before Paul Gortmaker
` (10 subsequent siblings)
261 siblings, 1 reply; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Jean-Christophe PLAGNIOL-VILLARD, Nicolas Ferre,
Greg Kroah-Hartman, Paul Gortmaker
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
commit 969affff54702785330de553b790372e261e93f9 upstream.
to ensure gpio_is_valid return false
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/gadget/atmel_usba_udc.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 75a256f..8fd88e1 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -2015,6 +2015,9 @@ static int __init usba_udc_probe(struct platform_device *pdev)
} else {
disable_irq(gpio_to_irq(udc->vbus_pin));
}
+ } else {
+ /* gpio_request fail so use -EINVAL for gpio_is_valid */
+ ubc->vbus_pin = -EINVAL;
}
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 252/260] USB: disable endpoints after unbinding interfaces, not before
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (250 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 251/260] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 253/260] USB: opticon: Fix long-standing bugs in opticon driver Paul Gortmaker
` (9 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Alan Stern, Greg Kroah-Hartman, Paul Gortmaker
From: Alan Stern <stern@rowland.harvard.edu>
commit 80f0cf3947889014d3a3dc0ad60fb87cfda4b12a upstream.
This patch (as1430) fixes a bug in usbcore. When a device
configuration change occurs or a device is removed, the endpoints for
the old config should be completely disabled. However it turns out
they aren't; this is because usb_unbind_interface() calls
usb_enable_interface() or usb_set_interface() to put interfaces back
in altsetting 0, which re-enables the interfaces' endpoints.
As a result, when a device goes through a config change or is
unconfigured, the ep_in[] and ep_out[] arrays may be left holding old
pointers to usb_host_endpoint structures. If the device is
deauthorized these structures get freed, and the stale pointers cause
errors when the the device is eventually unplugged.
The solution is to disable the endpoints after unbinding the
interfaces instead of before. This isn't as large a change as it
sounds, since usb_unbind_interface() disables all the interface's
endpoints anyway before calling the driver's disconnect routine,
unless the driver claims to support "soft" unbind.
This fixes Bugzilla #19192. Thanks to "Tom" Lei Ming for diagnosing
the underlying cause of the problem.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Carsten Sommer <carsten_sommer@ymail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/core/message.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index ad1f359..559deec 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1155,13 +1155,6 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
{
int i;
- dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
- skip_ep0 ? "non-ep0" : "all");
- for (i = skip_ep0; i < 16; ++i) {
- usb_disable_endpoint(dev, i, true);
- usb_disable_endpoint(dev, i + USB_DIR_IN, true);
- }
-
/* getting rid of interfaces will disconnect
* any drivers bound to them (a key side effect)
*/
@@ -1191,6 +1184,13 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
if (dev->state == USB_STATE_CONFIGURED)
usb_set_device_state(dev, USB_STATE_ADDRESS);
}
+
+ dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
+ skip_ep0 ? "non-ep0" : "all");
+ for (i = skip_ep0; i < 16; ++i) {
+ usb_disable_endpoint(dev, i, true);
+ usb_disable_endpoint(dev, i + USB_DIR_IN, true);
+ }
}
/**
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 253/260] USB: opticon: Fix long-standing bugs in opticon driver
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (251 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 252/260] USB: disable endpoints after unbinding interfaces, not before Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 254/260] USB: accept some invalid ep0-maxpacket values Paul Gortmaker
` (8 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Alon Ziv, Alon Ziv, Greg Kroah-Hartman,
Paul Gortmaker
From: Alon Ziv <alon+git@nolaviz.org>
commit 97cd8dc4ca9a1a5efb2cc38758e01492e3b013e2 upstream.
The bulk-read callback had two bugs:
a) The bulk-in packet's leading two zeros were returned (and the two last
bytes truncated)
b) The wrong URB was transmitted for the second (and later) read requests,
causing further reads to return the entire packet (including leading
zeros)
Signed-off-by: Alon Ziv <alon-git@nolaviz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/serial/opticon.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index ed01f3b..9ff19c8 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -96,8 +96,8 @@ static void opticon_bulk_callback(struct urb *urb)
/* real data, send it to the tty layer */
tty = tty_port_tty_get(&port->port);
if (tty) {
- tty_insert_flip_string(tty, data,
- data_length);
+ tty_insert_flip_string(tty, data + 2,
+ data_length);
tty_flip_buffer_push(tty);
tty_kref_put(tty);
}
@@ -130,7 +130,7 @@ exit:
priv->bulk_address),
priv->bulk_in_buffer, priv->buffer_size,
opticon_bulk_callback, priv);
- result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
+ result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC);
if (result)
dev_err(&port->dev,
"%s - failed resubmitting read urb, error %d\n",
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 254/260] USB: accept some invalid ep0-maxpacket values
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (252 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 253/260] USB: opticon: Fix long-standing bugs in opticon driver Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 255/260] sd name space exhaustion causes system hang Paul Gortmaker
` (7 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Alan Stern, Greg Kroah-Hartman, Paul Gortmaker
From: Alan Stern <stern@rowland.harvard.edu>
commit 56626a72a47bf3e50875d960d6b5f17b9bee0ab2 upstream.
A few devices (such as the RCA VR5220 voice recorder) are so
non-compliant with the USB spec that they have invalid maxpacket sizes
for endpoint 0. Nevertheless, as long as we can safely use them, we
may as well do so.
This patch (as1432) softens our acceptance criterion by allowing
high-speed devices to have ep0-maxpacket sizes other than 64. A
warning is printed in the system log when this happens, and the
existing error message is clarified.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: James <bjlockie@lockie.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/usb/core/hub.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 3e28f92..5b63c45 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2848,13 +2848,16 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
else
i = udev->descriptor.bMaxPacketSize0;
if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) {
- if (udev->speed != USB_SPEED_FULL ||
+ if (udev->speed == USB_SPEED_LOW ||
!(i == 8 || i == 16 || i == 32 || i == 64)) {
- dev_err(&udev->dev, "ep0 maxpacket = %d\n", i);
+ dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", i);
retval = -EMSGSIZE;
goto fail;
}
- dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
+ if (udev->speed == USB_SPEED_FULL)
+ dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
+ else
+ dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
usb_ep0_reinit(udev);
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 255/260] sd name space exhaustion causes system hang
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (253 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 254/260] USB: accept some invalid ep0-maxpacket values Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 256/260] libsas: fix NCQ mixing with non-NCQ Paul Gortmaker
` (6 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Michael Reed, James Bottomley, Paul Gortmaker
From: Michael Reed <mdr@sgi.com>
commit 1a03ae0f556a931aa3747b70e44b78308f5b0590 upstream.
Following a site power outage which re-enabled all the ports on my FC
switches, my system subsequently booted with far too many luns! I had
let it run hoping it would make multi-user. It didn't. :( It hung solid
after exhausting the last sd device, sdzzz, and attempting to create sdaaaa
and beyond. I was unable to get a dump.
Discovered using a 2.6.32.13 based system.
correct this by detecting when the last index is utilized and failing
the sd probe of the device. Patch applies to scsi-misc-2.6.
Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/scsi/sd.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index de6c603..892f446 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2163,11 +2163,10 @@ static void sd_probe_async(void *data, async_cookie_t cookie)
index = sdkp->index;
dev = &sdp->sdev_gendev;
- if (index < SD_MAX_DISKS) {
- gd->major = sd_major((index & 0xf0) >> 4);
- gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
- gd->minors = SD_MINORS;
- }
+ gd->major = sd_major((index & 0xf0) >> 4);
+ gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
+ gd->minors = SD_MINORS;
+
gd->fops = &sd_fops;
gd->private_data = &sdkp->driver;
gd->queue = sdkp->device->request_queue;
@@ -2256,6 +2255,12 @@ static int sd_probe(struct device *dev)
if (error)
goto out_put;
+ if (index >= SD_MAX_DISKS) {
+ error = -ENODEV;
+ sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name space exhausted.\n");
+ goto out_free_index;
+ }
+
error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN);
if (error)
goto out_free_index;
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 256/260] libsas: fix NCQ mixing with non-NCQ
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (254 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 255/260] sd name space exhaustion causes system hang Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 257/260] gdth: integer overflow in ioctl Paul Gortmaker
` (5 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, David Milburn, James Bottomley, Paul Gortmaker
From: David Milburn <dmilburn@redhat.com>
commit f0ad30d3d2dc924decc0e10b1ff6dc32525a5d99 upstream.
Some cards (like mvsas) have issue troubles if non-NCQ commands are
mixed with NCQ ones. Fix this by using the libata default NCQ check
routine which waits until all NCQ commands are complete before issuing
a non-NCQ one. The impact to cards (like aic94xx) which don't need
this logic should be minimal
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/scsi/libsas/sas_ata.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 8c496b5..fb78856 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -347,6 +347,7 @@ static int sas_ata_scr_read(struct ata_link *link, unsigned int sc_reg_in,
static struct ata_port_operations sas_sata_ops = {
.phy_reset = sas_ata_phy_reset,
.post_internal_cmd = sas_ata_post_internal,
+ .qc_defer = ata_std_qc_defer,
.qc_prep = ata_noop_qc_prep,
.qc_issue = sas_ata_qc_issue,
.qc_fill_rtf = sas_ata_qc_fill_rtf,
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 257/260] gdth: integer overflow in ioctl
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (255 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 256/260] libsas: fix NCQ mixing with non-NCQ Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 258/260] Fix race when removing SCSI devices Paul Gortmaker
` (4 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Dan Carpenter, James Bottomley, Paul Gortmaker
From: Dan Carpenter <error27@gmail.com>
commit f63ae56e4e97fb12053590e41a4fa59e7daa74a4 upstream.
gdth_ioctl_alloc() takes the size variable as an int.
copy_from_user() takes the size variable as an unsigned long.
gen.data_len and gen.sense_len are unsigned longs.
On x86_64 longs are 64 bit and ints are 32 bit.
We could pass in a very large number and the allocation would truncate
the size to 32 bits and allocate a small buffer. Then when we do the
copy_from_user(), it would result in a memory corruption.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/scsi/gdth.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 35a4b30..a8da7e8 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -4175,6 +4175,14 @@ static int ioc_general(void __user *arg, char *cmnd)
ha = gdth_find_ha(gen.ionode);
if (!ha)
return -EFAULT;
+
+ if (gen.data_len > INT_MAX)
+ return -EINVAL;
+ if (gen.sense_len > INT_MAX)
+ return -EINVAL;
+ if (gen.data_len + gen.sense_len > INT_MAX)
+ return -EINVAL;
+
if (gen.data_len + gen.sense_len != 0) {
if (!(buf = gdth_ioctl_alloc(ha, gen.data_len + gen.sense_len,
FALSE, &paddr)))
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 258/260] Fix race when removing SCSI devices
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (256 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 257/260] gdth: integer overflow in ioctl Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 259/260] Fix regressions in scsi_internal_device_block Paul Gortmaker
` (3 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Christof Schmitt, James Bottomley, Paul Gortmaker
From: Christof Schmitt <christof.schmitt@de.ibm.com>
commit 546ae796bfac6399e30da4b5af2cf7a6d0f8a4ec upstream.
Removing SCSI devices through
echo 1 > /sys/bus/scsi/devices/ ... /delete
while the FC transport class removes the SCSI target can lead to an
oops:
Unable to handle kernel pointer dereference at virtual kernel address 00000000b6815000
Oops: 0011 [#1] PREEMPT SMP DEBUG_PAGEALLOC
Modules linked in: sunrpc qeth_l3 binfmt_misc dm_multipath scsi_dh dm_mod ipv6 qeth ccwgroup [last unloaded: scsi_wait_scan]
CPU: 1 Not tainted 2.6.35.5-45.x.20100924-s390xdefault #1
Process fc_wq_0 (pid: 861, task: 00000000b7331240, ksp: 00000000b735bac0)
Krnl PSW : 0704200180000000 00000000003ff6e4 (__scsi_remove_device+0x24/0xd0)
R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:2 PM:0 EA:3
Krnl GPRS: 0000000000000001 0000000000000000 00000000b6815000 00000000bc24a8c0
00000000003ff7c8 000000000056dbb8 0000000000000002 0000000000835d80
ffffffff00000000 0000000000001000 00000000b6815000 00000000bc24a7f0
00000000b68151a0 00000000b6815000 00000000b735bc20 00000000b735bbf8
Krnl Code: 00000000003ff6d6: a7840001 brc 8,3ff6d8
00000000003ff6da: a7fbffd8 aghi %r15,-40
00000000003ff6de: e3e0f0980024 stg %r14,152(%r15)
>00000000003ff6e4: e31021200004 lg %r1,288(%r2)
00000000003ff6ea: a71f0000 cghi %r1,0
00000000003ff6ee: a7a40011 brc 10,3ff710
00000000003ff6f2: a7390003 lghi %r3,3
00000000003ff6f6: c0e5ffffc8b1 brasl %r14,3f8858
Call Trace:
([<0000000000001000>] 0x1000)
[<00000000003ff7d2>] scsi_remove_device+0x42/0x54
[<00000000003ff8ba>] __scsi_remove_target+0xca/0xfc
[<00000000003ff99a>] __remove_child+0x3a/0x48
[<00000000003e3246>] device_for_each_child+0x72/0xbc
[<00000000003ff93a>] scsi_remove_target+0x4e/0x74
[<0000000000406586>] fc_rport_final_delete+0xb2/0x23c
[<000000000015d080>] worker_thread+0x200/0x344
[<000000000016330c>] kthread+0xa0/0xa8
[<0000000000106c1a>] kernel_thread_starter+0x6/0xc
[<0000000000106c14>] kernel_thread_starter+0x0/0xc
INFO: lockdep is turned off.
Last Breaking-Event-Address:
[<00000000003ff7cc>] scsi_remove_device+0x3c/0x54
The function __scsi_remove_target iterates through the SCSI devices on
the host, but it drops the host_lock before calling
scsi_remove_device. When the SCSI device is deleted from another
thread, the pointer to the SCSI device in scsi_remove_device can
become invalid. Fix this by getting a reference to the SCSI device
before dropping the host_lock to keep the SCSI device alive for the
call to scsi_remove_device.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/scsi/scsi_sysfs.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 429c9b7..02be251 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -993,10 +993,11 @@ static void __scsi_remove_target(struct scsi_target *starget)
list_for_each_entry(sdev, &shost->__devices, siblings) {
if (sdev->channel != starget->channel ||
sdev->id != starget->id ||
- sdev->sdev_state == SDEV_DEL)
+ scsi_device_get(sdev))
continue;
spin_unlock_irqrestore(shost->host_lock, flags);
scsi_remove_device(sdev);
+ scsi_device_put(sdev);
spin_lock_irqsave(shost->host_lock, flags);
goto restart;
}
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 259/260] Fix regressions in scsi_internal_device_block
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (257 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 258/260] Fix race when removing SCSI devices Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 260/260] sgi-xp: incoming XPC channel messages can come in after the channel's partition structures have been torn down Paul Gortmaker
` (2 subsequent siblings)
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Mike Christie, Christof Schmitt, James Bottomley,
Paul Gortmaker
From: Mike Christie <michaelc@cs.wisc.edu>
commit 986fe6c7f50974e871b8ab5a800f5310ea25b361 upstream.
Deleting a SCSI device on a blocked fc_remote_port (before
fast_io_fail_tmo fires) results in a hanging thread:
STACK:
0 schedule+1108 [0x5cac48]
1 schedule_timeout+528 [0x5cb7fc]
2 wait_for_common+266 [0x5ca6be]
3 blk_execute_rq+160 [0x354054]
4 scsi_execute+324 [0x3b7ef4]
5 scsi_execute_req+162 [0x3b80ca]
6 sd_sync_cache+138 [0x3cf662]
7 sd_shutdown+138 [0x3cf91a]
8 sd_remove+112 [0x3cfe4c]
9 __device_release_driver+124 [0x3a08b8]
10 device_release_driver+60 [0x3a0a5c]
11 bus_remove_device+266 [0x39fa76]
12 device_del+340 [0x39d818]
13 __scsi_remove_device+204 [0x3bcc48]
14 scsi_remove_device+66 [0x3bcc8e]
15 sysfs_schedule_callback_work+50 [0x260d66]
16 worker_thread+622 [0x162326]
17 kthread+160 [0x1680b0]
18 kernel_thread_starter+6 [0x10aaea]
During the delete, the SCSI device is in moved to SDEV_CANCEL. When
the FC transport class later calls scsi_target_unblock, this has no
effect, since scsi_internal_device_unblock ignores SCSI devics in this
state.
It looks like all these are regressions caused by:
5c10e63c943b4c67561ddc6bf61e01d4141f881f
[SCSI] limit state transitions in scsi_internal_device_unblock
Fix by rejecting offline and cancel in the state transition.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
[jejb: Original patch by Christof Schmitt, modified by Mike Christie]
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/scsi/scsi_lib.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 1646fe7..9cc450b 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2436,7 +2436,8 @@ scsi_internal_device_unblock(struct scsi_device *sdev)
sdev->sdev_state = SDEV_RUNNING;
else if (sdev->sdev_state == SDEV_CREATED_BLOCK)
sdev->sdev_state = SDEV_CREATED;
- else
+ else if (sdev->sdev_state != SDEV_CANCEL &&
+ sdev->sdev_state != SDEV_OFFLINE)
return -EINVAL;
spin_lock_irqsave(q->queue_lock, flags);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* [34-longterm 260/260] sgi-xp: incoming XPC channel messages can come in after the channel's partition structures have been torn down
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (258 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 259/260] Fix regressions in scsi_internal_device_block Paul Gortmaker
@ 2011-01-02 7:19 ` Paul Gortmaker
2011-01-02 7:57 ` [34-longterm 000/260] v2.6.34.8 longterm review Ted Ts'o
2011-01-03 10:41 ` Jiri Slaby
261 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 7:19 UTC (permalink / raw)
To: stable, linux-kernel
Cc: stable-review, Robin Holt, Andrew Morton, Linus Torvalds,
Paul Gortmaker
From: Robin Holt <holt@sgi.com>
commit 09358972bff5ce99de496bbba97c85d417b3c054 upstream.
Under some workloads, some channel messages have been observed being
delayed on the sending side past the point where the receiving side has
been able to tear down its partition structures.
This condition is already detected in xpc_handle_activate_IRQ_uv(), but
that information is not given to xpc_handle_activate_mq_msg_uv(). As a
result, xpc_handle_activate_mq_msg_uv() assumes the structures still exist
and references them, causing a NULL-pointer deref.
Signed-off-by: Robin Holt <holt@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/misc/sgi-xp/xpc_uv.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
index 1f59ee2..17bbacb 100644
--- a/drivers/misc/sgi-xp/xpc_uv.c
+++ b/drivers/misc/sgi-xp/xpc_uv.c
@@ -417,6 +417,7 @@ xpc_process_activate_IRQ_rcvd_uv(void)
static void
xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
struct xpc_activate_mq_msghdr_uv *msg_hdr,
+ int part_setup,
int *wakeup_hb_checker)
{
unsigned long irq_flags;
@@ -481,6 +482,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
case XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREQUEST_UV: {
struct xpc_activate_mq_msg_chctl_closerequest_uv *msg;
+ if (!part_setup)
+ break;
+
msg = container_of(msg_hdr, struct
xpc_activate_mq_msg_chctl_closerequest_uv,
hdr);
@@ -497,6 +501,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
case XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREPLY_UV: {
struct xpc_activate_mq_msg_chctl_closereply_uv *msg;
+ if (!part_setup)
+ break;
+
msg = container_of(msg_hdr, struct
xpc_activate_mq_msg_chctl_closereply_uv,
hdr);
@@ -511,6 +518,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREQUEST_UV: {
struct xpc_activate_mq_msg_chctl_openrequest_uv *msg;
+ if (!part_setup)
+ break;
+
msg = container_of(msg_hdr, struct
xpc_activate_mq_msg_chctl_openrequest_uv,
hdr);
@@ -528,6 +538,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREPLY_UV: {
struct xpc_activate_mq_msg_chctl_openreply_uv *msg;
+ if (!part_setup)
+ break;
+
msg = container_of(msg_hdr, struct
xpc_activate_mq_msg_chctl_openreply_uv, hdr);
args = &part->remote_openclose_args[msg->ch_number];
@@ -545,6 +558,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENCOMPLETE_UV: {
struct xpc_activate_mq_msg_chctl_opencomplete_uv *msg;
+ if (!part_setup)
+ break;
+
msg = container_of(msg_hdr, struct
xpc_activate_mq_msg_chctl_opencomplete_uv, hdr);
spin_lock_irqsave(&part->chctl_lock, irq_flags);
@@ -621,6 +637,7 @@ xpc_handle_activate_IRQ_uv(int irq, void *dev_id)
part_referenced = xpc_part_ref(part);
xpc_handle_activate_mq_msg_uv(part, msg_hdr,
+ part_referenced,
&wakeup_hb_checker);
if (part_referenced)
xpc_part_deref(part);
--
1.7.3.3
^ permalink raw reply related [flat|nested] 272+ messages in thread
* Re: [34-longterm 000/260] v2.6.34.8 longterm review
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (259 preceding siblings ...)
2011-01-02 7:19 ` [34-longterm 260/260] sgi-xp: incoming XPC channel messages can come in after the channel's partition structures have been torn down Paul Gortmaker
@ 2011-01-02 7:57 ` Ted Ts'o
2011-01-02 10:46 ` Paul Gortmaker
2011-01-03 10:41 ` Jiri Slaby
261 siblings, 1 reply; 272+ messages in thread
From: Ted Ts'o @ 2011-01-02 7:57 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: stable, linux-kernel, stable-review
On Sun, Jan 02, 2011 at 02:14:56AM -0500, Paul Gortmaker wrote:
> This is the start of the longterm review cycle for the v2.6.34.8 release.
> There are 260 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let us know. If anyone is a maintainer of the proper subsystem, and
> wants to add a Signed-off-by: line to the patch, please respond with it.
Are these patches going to show up at the 2.6.34 longterm patch queue?
git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.34.git
According to gitweb this tree hasn't been updated in 4 weeks.
Thanks,
- Ted
^ permalink raw reply [flat|nested] 272+ messages in thread
* 2.6.37-rc7: screen black after several suspends
@ 2011-01-02 10:17 ` Nico Schottelius
2011-01-03 8:03 ` [34-longterm 078/260] x86, tsc: Fix a preemption leak in restore_sched_clock_state() Nico Schottelius
2011-01-13 15:09 ` 2.6.37-rc7: screen black after several suspends Nico Schottelius
0 siblings, 2 replies; 272+ messages in thread
From: Nico Schottelius @ 2011-01-02 10:17 UTC (permalink / raw)
To: LKML; +Cc: Nico Schottelius
[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]
Good morning guys,
with 2.6.37-rc7 automatic wifi reconnect works, but after several
suspend and resume issues the screen stays black. I am running
Linux on the Lenovo X201, Intel graphics card [0].
Earlier kernel versions (around 2.6.35, iirc) sometimes allowed me
to restore it by switching away from X to the console, which stopped
working broken display (weired characters everywhere) after some time.
With 2.6.37-rc7 this does not work. After about 4-5 suspends the screen
stays black, the machine is still working otherwise (i.e. rebooting
it works fine).
It seems there's a long ongoing problem restoring the display,
seeing it in various forms (including freeze) in at least
* 2.6.27-rc1-00156-g94ad374,
* 2.6.28-next-20090107-ikn
* 2.6.28-ikn-06859-gede6f5a
* 2.6.28-rc9-wl-ikn-24949-ge98df74
* 2.6.29-rc4-58-g4c098bc,
* 2.6.29-rc5-ikn-00168-gba95fd4
* 2.6.30-rc7
* 2.6.31-r2
* many many more, see messages from me to LKML
With some working version (just brighness related):
* 2.6.29-rc7-wl-ikn-32831-g98c5597
* 2.6.30-rc3-next-20090428-04067-g72f1b63
I'm wondering whether there
a) is one bug coming up again and not really fixed
b) are many bugs, just parts fixed
c) new bugs are introduced quite often
In any case, I downgraded to 2.6.36-ARCH, which works fine related to
brightness and suspend/resume.
Cheers,
Nico
[0] 00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02).
--
PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: [34-longterm 000/260] v2.6.34.8 longterm review
2011-01-02 7:57 ` [34-longterm 000/260] v2.6.34.8 longterm review Ted Ts'o
@ 2011-01-02 10:46 ` Paul Gortmaker
0 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-02 10:46 UTC (permalink / raw)
To: Ted Ts'o; +Cc: stable, linux-kernel, stable-review
[Re: [34-longterm 000/260] v2.6.34.8 longterm review] On 02/01/2011 (Sun 02:57) Ted Ts'o wrote:
> On Sun, Jan 02, 2011 at 02:14:56AM -0500, Paul Gortmaker wrote:
> > This is the start of the longterm review cycle for the v2.6.34.8 release.
> > There are 260 patches in this series, all will be posted as a response
> > to this one. If anyone has any issues with these being applied, please
> > let us know. If anyone is a maintainer of the proper subsystem, and
> > wants to add a Signed-off-by: line to the patch, please respond with it.
>
> Are these patches going to show up at the 2.6.34 longterm patch queue?
>
> git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.34.git
Thanks Ted -- I've pushed several updates to the above queue repo.
Paul.
>
> According to gitweb this tree hasn't been updated in 4 weeks.
>
> Thanks,
>
> - Ted
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: [34-longterm 078/260] x86, tsc: Fix a preemption leak in restore_sched_clock_state()
2011-01-02 10:17 ` 2.6.37-rc7: screen black after several suspends Nico Schottelius
@ 2011-01-03 8:03 ` Nico Schottelius
2011-01-13 15:09 ` 2.6.37-rc7: screen black after several suspends Nico Schottelius
1 sibling, 0 replies; 272+ messages in thread
From: Nico Schottelius @ 2011-01-03 8:03 UTC (permalink / raw)
To: Paul Gortmaker
Cc: stable, linux-kernel, stable-review, Peter Zijlstra,
Peter Zijlstra, Rafael J. Wysocki, Nico Schottelius, Jesse Barnes,
Linus Torvalds, Florian Pritz, Suresh Siddha, Len Brown,
Ingo Molnar
[-- Attachment #1: Type: text/plain, Size: 960 bytes --]
Good morning,
Paul Gortmaker [Sun, Jan 02, 2011 at 02:16:14AM -0500]:
> From: Peter Zijlstra <peterz@infradead.org>
>
> commit 55496c896b8a695140045099d4e0175cf09d4eae upstream.
>
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index c65f741..4094ae0 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -655,7 +655,7 @@ void restore_sched_clock_state(void)
>
> local_irq_save(flags);
>
> - get_cpu_var(cyc2ns_offset) = 0;
> + __get_cpu_var(cyc2ns_offset) = 0;
> offset = cyc2ns_suspend - sched_clock();
If I see that correctly, this has already been merged before
2.6.37-rc7. As 2.6.37-rc7 again has the dark screen issue [0]
I assume this does not fix this issue.
I am compiling v2.6.37-rc8-33-gb518a64 right now, to give it
a try.
Cheers,
Nico
[0]: Subject: 2.6.37-rc7: screen black after several suspends
--
PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: [34-longterm 000/260] v2.6.34.8 longterm review
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
` (260 preceding siblings ...)
2011-01-02 7:57 ` [34-longterm 000/260] v2.6.34.8 longterm review Ted Ts'o
@ 2011-01-03 10:41 ` Jiri Slaby
2011-01-04 19:11 ` Paul Gortmaker
261 siblings, 1 reply; 272+ messages in thread
From: Jiri Slaby @ 2011-01-03 10:41 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: stable, linux-kernel, stable-review
On 01/02/2011 08:14 AM, Paul Gortmaker wrote:
> This is the start of the longterm review cycle for the v2.6.34.8 release.
> There are 260 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let us know. If anyone is a maintainer of the proper subsystem, and
> wants to add a Signed-off-by: line to the patch, please respond with it.
Hi, although I'm neither of that, I'm missing tty fixes. Please see:
https://lkml.org/lkml/2010/11/29/508
and add the three in the next round.
thanks,
--
js
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: [34-longterm 000/260] v2.6.34.8 longterm review
2011-01-03 10:41 ` Jiri Slaby
@ 2011-01-04 19:11 ` Paul Gortmaker
2011-01-06 12:47 ` Jiri Slaby
0 siblings, 1 reply; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-04 19:11 UTC (permalink / raw)
To: Jiri Slaby; +Cc: stable, linux-kernel, stable-review
[Re: [34-longterm 000/260] v2.6.34.8 longterm review] On 03/01/2011 (Mon 11:41) Jiri Slaby wrote:
> On 01/02/2011 08:14 AM, Paul Gortmaker wrote:
> > This is the start of the longterm review cycle for the v2.6.34.8 release.
> > There are 260 patches in this series, all will be posted as a response
> > to this one. If anyone has any issues with these being applied, please
> > let us know. If anyone is a maintainer of the proper subsystem, and
> > wants to add a Signed-off-by: line to the patch, please respond with it.
>
> Hi, although I'm neither of that, I'm missing tty fixes. Please see:
> https://lkml.org/lkml/2010/11/29/508
For some reason lkml.org won't show me that link currently, but I've got
these patches already queued for the next round as part of watching what
Greg added to the 27 release of 32-longterm.
--------------
longterm-queue-2.6.34$grep -l Jiri next_round/*
next_round/HID-hidraw-fix-a-NULL-pointer-dereference-in-hidraw_2.patch
next_round/HID-hidraw-fix-a-NULL-pointer-dereference-in-hidraw_.patch
next_round/hpet-unmap-unused-I-O-space.patch
next_round/TTY-ldisc-fix-open-flag-handling.patch
next_round/tty-prevent-DOS-in-the-flush_to_ldisc.patch
next_round/TTY-restore-tty_ldisc_wait_idle.patch
next_round/USB-gadget-AT91-fix-typo-in-atmel_usba_udc-driver.patch
longterm-queue-2.6.34$
--------------
If you want to look around at what else is in "next_round" you can grab
the queue from:
git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.34.git
Let me know if you still think something is missing, and/or call out the
upstream commit IDs explicitly and I'll do the right thing.
Thanks,
Paul.
> and add the three in the next round.
>
> thanks,
> --
> js
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: [34-longterm 251/260] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled
2011-01-02 7:19 ` [34-longterm 251/260] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled Paul Gortmaker
@ 2011-01-05 18:59 ` Jean-Christophe PLAGNIOL-VILLARD
2011-01-05 21:29 ` Paul Gortmaker
0 siblings, 1 reply; 272+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-01-05 18:59 UTC (permalink / raw)
To: Paul Gortmaker
Cc: stable, linux-kernel, stable-review, Nicolas Ferre,
Greg Kroah-Hartman
On 02:19 Sun 02 Jan , Paul Gortmaker wrote:
> From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>
> commit 969affff54702785330de553b790372e261e93f9 upstream.
>
> to ensure gpio_is_valid return false
>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> drivers/usb/gadget/atmel_usba_udc.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
> index 75a256f..8fd88e1 100644
> --- a/drivers/usb/gadget/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/atmel_usba_udc.c
> @@ -2015,6 +2015,9 @@ static int __init usba_udc_probe(struct platform_device *pdev)
> } else {
> disable_irq(gpio_to_irq(udc->vbus_pin));
> }
> + } else {
> + /* gpio_request fail so use -EINVAL for gpio_is_valid */
> + ubc->vbus_pin = -EINVAL;
there is a typo here
please change to
udc->vbus_pin = -EINVAL;
Best Regards,
J.
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: [34-longterm 251/260] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled
2011-01-05 18:59 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-01-05 21:29 ` Paul Gortmaker
0 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-05 21:29 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: stable, linux-kernel, stable-review, Nicolas Ferre,
Greg Kroah-Hartman
[Re: [34-longterm 251/260] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled] On 05/01/2011 (Wed 19:59) Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 02:19 Sun 02 Jan , Paul Gortmaker wrote:
> > From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >
> > commit 969affff54702785330de553b790372e261e93f9 upstream.
> >
> > to ensure gpio_is_valid return false
> >
> > Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> > drivers/usb/gadget/atmel_usba_udc.c | 3 +++
> > 1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
> > index 75a256f..8fd88e1 100644
> > --- a/drivers/usb/gadget/atmel_usba_udc.c
> > +++ b/drivers/usb/gadget/atmel_usba_udc.c
> > @@ -2015,6 +2015,9 @@ static int __init usba_udc_probe(struct platform_device *pdev)
> > } else {
> > disable_irq(gpio_to_irq(udc->vbus_pin));
> > }
> > + } else {
> > + /* gpio_request fail so use -EINVAL for gpio_is_valid */
> > + ubc->vbus_pin = -EINVAL;
> there is a typo here
> please change to
> udc->vbus_pin = -EINVAL;
Thanks -- I see I had the upstream typo fix (b488095186318) already
queued up in next_round; but it looks like it needs to be dragged back
into this round.
I'll go do that now.
Paul.
>
> Best Regards,
> J.
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: [34-longterm 000/260] v2.6.34.8 longterm review
2011-01-04 19:11 ` Paul Gortmaker
@ 2011-01-06 12:47 ` Jiri Slaby
2011-01-06 15:53 ` Paul Gortmaker
0 siblings, 1 reply; 272+ messages in thread
From: Jiri Slaby @ 2011-01-06 12:47 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: stable, linux-kernel, stable-review, Andi Kleen, Greg KH
CCing:
gregkh (32-stable)
ak (35-stable)
On 01/04/2011 08:11 PM, Paul Gortmaker wrote:
> If you want to look around at what else is in "next_round" you can grab
> the queue from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.34.git
>
> Let me know if you still think something is missing, and/or call out the
> upstream commit IDs explicitly and I'll do the right thing.
Hi,
e2efafbf139d2bfdfe96f2901f03189fecd172e4
is still missing (I've just checked SLE11SP1 and openSUSE 11.3, which is
based on .32 and .34 respectively and the problem is easily reproducible
there). It is trivial to be backported.
thanks,
--
js
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: [34-longterm 000/260] v2.6.34.8 longterm review
2011-01-06 12:47 ` Jiri Slaby
@ 2011-01-06 15:53 ` Paul Gortmaker
0 siblings, 0 replies; 272+ messages in thread
From: Paul Gortmaker @ 2011-01-06 15:53 UTC (permalink / raw)
To: Jiri Slaby; +Cc: stable, linux-kernel, stable-review, Andi Kleen, Greg KH
[Re: [34-longterm 000/260] v2.6.34.8 longterm review] On 06/01/2011 (Thu 13:47) Jiri Slaby wrote:
> CCing:
> gregkh (32-stable)
> ak (35-stable)
>
> On 01/04/2011 08:11 PM, Paul Gortmaker wrote:
> > If you want to look around at what else is in "next_round" you can grab
> > the queue from:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.34.git
> >
> > Let me know if you still think something is missing, and/or call out the
> > upstream commit IDs explicitly and I'll do the right thing.
>
> Hi,
> e2efafbf139d2bfdfe96f2901f03189fecd172e4
> is still missing (I've just checked SLE11SP1 and openSUSE 11.3, which is
> based on .32 and .34 respectively and the problem is easily reproducible
> there). It is trivial to be backported.
Thanks, it does look like a candidate for adding to next_round.
P.
>
> thanks,
> --
> js
^ permalink raw reply [flat|nested] 272+ messages in thread
* Re: 2.6.37-rc7: screen black after several suspends
2011-01-02 10:17 ` 2.6.37-rc7: screen black after several suspends Nico Schottelius
2011-01-03 8:03 ` [34-longterm 078/260] x86, tsc: Fix a preemption leak in restore_sched_clock_state() Nico Schottelius
@ 2011-01-13 15:09 ` Nico Schottelius
1 sibling, 0 replies; 272+ messages in thread
From: Nico Schottelius @ 2011-01-13 15:09 UTC (permalink / raw)
To: Nico Schottelius, LKML
[-- Attachment #1: Type: text/plain, Size: 498 bytes --]
Hey devs,
Just for the record:
Some tens of SUCCESSFUL suspends & wakeups on 2.6.37-rc8-00033-gb518a64.
Xorg crashed once (black screen, not recoverable with tty switching),
restarted it, still works. Even with some lazy umounted nfs mounts,
even with LUKS devices / usb being used during suspend and removing
on wakeup.
This is probably the most stable kernel version I've seen in a long time!
Cheers,
Nico
--
PGP key: 7ED9 F7D3 6B10 81D7 0EC5 5C09 D7DC C8E4 3187 7DF0
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 272+ messages in thread
end of thread, other threads:[~2011-01-13 15:09 UTC | newest]
Thread overview: 272+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-02 7:14 [34-longterm 000/260] v2.6.34.8 longterm review Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 001/260] sctp: fix append error cause to ERROR chunk correctly Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 002/260] KEYS: Return more accurate error codes Paul Gortmaker
2011-01-02 7:14 ` [34-longterm 003/260] ath5k: drop warning on jumbo frames Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 004/260] ext4: check missed return value in ext4_sync_file() Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 005/260] ext4: fix memory leaks in error path handling of ext4_ext_zeroout() Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 006/260] ext4: Remove unnecessary call to ext4_get_group_desc() in mballoc Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 007/260] ext4: rename ext4_mb_release_desc() to ext4_mb_unload_buddy() Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 008/260] ext4: allow defrag (EXT4_IOC_MOVE_EXT) in 32bit compat mode Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 009/260] ext4: fix quota accounting in case of fallocate Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 010/260] ext4: don't return to userspace after freezing the fs with a mutex held Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 011/260] ext4: stop issuing discards if not supported by device Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 012/260] ext4: don't scan/accumulate more pages than mballoc will allocate Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 013/260] ext4: Do not zero out uninitialized extents beyond i_size Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 014/260] ext4: clean up inode bitmaps manipulation in ext4_free_inode Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 015/260] ext4: init statistics after journal recovery Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 016/260] ext4: Remove extraneous newlines in ext4_msg() calls Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 017/260] ext4: Prevent creation of files larger than RLIMIT_FSIZE using fallocate Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 018/260] ext4: check for a good block group before loading buddy pages Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 019/260] ext4: Show journal_checksum option Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 020/260] ext4: Use bitops to read/modify i_flags in struct ext4_inode_info Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 021/260] ext4: Avoid crashing on NULL ptr dereference on a filesystem error Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 022/260] ext4: Clear the EXT4_EOFBLOCKS_FL flag only when warranted Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 023/260] ext4: restart ext4_ext_remove_space() after transaction restart Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 024/260] ext4: Conditionally define compat ioctl numbers Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 025/260] ext4: Fix compat EXT4_IOC_ADD_GROUP Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 026/260] ext4: Make fsync sync new parent directories in no-journal mode Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 027/260] CIFS: Remove __exit mark from cifs_exit_dns_resolver() Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 028/260] ext4: fix freeze deadlock under IO Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 029/260] hwmon: (k8temp) Differentiate between AM2 and ASB1 Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 030/260] xen: handle events as edge-triggered Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 031/260] xen: use percpu interrupts for IPIs and VIRQs Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 032/260] ALSA: hda - Rename iMic to Int Mic on Lenovo NB0763 Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 033/260] sata_mv: fix broken DSM/TRIM support (v2) Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 034/260] x86, tsc, sched: Recompute cyc2ns_offset's during resume from sleep states Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 035/260] PCI: MSI: Remove unsafe and unnecessary hardware access Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 036/260] PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc() Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 037/260] staging: hv: Fix missing functions for net_device_ops Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 038/260] staging: hv: Fixed bounce kmap problem by using correct index Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 039/260] staging: hv: Fixed the value of the 64bit-hole inside ring buffer Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 040/260] staging: hv: Increased storvsc ringbuffer and max_io_requests Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 041/260] staging: hv: Fixed lockup problem with bounce_buffer scatter list Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 042/260] fuse: flush background queue on connection close Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 043/260] ath9k_hw: fix parsing of HT40 5 GHz CTLs Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 044/260] ocfs2: Fix incorrect checksum validation error Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 045/260] USB: ehci-ppc-of: problems in unwind Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 046/260] USB: Fix kernel oops with g_ether and Windows Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 047/260] USB: CP210x Add new device ID Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 048/260] USB: cp210x: Add B&G H3000 link cable ID Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 049/260] USB: ftdi_sio: Added custom PIDs for ChamSys products Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 050/260] usb: serial: mos7840: Add USB ID to support the B&B Electronics USOPTL4-2P Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 051/260] usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485 converters Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 052/260] USB: Expose vendor-specific ACM channel on Nokia 5230 Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 053/260] USB: cdc-acm: Adding second ACM channel support for various Nokia and one Samsung phones Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 054/260] USB: cdc-acm: Add pseudo modem without AT command capabilities Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 055/260] USB: cdc-acm: Fixing crash when ACM probing interfaces with no endpoint descriptors Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 056/260] ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open() Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 057/260] sysfs: checking for NULL instead of ERR_PTR Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 058/260] oprofile: fix crash when accessing freed task structs Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 059/260] oprofile, x86: fix init_sysfs error handling Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 060/260] oprofile, x86: fix init_sysfs() function stub Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 061/260] libata: skip EH autopsy and recovery during suspend Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 062/260] tracing: Fix a race in function profile Paul Gortmaker
2011-01-02 7:15 ` [34-longterm 063/260] tracing: Do not allow llseek to set_ftrace_filter Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 064/260] tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 065/260] irda: off by one Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 066/260] gcov: fix null-pointer dereference for certain module types Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 067/260] tmio_mmc: don't clear unhandled pending interrupts Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 068/260] mmc: fix the use of kunmap_atomic() in tmio_mmc.h Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 069/260] bounce: call flush_dcache_page() after bounce_copy_vec() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 070/260] kernel/groups.c: fix integer overflow in groups_search Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 071/260] binfmt_misc: fix binfmt_misc priority Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 072/260] Input: i8042 - fix device removal on unload Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 073/260] memory hotplug: fix next block calculation in is_removable Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 074/260] perf: Initialize callchains roots's childen hits Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 075/260] p54: fix tx feedback status flag check Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 076/260] ath5k: check return value of ieee80211_get_tx_rate Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 077/260] wireless extensions: fix kernel heap content leak Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 078/260] x86, tsc: Fix a preemption leak in restore_sched_clock_state() Paul Gortmaker
2011-01-02 10:17 ` 2.6.37-rc7: screen black after several suspends Nico Schottelius
2011-01-03 8:03 ` [34-longterm 078/260] x86, tsc: Fix a preemption leak in restore_sched_clock_state() Nico Schottelius
2011-01-13 15:09 ` 2.6.37-rc7: screen black after several suspends Nico Schottelius
2011-01-02 7:16 ` [34-longterm 079/260] x86-64, compat: Test %rax for the syscall number, not %eax Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 080/260] compat: Make compat_alloc_user_space() incorporate the access_ok() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 081/260] x86-64, compat: Retruncate rax after ia32 syscall entry tracing Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 082/260] sched: Kill the broken and deadlockable cpuset_lock/cpuset_cpus_allowed_locked code Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 083/260] sched: move_task_off_dead_cpu(): Take rq->lock around select_fallback_rq() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 084/260] sched: move_task_off_dead_cpu(): Remove retry logic Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 085/260] sched: sched_exec(): Remove the select_fallback_rq() logic Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 086/260] sched: _cpu_down(): Don't play with current->cpus_allowed Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 087/260] sched: Make select_fallback_rq() cpuset friendly Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 088/260] sched: Fix TASK_WAKING vs fork deadlock Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 089/260] sched: Optimize task_rq_lock() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 090/260] sched: Fix nr_uninterruptible count Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 091/260] sched: Fix rq->clock synchronization when migrating tasks Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 092/260] rcu: apply RCU protection to wake_affine() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 093/260] sched: Fix select_idle_sibling() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 094/260] sched: Pre-compute cpumask_weight(sched_domain_span(sd)) Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 095/260] sched: Fix select_idle_sibling() logic in select_task_rq_fair() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 096/260] ALSA: hda - Handle missing NID 0x1b on ALC259 codec Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 097/260] ALSA: hda - Handle pin NID 0x1a on ALC259/269 Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 098/260] arm: fix really nasty sigreturn bug Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 099/260] hwmon: (f75375s) Shift control mode to the correct bit position Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 100/260] hwmon: (f75375s) Do not overwrite values read from registers Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 101/260] apm_power: Add missing break statement Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 102/260] NFS: Fix a typo in nfs_sockaddr_match_ipaddr6 Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 103/260] SUNRPC: Fix race corrupting rpc upcall Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 104/260] i915: return -EFAULT if copy_to_user fails Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 105/260] " Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 106/260] drm/i915: Prevent double dpms on Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 107/260] drm: Only decouple the old_fb from the crtc is we call mode_set* Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 108/260] tun: Don't add sysfs attributes to devices without sysfs directories Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 109/260] USB: serial/mos*: prevent reading uninitialized stack memory Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 110/260] gro: fix different skb headrooms Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 111/260] gro: Re-fix " Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 112/260] irda: Correctly clean up self->ias_obj on irda_bind() failure Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 113/260] tcp: select(writefds) don't hang up when a peer close connection Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 114/260] tcp: Combat per-cpu skew in orphan tests Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 115/260] tcp: fix three tcp sysctls tuning Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 116/260] bridge: Clear IPCB before possible entry into IP stack Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 117/260] bridge: Clear INET control block of SKBs passed into ip_fragment() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 118/260] rds: fix a leak of kernel memory Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 119/260] tcp: Prevent overzealous packetization by SWS logic Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 120/260] UNIX: Do not loop forever at unix_autobind() Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 121/260] sparc64: Get rid of indirect p1275 PROM call buffer Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 122/260] drivers/net/usb/hso.c: prevent reading uninitialized memory Paul Gortmaker
2011-01-02 7:16 ` [34-longterm 123/260] drivers/net/cxgb3/cxgb3_main.c: prevent reading uninitialized stack memory Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 124/260] drivers/net/eql.c: " Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 125/260] bonding: correctly process non-linear skbs Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 126/260] Staging: vt6655: fix buffer overflow Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 127/260] net/llc: make opt unsigned in llc_ui_setsockopt() Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 128/260] pid: make setpgid() system call use RCU read-side critical section Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 129/260] sched: Fix user time incorrectly accounted as system time on 32-bit Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 130/260] oprofile: Add Support for Intel CPU Family 6 / Model 22 (Intel Celeron 540) Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 131/260] char: Mark /dev/zero and /dev/kmem as not capable of writeback Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 132/260] drivers/pci/intel-iommu.c: fix build with older gcc's Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 133/260] drivers/video/sis/sis_main.c: prevent reading uninitialized stack memory Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 134/260] percpu: fix pcpu_last_unit_cpu Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 135/260] aio: check for multiplication overflow in do_io_submit Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 136/260] inotify: send IN_UNMOUNT events Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 137/260] mptsas: fix hangs caused by ATA pass-through Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 138/260] ext4: Fix remaining racy updates of EXT4_I(inode)->i_flags Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 139/260] fix siglock Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 140/260] Optimize ticket spinlocks in fsys_rt_sigprocmask Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 141/260] KEYS: Fix RCU no-lock warning in keyctl_session_to_parent() Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 142/260] KEYS: Fix bug in keyctl_session_to_parent() if parent has no session keyring Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 143/260] xfs: prevent reading uninitialized stack memory Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 144/260] drivers/video/via/ioctl.c: " Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 145/260] AT91: change dma resource index Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 146/260] mm: page allocator: drain per-cpu lists after direct reclaim allocation fails Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 147/260] mm: page allocator: calculate a better estimate of NR_FREE_PAGES when memory is low and kswapd is awake Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 148/260] mm: page allocator: update free page counters after pages are placed on the free list Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 149/260] guard page for stacks that grow upwards Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 150/260] Fix unprotected access to task credentials in waitid() Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 151/260] sctp: Do not reset the packet during sctp_packet_config() Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 152/260] dasd: use correct label location for diag fba disks Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 153/260] hostap_pci: set dev->base_addr during probe Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 154/260] inotify: fix inotify oneshot support Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 155/260] MIPS: Quit using undefined behavior of ADDU in 64-bit atomic operations Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 156/260] MIPS: Set io_map_base for several PCI bridges lacking it Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 157/260] sis-agp: Remove SIS 760, handled by amd64-agp Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 158/260] alpha: Fix printk format errors Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 159/260] x86, cpu: After uncapping CPUID, re-run CPU feature detection Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 160/260] ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 161/260] ALSA: oxygen: fix analog capture on Claro halo cards Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 162/260] ALSA: hda - Add Dell Latitude E6400 model quirk Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 163/260] ALSA: prevent heap corruption in snd_ctl_new() Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 164/260] ALSA: rawmidi: fix oops (use after free) when unloading a driver module Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 165/260] USB: fix bug in initialization of interface minor numbers Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 166/260] usb: musb: gadget: fix kernel panic if using out ep with FIFO_TXRX style Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 167/260] usb: musb: gadget: restart request on clearing endpoint halt Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 168/260] oprofile: Add Support for Intel CPU Family 6 / Model 29 Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 169/260] RDMA/cxgb3: Turn off RX coalescing for iWARP connections Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 170/260] mmc: sdhci-s3c: fix NULL ptr access in sdhci_s3c_remove Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 171/260] x86/amd-iommu: Set iommu configuration flags in enable-loop Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 172/260] x86/amd-iommu: Fix rounding-bug in __unmap_single Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 173/260] x86/amd-iommu: Work around S3 BIOS bug Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 174/260] tracing/x86: Don't use mcount in pvclock.c Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 175/260] tracing/x86: Don't use mcount in kvmclock.c Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 176/260] v4l1: fix 32-bit compat microcode loading translation Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 177/260] V4L/DVB: cx231xx: Avoid an OOPS when card is unknown (card=0) Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 178/260] Input: joydev - fix JSIOCSAXMAP ioctl Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 179/260] x86, hpet: Fix bogus error check in hpet_assign_irq() Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 180/260] x86, irq: Plug memory leak in sparse irq Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 181/260] ubd: fix incorrect sector handling during request restart Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 182/260] ring-buffer: Fix typo of time extends per page Paul Gortmaker
2011-01-02 7:17 ` [34-longterm 183/260] dmaengine: fix interrupt clearing for mv_xor Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 184/260] hrtimer: Preserve timer state in remove_hrtimer() Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 185/260] i2c-pca: Fix waitforcompletion() return value Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 186/260] ocfs2: Don't walk off the end of fast symlinks Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 187/260] wext: fix potential private ioctl memory content leak Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 188/260] atl1: fix resume Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 189/260] x86, AMD, MCE thresholding: Fix the MCi_MISCj iteration order Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 190/260] De-pessimize rds_page_copy_user Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 191/260] drm/radeon: fix PCI ID 5657 to be an RV410 Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 192/260] xfrm4: strip ECN bits from tos field Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 193/260] tcp: Fix >4GB writes on 64-bit Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 194/260] net: Fix the condition passed to sk_wait_event() Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 195/260] Phonet: Correct header retrieval after pskb_may_pull Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 196/260] net: Fix IPv6 PMTU disc. w/ asymmetric routes Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 197/260] ip: fix truesize mismatch in ip fragmentation Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 198/260] net: clear heap allocations for privileged ethtool actions Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 199/260] tcp: Fix race in tcp_poll Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 200/260] netxen: dont set skb->truesize Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 201/260] rose: Fix signedness issues wrt. digi count Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 202/260] net: blackhole route should always be recalculated Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 203/260] skge: add quirk to limit DMA Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 204/260] r8169: allocate with GFP_KERNEL flag when able to sleep Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 205/260] bsg: fix incorrect device_status value Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 206/260] powerpc: Initialise paca->kstack before early_setup_secondary Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 207/260] powerpc: Don't use kernel stack with translation off Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 208/260] b44: fix carrier detection on bind Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 209/260] ACPI: enable repeated PCIEXP wakeup by clearing PCIEXP_WAKE_STS on resume Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 210/260] intel_idle: PCI quirk to prevent Lenovo Ideapad s10-3 boot hang Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 211/260] ACPI: EC: add Vista incompatibility DMI entry for Toshiba Satellite L355 Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 212/260] ACPI: delete ZEPTO idle=nomwait DMI quirk Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 213/260] ACPI: Disable Windows Vista compatibility for Toshiba P305D Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 214/260] x86: detect scattered cpuid features earlier Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 215/260] setup_arg_pages: diagnose excessive argument size Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 216/260] execve: improve interactivity with large arguments Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 217/260] execve: make responsive to SIGKILL " Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 218/260] mm: Move vma_stack_continue into mm.h Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 219/260] staging: usbip: Notify usb core of port status changes Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 220/260] staging: usbip: Process event flags without delay Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 221/260] powerpc/perf: Fix sampling enable for PPC970 Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 222/260] pcmcia: synclink_cs: fix information leak to userland Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 223/260] sched: Fix string comparison in /proc/sched_features Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 224/260] bluetooth: Fix missing NULL check Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 225/260] futex: Fix errors in nested key ref-counting Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 226/260] mm, x86: Saving vmcore with non-lazy freeing of vmas Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 227/260] x86, cpu: Fix renamed, not-yet-shipping AMD CPUID feature bit Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 228/260] x86, kexec: Make sure to stop all CPUs before exiting the kernel Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 229/260] x86, olpc: Don't retry EC commands forever Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 230/260] x86, mtrr: Assume SYS_CFG[Tom2ForceMemTypeWB] exists on all future AMD CPUs Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 231/260] x86, intr-remap: Set redirection hint in the IRTE Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 232/260] x86, kdump: Change copy_oldmem_page() to use cached addressing Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 233/260] KVM: MMU: fix direct sp's access corrupted Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 234/260] KVM: MMU: fix conflict access permissions in direct sp Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 235/260] KVM: VMX: Fix host GDT.LIMIT corruption Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 236/260] KVM: x86: Fix SVM VMCB reset Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 237/260] KVM: x86: Move TSC reset out of vmcb_init Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 238/260] KVM: Fix fs/gs reload oops with invalid ldt Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 239/260] pipe: fix failure to return error code on ->confirm() Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 240/260] p54usb: fix off-by-one on !CONFIG_PM Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 241/260] p54usb: add five more USBIDs Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 242/260] drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure Paul Gortmaker
2011-01-02 7:18 ` [34-longterm 243/260] USB: ftdi_sio: Add PID for accesio products Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 244/260] USB: add PID for FTDI based OpenDCC hardware Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 245/260] USB: ftdi_sio: new VID/PIDs for various Papouch devices Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 246/260] USB: ftdi_sio: add device ids for ScienceScope Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 247/260] usb: musb: blackfin: call gpio_free() on error path in musb_platform_init() Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 248/260] USB: option: Add more ZTE modem USB id's Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 249/260] USB: cp210x: Add Renesas RX-Stick device ID Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 250/260] USB: cp210x: Add WAGO 750-923 Service Cable " Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 251/260] USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled Paul Gortmaker
2011-01-05 18:59 ` Jean-Christophe PLAGNIOL-VILLARD
2011-01-05 21:29 ` Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 252/260] USB: disable endpoints after unbinding interfaces, not before Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 253/260] USB: opticon: Fix long-standing bugs in opticon driver Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 254/260] USB: accept some invalid ep0-maxpacket values Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 255/260] sd name space exhaustion causes system hang Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 256/260] libsas: fix NCQ mixing with non-NCQ Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 257/260] gdth: integer overflow in ioctl Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 258/260] Fix race when removing SCSI devices Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 259/260] Fix regressions in scsi_internal_device_block Paul Gortmaker
2011-01-02 7:19 ` [34-longterm 260/260] sgi-xp: incoming XPC channel messages can come in after the channel's partition structures have been torn down Paul Gortmaker
2011-01-02 7:57 ` [34-longterm 000/260] v2.6.34.8 longterm review Ted Ts'o
2011-01-02 10:46 ` Paul Gortmaker
2011-01-03 10:41 ` Jiri Slaby
2011-01-04 19:11 ` Paul Gortmaker
2011-01-06 12:47 ` Jiri Slaby
2011-01-06 15:53 ` Paul Gortmaker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox