Linux 3.18.50
Greg KH
maintainerI'm announcing the release of the 3.18.50 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/include/asm/psci.h | 2 arch/arm/kvm/mmu.c | 3 arch/c6x/kernel/ptrace.c | 41 --- arch/metag/include/asm/uaccess.h | 15 - arch/metag/kernel/ptrace.c | 19 + arch/metag/lib/usercopy.c | 312 +++++++++---------------- arch/mips/kernel/ptrace.c | 3 arch/powerpc/boot/zImage.lds.S | 1 arch/powerpc/kernel/align.c | 27 +- arch/powerpc/kernel/setup_64.c | 9 arch/powerpc/kvm/emulate.c | 1 arch/powerpc/mm/hash_native_64.c | 7 arch/s390/boot/compressed/misc.c | 35 +- arch/s390/include/asm/uaccess.h | 2 arch/sparc/kernel/ptrace_64.c | 2 arch/x86/include/asm/elf.h | 2 arch/x86/kernel/cpu/perf_event_intel_lbr.c | 2 arch/x86/kvm/vmx.c | 10 arch/x86/mm/init.c | 40 ++- arch/x86/vdso/vdso32-setup.c | 11 block/scsi_ioctl.c | 3 crypto/ahash.c | 79 ++++-- drivers/acpi/Makefile | 1 drivers/acpi/acpi_platform.c | 8 drivers/block/zram/zram_drv.c | 6 drivers/char/Kconfig | 6 drivers/char/mem.c | 82 ++++-- drivers/char/virtio_console.c | 12 drivers/crypto/caam/ctrl.c | 3 drivers/gpu/drm/ttm/ttm_object.c | 10 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 79 ++++-- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 4 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 31 +- drivers/hv/hv_balloon.c | 4 drivers/iio/adc/ti_am335x_adc.c | 13 - drivers/input/joystick/iforce/iforce-usb.c | 3 drivers/input/joystick/xpad.c | 2 drivers/input/misc/cm109.c | 4 drivers/input/misc/ims-pcu.c | 4 drivers/input/misc/yealink.c | 4 drivers/input/serio/i8042-x86ia64io.h | 7 drivers/input/tablet/hanwang.c | 3 drivers/input/tablet/kbtab.c | 3 drivers/input/touchscreen/sur40.c | 3 drivers/iommu/intel-iommu.c | 2 drivers/isdn/gigaset/bas-gigaset.c | 3 drivers/md/raid10.c | 18 + drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 10 drivers/media/usb/dvb-usb/dvb-usb-firmware.c | 33 +- drivers/media/usb/uvc/uvc_driver.c | 118 ++++++++- drivers/mmc/host/sdhci.c | 4 drivers/mmc/host/ushc.c | 3 drivers/mtd/bcm47xxpart.c | 10 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 drivers/net/ethernet/intel/igb/e1000_phy.c | 4 drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 drivers/net/usb/catc.c | 56 ++-- drivers/net/usb/pegasus.c | 29 ++ drivers/net/usb/rtl8150.c | 34 ++ drivers/pinctrl/qcom/pinctrl-msm.c | 4 drivers/platform/x86/acer-wmi.c | 22 + drivers/rtc/rtc-s35390a.c | 167 ++++++++++--- drivers/rtc/rtc-tegra.c | 28 ++ drivers/scsi/libiscsi.c | 26 ++ drivers/scsi/libsas/sas_ata.c | 2 drivers/scsi/lpfc/lpfc_init.c | 1 drivers/scsi/sd.c | 20 + drivers/scsi/sg.c | 2 drivers/scsi/sr.c | 6 drivers/target/iscsi/iscsi_target_parameters.c | 16 - drivers/target/iscsi/iscsi_target_util.c | 12 drivers/target/target_core_pscsi.c | 47 --- drivers/target/target_core_sbc.c | 10 drivers/tty/serial/8250/8250_pci.c | 23 + drivers/tty/serial/atmel_serial.c | 5 drivers/usb/class/usbtmc.c | 7 drivers/usb/gadget/function/f_acm.c | 4 drivers/uwb/hwa-rc.c | 3 drivers/uwb/i1480/dfu/usb.c | 3 drivers/video/fbdev/xen-fbfront.c | 4 drivers/virtio/virtio_balloon.c | 2 drivers/xen/xen-acpi-processor.c | 34 ++ fs/cifs/file.c | 6 fs/cifs/smb2pdu.c | 4 fs/ext4/inline.c | 5 fs/xfs/libxfs/xfs_inode_buf.c | 8 fs/xfs/xfs_bmap_util.c | 7 fs/xfs/xfs_buf.c | 1 include/crypto/internal/hash.h | 10 include/drm/ttm/ttm_object.h | 5 include/linux/kvm_host.h | 4 include/linux/log2.h | 13 - include/scsi/libiscsi.h | 1 kernel/events/core.c | 5 kernel/ptrace.c | 14 - kernel/trace/ftrace.c | 20 + kernel/trace/ring_buffer.c | 8 mm/hugetlb.c | 6 mm/mempolicy.c | 20 - mm/percpu.c | 5 net/core/sock.c | 16 - net/ipv4/fib_frontend.c | 3 net/ipv4/tcp_input.c | 2 net/ipv4/tcp_minisocks.c | 1 net/ipv6/route.c | 2 net/sched/act_api.c | 5 net/sctp/socket.c | 8 net/unix/garbage.c | 18 - sound/core/seq/seq_clientmgr.c | 1 sound/core/seq/seq_fifo.c | 7 sound/core/seq/seq_memory.c | 17 + sound/core/seq/seq_memory.h | 1 virt/kvm/eventfd.c | 3 virt/kvm/kvm_main.c | 40 ++- 116 files changed, 1271 insertions(+), 699 deletions(-)
Adrian Hunter (1):
mmc: sdhci: Do not disable interrupts while waiting for clock
Amit Pundir (1):
Revert "ARM: 8457/1: psci-smp is built only for SMP"
Andrey Ulanov (1):
net: unix: properly re-increment inflight counter of GC discarded candidates
Ankur Arora (1):
xen/acpi: upload PM state from init-domain to Xen
Anton Blanchard (1):
scsi: lpfc: Add shutdown method for kexec
Arnd Bergmann (1):
dvb-usb-v2: avoid use-after-free
Ben Hutchings (4):
pegasus: Use heap buffers for all register access
rtl8150: Use heap buffers for all register access
catc: Combine failure cleanup code in catc_probe()
catc: Use heap buffer for memory size test
Benjamin Herrenschmidt (1):
powerpc: Disable HFSCR[TM] if TM is not supported
Bjorn Andersson (1):
pinctrl: qcom: Don't clear status bit on irq_unmask
Cameron Gutman (1):
Input: xpad - add support for Razer Wildcat gamepad
Chris J Arges (1):
igb: Workaround for igb i210 firmware issue
Chris Leech (1):
scsi: libiscsi: add lock around task lists to fix list corruption regression
Chris Salls (1):
mm/mempolicy.c: fix error handling in set_mempolicy and mbind.
Daniel Borkmann (1):
socket, bpf: fix sk_filter use after free in sk_clone_lock
Darrick J. Wong (2):
xfs: don't allow di_size with high bit set
xfs: clear _XBF_PAGES from buffers when readahead page
Dave Martin (6):
c6x/ptrace: Remove useless PTRACE_SETREGSET implementation mips/ptrace: Preserve previous registers for short regset write sparc/ptrace: Preserve previous registers for short regset write metag/ptrace: Preserve previous registers for short regset write metag/ptrace: Provide default TXSTATUS for short NT_PRSTATUS metag/ptrace: Reject partial NT_METAG_RPIPE writes
David Hildenbrand (1):
KVM: kvm_io_bus_unregister_dev() should never fail
Eric Biggers (1):
ext4: mark inode dirty after converting inline directory
Eric Dumazet (3):
ipv4: provide stronger user input validation in nl_fib_input()
net: properly release sk_frag.page
tcp: initialize icsk_ack.lrcvtime at session start time
Eric Sandeen (1):
xfs: fix up xfs_swap_extent_forks inline extent handling
Florian Fainelli (1):
net: bcmgenet: Do not suspend PHY if Wake-on-LAN is enabled
Frederic Barrat (1):
powerpc/mm: Add missing global TLB invalidate if cxl is active
Gabriel Krisman Bertazi (1):
serial: 8250_pci: Detach low-level driver during PCI error recovery
Geert Uytterhoeven (1):
char: Drop bogus dependency of DEVPORT on !M68K
Germano Percossi (1):
CIFS: store results of cifs_reopen_file to avoid infinite wait
Greg Kroah-Hartman (1):
Linux 3.18.50
Heiko Carstens (1):
s390/uaccess: get_user() should zero on failure (again)
Henrik Ingo (1):
uvcvideo: uvc_scan_fallback() for webcams with broken chain
Herbert Xu (1):
crypto: ahash - Fix EINPROGRESS notification callback
Horia Geantă (1):
crypto: caam - fix RNG deinstantiation error checking
James Hogan (7):
metag/usercopy: Drop unused macros metag/usercopy: Fix alignment error checking metag/usercopy: Add early abort to copy_to_user metag/usercopy: Zero rest of buffer from copy_from_user metag/usercopy: Set flags before ADDZ metag/usercopy: Fix src fixup in from user rapf loops metag/usercopy: Add missing fixups
Jan-Marek Glogowski (1):
Reset TreeId to zero on SMB2 TREE_CONNECT
Joerg Roedel (1):
ACPI: Do not create a platform_device for IOAPIC/IOxAPIC
Johan Hovold (12):
isdn/gigaset: fix NULL-deref at probe
Input: iforce - validate number of endpoints before using them
Input: ims-pcu - validate number of endpoints before using them
Input: hanwang - validate number of endpoints before using them
Input: yealink - validate number of endpoints before using them
Input: cm109 - validate number of endpoints before using them
Input: kbtab - validate number of endpoints before using them
Input: sur40 - validate number of endpoints before using them
mmc: ushc: fix NULL-deref at probe
uwb: hwa-rc: fix NULL-deref at probe
uwb: i1480-dfu: fix NULL-deref at probe
USB: usbtmc: add missing endpoint sanity check
John Garry (1):
scsi: libsas: fix ata xfer length
Josh Poimboeuf (1):
ACPI: Fix incompatibility with mcount-based function graph tracing
Juergen Gross (1):
xen, fbfront: fix connecting to backend
Kai-Heng Feng (1):
Input: i8042 - add noloop quirk for Dell Embedded Box PC 3000
Kees Cook (1):
mm: Tighten x86 /dev/mem with zeroing reads
Koos Vriezen (1):
iommu/vt-d: Fix NULL pointer dereference in device_to_iommu
Ladi Prosek (1):
virtio_balloon: init 1st buffer in stats vq
Lee, Chun-Yi (1):
platform/x86: acer-wmi: setup accelerometer when machine has appropriate notify event
Li Qiang (1):
drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl()
Linus Torvalds (1):
give up on gcc ilog2() constant optimizations
Mantas M (1):
net: ipv6: check route protocol when deleting routes
Maor Gottlieb (1):
net/mlx5: Increase number of max QPs in default profile
Marc Zyngier (1):
arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region
Marcelo Henrique Cerri (1):
s390/decompressor: fix initrd corruption caused by bss clear
Marcelo Ricardo Leitner (1):
sctp: deny peeloff operation on asocs with threads sleeping on it
Martin K. Petersen (2):
scsi: sr: Sanity check returned mode data
scsi: sd: Fix capacity calculation with 32-bit sector_t
Mathias Krause (1):
x86/vdso: Ensure vdso32_enabled gets set to valid values only
Mauricio Faria de Oliveira (1):
block: allow WRITE_SAME commands with the SG_IO ioctl
Mauro Carvalho Chehab (1):
dvb-usb: don't use stack for firmware load
Max Bires (1):
char: lack of bool string made CONFIG_DEVPORT always on
Max Lohrmann (1):
target: Fix VERIFY_16 handling in sbc_parse_cdb
Michael Ellerman (1):
powerpc/boot: Fix zImage TOC alignment
Michael Engl (1):
iio: adc: ti_am335x_adc: fix fifo overrun recovery
Minchan Kim (1):
zram: do not use copy_page with non-page aligned address
Murray McAllister (2):
drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl() drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl()
Naoya Horiguchi (1):
mm, hugetlb: use pte_present() instead of pmd_present() in follow_huge_pmd()
Nicholas Bellinger (3):
iscsi-target: Fix TMR reference leak during session shutdown
iscsi-target: Drop work-around for legacy GlobalSAN initiator target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export
Oliver Neukum (1):
ACM gadget: fix endianness in notifications
Omar Sandoval (1):
virtio-console: avoid DMA from stack
Paolo Bonzini (1):
kvm: fix page struct leak in handle_vmon
Paul Mackerras (1):
powerpc: Don't try to fix up misaligned load-with-reservation instructions
Peter Xu (1):
KVM: x86: clear bus pointer when destroyed
Peter Zijlstra (2):
perf/x86: Avoid exposing wrong/stale data in intel_pmu_lbr_read_32() perf/core: Fix event inheritance on fork()
Rafał Miłecki (1):
mtd: bcm47xxpart: fix parsing first block after aligned TRX
Richard Genoud (1):
tty/serial: atmel: fix race condition (TX+DMA)
Roman Mashak (1):
net sched actions: decrement module reference count after table flush.
Shaohua Li (1):
md/raid1/10: fix potential deadlock
Stefan Brüns (1):
dvb-usb-firmware: don't do DMA on stack
Steven Rostedt (VMware) (1):
ftrace: Fix removing of second function probe
Tahsin Erdogan (1):
percpu: acquire pcpu_lock when updating pcpu_nr_empty_pop_pages
Takashi Iwai (2):
ALSA: seq: Fix racy cell insertions during snd_seq_pool_done()
ALSA: seq: Fix race during FIFO resize
Thierry Reding (1):
rtc: tegra: Implement clock handling
Thomas Gleixner (1):
x86/vdso: Plug race between mapping and ELF header setup
Thomas Hellstrom (3):
drm/vmwgfx: Type-check lookups of fence objects
drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces drm/vmwgfx: Remove getparam error message
Thomas Huth (1):
KVM: PPC: Book3S PR: Fix illegal opcode emulation
Todd Fujinaka (1):
igb: add i211 to i210 PHY workaround
Uwe Kleine-König (4):
rtc: s35390a: fix reading out alarm
rtc: s35390a: make sure all members in the output are set
rtc: s35390a: implement reset routine as suggested by the reference
rtc: s35390a: improve irq handling
Vitaly Kuznetsov (1):
Drivers: hv: balloon: don't crash when memory is added in non-sorted order
Wei Yongjun (1):
ring-buffer: Fix return value check in test_ringbuffer()
[email protected] (1):
ptrace: fix PTRACE_LISTEN race corrupting task->state
peter chang (1):
scsi: sg: check length passed to SG_NEXT_CMD_LEN
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 49 +SUBLEVEL = 50 EXTRAVERSION = NAME = Diseased Newt
arch/arm/include/asm/psci.h +1 -1
@@ -37,7 +37,7 @@ struct psci_operations {extern struct psci_operations psci_ops;extern struct smp_operations psci_smp_ops; -#if defined(CONFIG_SMP ) && defined(CONFIG_ARM_PSCI ) +#ifdef CONFIG_ARM_PSCI int psci_init (void );bool psci_smp_available (void );#else
arch/arm/kvm/mmu.c +3 -0
@@ -1407,6 +1407,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, (KVM_PHYS_SIZE >> PAGE_SHIFT))return -EFAULT ; +down_read (¤t->mm->mmap_sem);/* * A memory region could potentially cover multiple VMAs, and any holes * between them, so iterate over all of them to find out if we can map
@@ -1464,6 +1465,8 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,else stage2_flush_memslot (kvm, memslot);spin_unlock (&kvm->mmu_lock); + +up_read (¤t->mm->mmap_sem);return ret; }
arch/c6x/kernel/ptrace.c +0 -41
53 lines not on this page · raw message
arch/metag/include/asm/uaccess.h +8 -7
@@ -192,20 +192,21 @@ extern long __must_check strnlen_user(const char __user *src, long count);#define strlen_user (str) strnlen_user(str, 32767) -extern unsigned long __must_check __copy_user_zeroing (void *to, -const void __user *from, -unsigned long n); +extern unsigned long raw_copy_from_user (void *to,const void __user *from, +unsigned long n);static inline unsigned long copy_from_user (void *to,const void __user *from,unsigned long n) { +unsigned long res = n;if (likely (access_ok (VERIFY_READ , from, n))) -return __copy_user_zeroing (to, from, n); -memset (to,0 , n); -return n; + res =raw_copy_from_user (to, from, n); +if (unlikely (res)) +memset (to + (n - res),0 , res); +return res; } -#define __copy_from_user (to, from, n) __copy_user_zeroing(to, from, n) +#define __copy_from_user (to, from, n) raw_copy_from_user(to, from, n)#define __copy_from_user_inatomic __copy_from_user extern unsigned long __must_check __copy_user(void __user *to,
arch/metag/kernel/ptrace.c +15 -4
@@ -24,6 +24,16 @@* user_regset definitions. */ +static unsigned long user_txstatus (const struct pt_regs *regs) +{ +unsigned long data = (unsigned long )regs->ctx.Flags; + +if (regs->ctx.SaveMask &TBICTX_CBUF_BIT ) + data |=USER_GP_REGS_STATUS_CATCH_BIT ; + +return data; +} +int metag_gp_regs_copyout (const struct pt_regs *regs,unsigned int pos,unsigned int count,void *kbuf,void __user *ubuf)
@@ -62,9 +72,7 @@ int metag_gp_regs_copyout(const struct pt_regs *regs,if (ret) goto out;/* TXSTATUS */ - data = (unsigned long )regs->ctx.Flags; -if (regs->ctx.SaveMask &TBICTX_CBUF_BIT ) - data |=USER_GP_REGS_STATUS_CATCH_BIT ; + data =user_txstatus (regs); ret =user_regset_copyout (&pos, &count, &kbuf, &ubuf, &data,4 *25 ,4 *26 );if (ret)
@@ -119,6 +127,7 @@ int metag_gp_regs_copyin(struct pt_regs *regs,if (ret) goto out;/* TXSTATUS */ + data =user_txstatus (regs); ret =user_regset_copyin (&pos, &count, &kbuf, &ubuf, &data,4 *25 ,4 *26 );if (ret)
@@ -244,6 +253,8 @@ int metag_rp_state_copyin(struct pt_regs *regs,unsigned long long *ptr;int ret, i; +if (count <4 *13 ) +return -EINVAL ;/* Read the entire pipeline before making any changes */ ret =user_regset_copyin (&pos, &count, &kbuf, &ubuf, &rp,0 ,4 *13 );
@@ -303,7 +314,7 @@ static int metag_tls_set(struct task_struct *target, const void *kbuf, const void __user *ubuf) { int ret; -void __user *tls; +void __user *tls = target->thread.tls_ptr; ret =user_regset_copyin (&pos, &count, &kbuf, &ubuf, &tls,0 ,-1 );if (ret)
arch/metag/lib/usercopy.c +120 -192
562 lines not on this page · raw message
arch/mips/kernel/ptrace.c +2 -1
@@ -444,7 +444,8 @@ static int fpr_set(struct task_struct *target, &target->thread.fpu, 0, sizeof(elf_fpregset_t)); -for (i =0 ; i <NUM_FPU_REGS ; i++) { +BUILD_BUG_ON (sizeof (fpr_val) !=sizeof (elf_fpreg_t)); +for (i =0 ; i <NUM_FPU_REGS && count >=sizeof (elf_fpreg_t); i++) { err =user_regset_copyin (&pos, &count, &kbuf, &ubuf, &fpr_val, i *sizeof (elf_fpreg_t), (i +1 ) *sizeof (elf_fpreg_t));
arch/powerpc/boot/zImage.lds.S +1 -0
@@ -68,6 +68,7 @@ SECTIONS } #ifdef CONFIG_PPC64_BOOT_WRAPPER + . = ALIGN(256); .got : { __toc_start = .;
arch/powerpc/kernel/align.c +19 -8
@@ -808,14 +808,25 @@ int fix_alignment(struct pt_regs *regs) nb = aligninfo[instr].len; flags = aligninfo[instr].flags; -/* ldbrx/stdbrx overlap lfs/stfs in the DSISR unfortunately */ -if (IS_XFORM (instruction) && ((instruction >>1 ) &0x3ff ) ==532 ) { - nb =8 ; - flags =LD +SW ; - }else if (IS_XFORM (instruction) && - ((instruction >>1 ) &0x3ff ) ==660 ) { - nb =8 ; - flags =ST +SW ; +/* +* Handle some cases which give overlaps in the DSISR values. +*/ +if (IS_XFORM (instruction)) { +switch (get_xop (instruction)) { +case 532 :/* ldbrx */ + nb =8 ; + flags =LD +SW ; +break ; +case 660 :/* stdbrx */ + nb =8 ; + flags =ST +SW ; +break ; +case 20 :/* lwarx */ +case 84 :/* ldarx */ +case 116 :/* lharx */ +case 276 :/* lqarx */ +return 0 ;/* not emulated ever */ + } }/* Byteswap little endian loads and stores */
arch/powerpc/kernel/setup_64.c +9 -0
@@ -211,6 +211,15 @@ static void cpu_ready_for_interrupts(void)unsigned long lpcr =mfspr (SPRN_LPCR );mtspr (SPRN_LPCR , lpcr |LPCR_AIL_3 ); } + +/* +* Fixup HFSCR:TM based on CPU features. The bit is set by our +* early asm init because at that point we haven't updated our +* CPU features from firmware and device-tree. Here we have, +* so let's do it. +*/ +if (cpu_has_feature (CPU_FTR_HVMODE ) && !cpu_has_feature (CPU_FTR_TM_COMP )) +mtspr (SPRN_HFSCR ,mfspr (SPRN_HFSCR ) & ~HFSCR_TM ); }/*
arch/powerpc/kvm/emulate.c +0 -1
@@ -302,7 +302,6 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu) advance =0 ;printk (KERN_ERR "Couldn't emulate instruction 0x%08x " "(op %d xop %d)\n" , inst,get_op (inst),get_xop (inst)); -kvmppc_core_queue_program (vcpu,0 ); } }
arch/powerpc/mm/hash_native_64.c +5 -2
@@ -633,6 +633,10 @@ static void native_flush_hash_range(unsigned long number, int local)unsigned long psize = batch->psize;int ssize = batch->ssize;int i; +unsigned int use_local; + + use_local = local &&mmu_has_feature (MMU_FTR_TLBIEL ) && + mmu_psize_defs[psize].tlbiel && !cxl_ctx_in_use ();local_irq_save (flags);
@@ -659,8 +663,7 @@ static void native_flush_hash_range(unsigned long number, int local) }pte_iterate_hashed_end (); } -if (mmu_has_feature (MMU_FTR_TLBIEL ) && - mmu_psize_defs[psize].tlbiel && local) { +if (use_local) { asmvolatile ("ptesync" :::"memory" );for (i =0 ; i < number; i++) { vpn = batch->vpn[i];
arch/s390/boot/compressed/misc.c +19 -16
@@ -142,31 +142,34 @@ static void check_ipl_parmblock(void *start, unsigned long size)unsigned long decompress_kernel (void ) { -unsigned long output_addr; -unsigned char *output; +void *output, *kernel_end; - output_addr = ((unsigned long ) &_end +HEAP_SIZE +4095UL ) &-4096UL ; -check_ipl_parmblock ((void *)0 , output_addr + SZ__bss_start); -memset (&_bss,0 , &_ebss - &_bss); - free_mem_ptr = (unsigned long )&_end; - free_mem_end_ptr = free_mem_ptr +HEAP_SIZE ; - output = (unsigned char *) output_addr; + output = (void *)ALIGN ((unsigned long ) &_end +HEAP_SIZE ,PAGE_SIZE ); + kernel_end = output + SZ__bss_start; +check_ipl_parmblock ((void *)0 , (unsigned long ) kernel_end);#ifdef CONFIG_BLK_DEV_INITRD /* * Move the initrd right behind the end of the decompressed -* kernel image. +* kernel image. This also prevents initrd corruption caused by +* bss clearing since kernel_end will always be located behind the +* current bss section.. */ -if (INITRD_START &&INITRD_SIZE && -INITRD_START < (unsigned long ) output + SZ__bss_start) { -check_ipl_parmblock (output + SZ__bss_start, -INITRD_START +INITRD_SIZE ); -memmove (output + SZ__bss_start, - (void *)INITRD_START ,INITRD_SIZE ); -INITRD_START = (unsigned long ) output + SZ__bss_start; +if (INITRD_START &&INITRD_SIZE && kernel_end > (void *)INITRD_START ) { +check_ipl_parmblock (kernel_end,INITRD_SIZE ); +memmove (kernel_end, (void *)INITRD_START ,INITRD_SIZE ); +INITRD_START = (unsigned long ) kernel_end; }#endif +/* +* Clear bss section. free_mem_ptr and free_mem_end_ptr need to be +* initialized afterwards since they reside in bss. +*/ +memset (&_bss,0 , &_ebss - &_bss); + free_mem_ptr = (unsigned long ) &_end; + free_mem_end_ptr = free_mem_ptr +HEAP_SIZE ; +puts ("Uncompressing Linux... " );decompress (input_data, input_len,NULL ,NULL , output,NULL , error);puts ("Ok, booting the kernel.\n" );
arch/s390/include/asm/uaccess.h +1 -1
@@ -148,7 +148,7 @@ unsigned long __must_check __copy_to_user(void __user *to, const void *from," jg 2b\n" \".popsection\n" \ EX_TABLE(0b,3b) EX_TABLE(1b,3b) \ - : "=d" (__rc), "=Q" (*(to)) \ + : "=d" (__rc), "+Q" (*(to)) \: " d" (size), " Q " (*(from)), \ " d" (__reg0), " K " (-EFAULT) \ : " cc"); \
arch/sparc/kernel/ptrace_64.c +1 -1
@@ -311,7 +311,7 @@ static int genregs64_set(struct task_struct *target, }if (!ret) { -unsigned long y; +unsigned long y = regs->y; ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &y,
arch/x86/include/asm/elf.h +1 -1
@@ -277,7 +277,7 @@ struct task_struct;#define ARCH_DLINFO_IA32 \ do { \ - if (vdso32_enabled) { \ + if (VDSO_CURRENT_BASE) { \ NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_CURRENT_BASE); \ } \
arch/x86/kernel/cpu/perf_event_intel_lbr.c +2 -0
@@ -268,6 +268,8 @@ static void intel_pmu_lbr_read_32(struct cpu_hw_events *cpuc) cpuc->lbr_entries[i].to = msr_lastbranch.to; cpuc->lbr_entries[i].mispred =0 ; cpuc->lbr_entries[i].predicted =0 ; + cpuc->lbr_entries[i].in_tx =0 ; + cpuc->lbr_entries[i].abort =0 ; cpuc->lbr_entries[i].reserved =0 ; } cpuc->lbr_stack.nr = i;
arch/x86/kvm/vmx.c +8 -2
@@ -6079,14 +6079,20 @@ static int nested_vmx_check_vmptr(struct kvm_vcpu *vcpu, int exit_reason, } page =nested_get_page (vcpu, vmptr); -if (page ==NULL || - *(u32 *)kmap (page) !=VMCS12_REVISION ) { +if (page ==NULL ) {nested_vmx_failInvalid (vcpu); +skip_emulated_instruction (vcpu); +return 1 ; + } +if (*(u32 *)kmap (page) !=VMCS12_REVISION ) {kunmap (page); +nested_release_page_clean (page); +nested_vmx_failInvalid (vcpu);skip_emulated_instruction (vcpu);return 1 ; }kunmap (page); +nested_release_page_clean (page); vmx->nested.vmxon_ptr = vmptr;break ;case EXIT_REASON_VMCLEAR :
arch/x86/mm/init.c +30 -10
@@ -581,20 +581,40 @@ void __init init_mem_mapping(void)* is valid. The argument is a physical page number. * * -* On x86, access has to be given to the first megabyte of ram because that area -* contains bios code and data regions used by X and dosemu and similar apps. -* Access has to be given to non-kernel-ram areas as well, these contain the PCI -* mmio resources as well as potential bios/acpi data regions. +* On x86, access has to be given to the first megabyte of RAM because that +* area traditionally contains BIOS code and data regions used by X, dosemu, +* and similar apps. Since they map the entire memory range, the whole range +* must be allowed (for mapping), but any areas that would otherwise be +* disallowed are flagged as being "zero filled" instead of rejected. +* Access has to be given to non-kernel-ram areas as well, these contain the +* PCI mmio resources as well as potential bios/acpi data regions. */ int devmem_is_allowed (unsigned long pagenr) { -if (pagenr <256 ) -return 1 ; -if (iomem_is_exclusive (pagenr <<PAGE_SHIFT )) +if (page_is_ram (pagenr)) { +/* +* For disallowed memory regions in the low 1MB range, +* request that the page be shown as all zeros. +*/ +if (pagenr <256 ) +return 2 ; +return 0 ; -if (!page_is_ram (pagenr)) -return 1 ; -return 0 ; + } + +/* +* This must follow RAM test, since System RAM is considered a +* restricted resource under CONFIG_STRICT_IOMEM. +*/ +if (iomem_is_exclusive (pagenr <<PAGE_SHIFT )) { +/* Low 1MB bypasses iomem restrictions. */ +if (pagenr <256 ) +return 1 ; + +return 0 ; + } + +return 1 ; }void free_init_pages (char *what,unsigned long begin,unsigned long end)
arch/x86/vdso/vdso32-setup.c +9 -2
@@ -31,8 +31,10 @@ static int __init vdso32_setup(char *s) { vdso32_enabled =simple_strtoul (s,NULL ,0 ); -if (vdso32_enabled >1 ) +if (vdso32_enabled >1 ) {pr_warn ("vdso32 values other than 0 and 1 are no longer allowed; vdso disabled\n" ); + vdso32_enabled =0 ; + }return 1 ; }
@@ -89,13 +91,18 @@ subsys_initcall(sysenter_setup);/* Register vsyscall32 into the ABI table */ #include <linux/sysctl.h> +static const int zero; +static const int one =1 ; +static struct ctl_table abi_table2[] = { { .procname ="vsyscall32" , .data = &vdso32_enabled, .maxlen =sizeof (int ), .mode =0644 , - .proc_handler = proc_dointvec + .proc_handler = proc_dointvec_minmax, + .extra1 = (int *)&zero, + .extra2 = (int *)&one, }, {} };
block/scsi_ioctl.c +3 -0
@@ -182,6 +182,9 @@ static void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)__set_bit (WRITE_16 , filter->write_ok);__set_bit (WRITE_LONG , filter->write_ok);__set_bit (WRITE_LONG_2 , filter->write_ok); +__set_bit (WRITE_SAME , filter->write_ok); +__set_bit (WRITE_SAME_16 , filter->write_ok); +__set_bit (WRITE_SAME_32 , filter->write_ok);__set_bit (ERASE , filter->write_ok);__set_bit (GPCMD_MODE_SELECT_10 , filter->write_ok);__set_bit (MODE_SELECT , filter->write_ok);
crypto/ahash.c +50 -29
163 lines not on this page · raw message
drivers/acpi/Makefile +0 -1
@@ -2,7 +2,6 @@ # Makefile for the Linux ACPI interpreter # -ccflags-y := -Os ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT #
drivers/acpi/acpi_platform.c +5 -3
@@ -24,9 +24,11 @@ACPI_MODULE_NAME ("platform" );static const struct acpi_device_id forbidden_id_list[] = { - {"PNP0000" ,0 },/* PIC */ - {"PNP0100" ,0 },/* Timer */ - {"PNP0200" ,0 },/* AT DMA Controller */ + {"PNP0000" ,0 },/* PIC */ + {"PNP0100" ,0 },/* Timer */ + {"PNP0200" ,0 },/* AT DMA Controller */ + {"ACPI0009" ,0 },/* IOxAPIC */ + {"ACPI000A" ,0 },/* IOAPIC */ {"" ,0 }, };
drivers/block/zram/zram_drv.c +3 -3
@@ -431,13 +431,13 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index)if (!handle ||zram_test_flag (meta, index,ZRAM_ZERO )) {bit_spin_unlock (ZRAM_ACCESS , &meta->table[index].value); -clear_page (mem); +memset (mem,0 ,PAGE_SIZE );return 0 ; } cmem =zs_map_object (meta->mem_pool, handle,ZS_MM_RO );if (size ==PAGE_SIZE ) -copy_page (mem, cmem); +memcpy (mem, cmem,PAGE_SIZE );else ret =zcomp_decompress (zram->comp, cmem, size, mem);zs_unmap_object (meta->mem_pool, handle);
@@ -612,7 +612,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,if ((clen ==PAGE_SIZE ) && !is_partial_io (bvec)) { src =kmap_atomic (page); -copy_page (cmem, src); +memcpy (cmem, src,PAGE_SIZE );kunmap_atomic (src); }else {memcpy (cmem, src, clen);
drivers/char/Kconfig +4 -2
@@ -574,10 +574,12 @@ config TELCLOCK controlling the behavior of this hardware. config DEVPORT - bool - depends on !M68K + bool "/dev/port character device" depends on ISA || PCI default y + help + Say Y here if you want to support the /dev/port device. The /dev/port + device is similar to /dev/mem, but for I/O ports. source "drivers/s390/char/Kconfig"
drivers/char/mem.c +52 -30
117 lines not on this page · raw message
drivers/char/virtio_console.c +10 -2
@@ -1129,6 +1129,8 @@ static int put_chars(u32 vtermno, const char *buf, int count) {struct port *port;struct scatterlist sg[1 ]; +void *data; +int ret;if (unlikely (early_put_chars))return early_put_chars (vtermno, buf, count);
@@ -1137,8 +1139,14 @@ static int put_chars(u32 vtermno, const char *buf, int count)if (!port)return -EPIPE ; -sg_init_one (sg, buf, count); -return __send_to_port (port, sg,1 , count, (void *)buf, false); + data =kmemdup (buf, count,GFP_ATOMIC ); +if (!data) +return -ENOMEM ; + +sg_init_one (sg, data, count); + ret =__send_to_port (port, sg,1 , count, data, false); +kfree (data); +return ret; }/*
drivers/crypto/caam/ctrl.c +2 -1
@@ -263,7 +263,8 @@ static int deinstantiate_rng(struct device *ctrldev, int state_handle_mask)/* Try to run it through DECO0 */ ret =run_descriptor_deco0 (ctrldev, desc, &status); -if (ret || status) { +if (ret || + (status && status !=JRSTA_SSRC_JUMP_HALT_CC )) {dev_err (ctrldev,"Failed to deinstantiate RNG4 SH%d\n" , sh_idx);
drivers/gpu/drm/ttm/ttm_object.c +7 -3
@@ -179,7 +179,7 @@ int ttm_base_object_init(struct ttm_object_file *tfile,if (unlikely (ret !=0 )) goto out_err0; - ret =ttm_ref_object_add (tfile, base,TTM_REF_USAGE ,NULL ); + ret =ttm_ref_object_add (tfile, base,TTM_REF_USAGE ,NULL , false);if (unlikely (ret !=0 )) goto out_err1;
@@ -318,7 +318,8 @@ EXPORT_SYMBOL(ttm_ref_object_exists);int ttm_ref_object_add (struct ttm_object_file *tfile,struct ttm_base_object *base, -enum ttm_ref_type ref_type,bool *existed) +enum ttm_ref_type ref_type,bool *existed, +bool require_existed) {struct drm_open_hash *ht = &tfile->ref_hash[ref_type];struct ttm_ref_object *ref;
@@ -345,6 +346,9 @@ int ttm_ref_object_add(struct ttm_object_file *tfile, }rcu_read_unlock (); +if (require_existed) +return -EPERM ; + ret =ttm_mem_global_alloc (mem_glob,sizeof (*ref), false, false);if (unlikely (ret !=0 ))
@@ -635,7 +639,7 @@ int ttm_prime_fd_to_handle(struct ttm_object_file *tfile, prime = (struct ttm_prime_object *) dma_buf->priv; base = &prime->base; *handle = base->hash.key; - ret =ttm_ref_object_add (tfile, base,TTM_REF_USAGE ,NULL ); + ret =ttm_ref_object_add (tfile, base,TTM_REF_USAGE ,NULL , false);dma_buf_put (dma_buf);
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +50 -29
127 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +1 -3
@@ -106,8 +106,6 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data, param->value = dev_priv->max_mob_size;break ;default : -DRM_ERROR ("Illegal vmwgfx get param request: %d\n" , - param->param);return -EINVAL ; }
@@ -161,7 +159,7 @@ int vmw_get_cap_3d_ioctl(struct drm_device *dev, void *data,bool gb_objects = !!(dev_priv->capabilities &SVGA_CAP_GBOBJECTS );struct vmw_fpriv *vmw_fp =vmw_fpriv (file_priv); -if (unlikely (arg->pad64 !=0 )) { +if (unlikely (arg->pad64 !=0 || arg->max_size ==0 )) {DRM_ERROR ("Illegal GET_3D_CAP argument.\n" );return -EINVAL ; }
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +2 -2
@@ -588,7 +588,7 @@ static int vmw_user_dmabuf_synccpu_grab(struct vmw_user_dma_buffer *user_bo,return ret; ret =ttm_ref_object_add (tfile, &user_bo->prime.base, -TTM_REF_SYNCCPU_WRITE , &existed); +TTM_REF_SYNCCPU_WRITE , &existed, false);if (ret !=0 || existed)ttm_bo_synccpu_write_release (&user_bo->dma.base);
@@ -764,7 +764,7 @@ int vmw_user_dmabuf_reference(struct ttm_object_file *tfile, *handle = user_bo->prime.base.hash.key;return ttm_ref_object_add (tfile, &user_bo->prime.base, -TTM_REF_USAGE ,NULL ); +TTM_REF_USAGE ,NULL , false); }/*
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +15 -16
@@ -708,11 +708,14 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,128 ; num_sizes =0 ; -for (i =0 ; i <DRM_VMW_MAX_SURFACE_FACES ; ++i) +for (i =0 ; i <DRM_VMW_MAX_SURFACE_FACES ; ++i) { +if (req->mip_levels[i] >DRM_VMW_MAX_MIP_LEVELS ) +return -EINVAL ; num_sizes += req->mip_levels[i]; + } -if (num_sizes >DRM_VMW_MAX_SURFACE_FACES * -DRM_VMW_MAX_MIP_LEVELS ) +if (num_sizes >DRM_VMW_MAX_SURFACE_FACES *DRM_VMW_MAX_MIP_LEVELS || + num_sizes ==0 )return -EINVAL ; size = vmw_user_surface_size + 128 +
@@ -895,17 +898,16 @@ vmw_surface_handle_reference(struct vmw_private *dev_priv,uint32_t handle;struct ttm_base_object *base;int ret; +bool require_exist = false;if (handle_type ==DRM_VMW_HANDLE_PRIME ) { ret =ttm_prime_fd_to_handle (tfile, u_handle, &handle);if (unlikely (ret !=0 ))return ret; }else { -if (unlikely (drm_is_render_client (file_priv))) { -DRM_ERROR ("Render client refused legacy " -"surface reference.\n" ); -return -EACCES ; - } +if (unlikely (drm_is_render_client (file_priv))) + require_exist = true; + handle = u_handle; }
@@ -927,17 +929,14 @@ vmw_surface_handle_reference(struct vmw_private *dev_priv,/* * Make sure the surface creator has the same -* authenticating master. +* authenticating master, or is already registered with us. */ if (drm_is_primary_client (file_priv) && - user_srf->master != file_priv->master) { -DRM_ERROR ("Trying to reference surface outside of" -" master domain.\n" ); - ret = -EACCES ; - goto out_bad_resource; - } + user_srf->master != file_priv->master) + require_exist = true; - ret =ttm_ref_object_add (tfile, base,TTM_REF_USAGE ,NULL ); + ret =ttm_ref_object_add (tfile, base,TTM_REF_USAGE ,NULL , + require_exist);if (unlikely (ret !=0 )) {DRM_ERROR ("Could not add a reference to a surface.\n" ); goto out_bad_resource;
drivers/hv/hv_balloon.c +2 -2
@@ -673,7 +673,7 @@ static bool pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt)* If the pfn range we are dealing with is not in the current * "hot add block", move on. */ -if ((start_pfn >= has->end_pfn)) +if (start_pfn < has->start_pfn || start_pfn >= has->end_pfn)continue ;/* * If the current hot add-request extends beyond
@@ -728,7 +728,7 @@ static unsigned long handle_pg_range(unsigned long pg_start,* If the pfn range we are dealing with is not in the current * "hot add block", move on. */ -if ((start_pfn >= has->end_pfn)) +if (start_pfn < has->start_pfn || start_pfn >= has->end_pfn)continue ; old_covered_state = has->covered_end_pfn;
drivers/iio/adc/ti_am335x_adc.c +12 -1
@@ -122,7 +122,9 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) {struct iio_dev *indio_dev = private;struct tiadc_device *adc_dev =iio_priv (indio_dev); -unsigned int status, config; +unsigned int status, config, adc_fsm; +unsigned short count =0 ; + status =tiadc_readl (adc_dev,REG_IRQSTATUS );/*
@@ -136,6 +138,15 @@ static irqreturn_t tiadc_irq_h(int irq, void *private)tiadc_writel (adc_dev,REG_CTRL , config);tiadc_writel (adc_dev,REG_IRQSTATUS ,IRQENB_FIFO1OVRRUN |IRQENB_FIFO1UNDRFLW |IRQENB_FIFO1THRES ); + +/* wait for idle state. +* ADC needs to finish the current conversion +* before disabling the module +*/ +do { + adc_fsm =tiadc_readl (adc_dev,REG_ADCFSM ); + }while (adc_fsm !=0x10 && count++ <100 ); +tiadc_writel (adc_dev,REG_CTRL , (config |CNTRLREG_TSCSSENB ));return IRQ_HANDLED ; }else if (status &IRQENB_FIFO1THRES ) {
drivers/input/joystick/iforce/iforce-usb.c +3 -0
@@ -141,6 +141,9 @@ static int iforce_usb_probe(struct usb_interface *intf, interface = intf->cur_altsetting; +if (interface->desc.bNumEndpoints <2 ) +return -ENODEV ; + epirq = &interface->endpoint[0 ].desc; epout = &interface->endpoint[1 ].desc;
drivers/input/joystick/xpad.c +2 -0
@@ -186,6 +186,7 @@ static const struct xpad_device { { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 }, { 0x1532, 0x0037, "Razer Sabertooth", 0, XTYPE_XBOX360 }, + { 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE }, { 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 }, { 0x15e4, 0x3f0a, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 }, { 0x15e4, 0x3f10, "Batarang Xbox 360 controller", 0, XTYPE_XBOX360 },
@@ -308,6 +309,7 @@ static struct usb_device_id xpad_table[] = {XPAD_XBOX360_VENDOR (0x1689 ),/* Razer Onza */ XPAD_XBOX360_VENDOR (0x24c6 ),/* PowerA Controllers */ XPAD_XBOX360_VENDOR (0x1532 ),/* Razer Sabertooth */ +XPAD_XBOXONE_VENDOR (0x1532 ),/* Razer Wildcat */ XPAD_XBOX360_VENDOR (0x15e4 ),/* Numark X-Box 360 controllers */ XPAD_XBOX360_VENDOR(0x162e), /* Joytech X-Box 360 controllers */ { }
drivers/input/misc/cm109.c +4 -0
@@ -675,6 +675,10 @@ static int cm109_usb_probe(struct usb_interface *intf,int error = -ENOMEM ; interface = intf->cur_altsetting; + +if (interface->desc.bNumEndpoints <1 ) +return -ENODEV ; + endpoint = &interface->endpoint[0 ].desc;if (!usb_endpoint_is_int_in (endpoint))
drivers/input/misc/ims-pcu.c +4 -0
@@ -1667,6 +1667,10 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pcreturn -EINVAL ; alt = pcu->ctrl_intf->cur_altsetting; + +if (alt->desc.bNumEndpoints <1 ) +return -ENODEV ; + pcu->ep_ctrl = &alt->endpoint[0 ].desc; pcu->max_ctrl_size =usb_endpoint_maxp (pcu->ep_ctrl);
drivers/input/misc/yealink.c +4 -0
@@ -875,6 +875,10 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)int ret, pipe, i; interface = intf->cur_altsetting; + +if (interface->desc.bNumEndpoints <1 ) +return -ENODEV ; + endpoint = &interface->endpoint[0 ].desc;if (!usb_endpoint_is_int_in (endpoint))return -ENODEV ;
drivers/input/serio/i8042-x86ia64io.h +7 -0
@@ -120,6 +120,13 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { }, }, { +/* Dell Embedded Box PC 3000 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"), + }, + }, + {/* OQO Model 01 */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
drivers/input/tablet/hanwang.c +3 -0
@@ -340,6 +340,9 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_idint error;int i; +if (intf->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; + hanwang =kzalloc (sizeof (struct hanwang ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!hanwang || !input_dev) {
drivers/input/tablet/kbtab.c +3 -0
@@ -122,6 +122,9 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *istruct input_dev *input_dev;int error = -ENOMEM ; +if (intf->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; + kbtab =kzalloc (sizeof (struct kbtab ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!kbtab || !input_dev)
drivers/input/touchscreen/sur40.c +3 -0
@@ -361,6 +361,9 @@ static int sur40_probe(struct usb_interface *interface,if (iface_desc->desc.bInterfaceClass !=0xFF )return -ENODEV ; +if (iface_desc->desc.bNumEndpoints <5 ) +return -ENODEV ; +/* Use endpoint #4 (0x86). */ endpoint = &iface_desc->endpoint[4 ].desc;if (endpoint->bEndpointAddress !=TOUCH_ENDPOINT )
drivers/iommu/intel-iommu.c +1 -1
@@ -719,7 +719,7 @@ static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devf* which we used for the IOMMU lookup. Strictly speaking * we could do this for all PCI devices; we only need to * get the BDF# from the scope table for ACPI matches. */ -if (pdev->is_virtfn) +if (pdev && pdev->is_virtfn) goto got_pdev; *bus = drhd->devices[i].bus;
drivers/isdn/gigaset/bas-gigaset.c +3 -0
@@ -2317,6 +2317,9 @@ static int gigaset_probe(struct usb_interface *interface,return -ENODEV ; } +if (hostif->desc.bNumEndpoints <1 ) +return -ENODEV ; + dev_info(&udev->dev, "%s: Device matched (Vendor: 0x%x, Product: 0x%x)\n", __func__, le16_to_cpu(udev->descriptor.idVendor),
drivers/md/raid10.c +18 -0
@@ -1578,7 +1578,25 @@ static void make_request(struct mddev *mddev, struct bio *bio) split = bio; } +/* +* If a bio is splitted, the first part of bio will pass +* barrier but the bio is queued in current->bio_list (see +* generic_make_request). If there is a raise_barrier() called +* here, the second part of bio can't pass barrier. But since +* the first part bio isn't dispatched to underlaying disks +* yet, the barrier is never released, hence raise_barrier will +* alays wait. We have a deadlock. +* Note, this only happens in read path. For write path, the +* first part of bio is dispatched in a schedule() call +* (because of blk plug) or offloaded to raid10d. +* Quitting from the function immediately can change the bio +* order queued in bio_list and avoid the deadlock. +*/ __make_request (mddev, split); +if (split != bio &&bio_data_dir (bio) ==READ ) { +generic_make_request (bio); +break ; + } }while (split != bio);/* In case raid10d snuck in to freeze_array */
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +6 -4
@@ -952,8 +952,9 @@ EXPORT_SYMBOL(dvb_usbv2_probe);void dvb_usbv2_disconnect (struct usb_interface *intf) {struct dvb_usb_device *d =usb_get_intfdata (intf); -const char *name = d->name; -struct device dev = d->udev->dev; +const char *devname =kstrdup (dev_name (&d->udev->dev),GFP_KERNEL ); +const char *drvname = d->name; +dev_dbg (&d->udev->dev,"%s: bInterfaceNumber=%d\n" , __func__, intf->cur_altsetting->desc.bInterfaceNumber);
@@ -962,8 +963,9 @@ void dvb_usbv2_disconnect(struct usb_interface *intf)dvb_usbv2_exit (d); -dev_info (&dev,"%s: '%s' successfully deinitialized and disconnected\n" , -KBUILD_MODNAME , name); +pr_info ("%s: '%s:%s' successfully deinitialized and disconnected\n" , +KBUILD_MODNAME , drvname, devname); +kfree (devname); }EXPORT_SYMBOL (dvb_usbv2_disconnect);
drivers/media/usb/dvb-usb/dvb-usb-firmware.c +21 -12
@@ -35,42 +35,51 @@ static int usb_cypress_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 leint usb_cypress_load_firmware (struct usb_device *udev,const struct firmware *fw,int type) { -struct hexline hx; -u8 reset; -int ret,pos=0 ; +struct hexline *hx; +u8 *buf; +int ret, pos =0 ; +u16 cpu_cs_register = cypress[type].cpu_cs_register; + + buf =kmalloc (sizeof (*hx),GFP_KERNEL ); +if (!buf) +return -ENOMEM ; + hx = (struct hexline *)buf;/* stop the CPU */ - reset =1 ; -if ((ret =usb_cypress_writemem (udev,cypress[type].cpu_cs_register,&reset,1 )) !=1 ) + buf[0 ] =1 ; +if (usb_cypress_writemem (udev, cpu_cs_register, buf,1 ) !=1 )err ("could not stop the USB controller CPU." ); -while ((ret =dvb_usb_get_hexline (fw,&hx,&pos)) >0 ) { -deb_fw ("writing to address 0x%04x (buffer: 0x%02x %02x)\n" ,hx.addr,hx.len,hx.chk); - ret =usb_cypress_writemem (udev,hx.addr,hx.data,hx.len); +while ((ret =dvb_usb_get_hexline (fw, hx, &pos)) >0 ) { +deb_fw ("writing to address 0x%04x (buffer: 0x%02x %02x)\n" , hx->addr, hx->len, hx->chk); + ret =usb_cypress_writemem (udev, hx->addr, hx->data, hx->len); -if (ret != hx.len) { +if (ret != hx->len) {err ("error while transferring firmware " "(transferred size: %d, block size: %d)" , - ret,hx.len); + ret, hx->len); ret = -EINVAL ;break ; } }if (ret <0 ) {err ("firmware download failed at %d with %d" ,pos,ret); +kfree (buf);return ret; }if (ret ==0 ) {/* restart the CPU */ - reset =0 ; -if (ret ||usb_cypress_writemem (udev,cypress[type].cpu_cs_register,&reset,1 ) !=1 ) { + buf[0 ] =0 ; +if (usb_cypress_writemem (udev, cpu_cs_register, buf,1 ) !=1 ) {err ("could not restart the USB controller CPU." ); ret = -EINVAL ; } }else ret = -EIO ; +kfree (buf); +return ret; }EXPORT_SYMBOL (usb_cypress_load_firmware);
drivers/media/usb/uvc/uvc_driver.c +112 -6
139 lines not on this page · raw message
drivers/mmc/host/sdhci.c +3 -1
@@ -1232,7 +1232,9 @@ clock_set:return ; } timeout--; -mdelay (1 ); +spin_unlock_irq (&host->lock); +usleep_range (900 ,1100 ); +spin_lock_irq (&host->lock); } clk |=SDHCI_CLOCK_CARD_EN ;
drivers/mmc/host/ushc.c +3 -0
@@ -426,6 +426,9 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *idstruct ushc_data *ushc;int ret; +if (intf->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; + mmc =mmc_alloc_host (sizeof (struct ushc_data ), &intf->dev);if (mmc ==NULL )return -ENOMEM ;
drivers/mtd/bcm47xxpart.c +4 -6
@@ -183,12 +183,10 @@ static int bcm47xxpart_parse(struct mtd_info *master, last_trx_part = curr_part -1 ; -/* -* We have whole TRX scanned, skip to the next part. Use -* roundown (not roundup), as the loop will increase -* offset in next step. -*/ - offset =rounddown (offset + trx->length, blocksize); +/* Jump to the end of TRX */ + offset =roundup (offset + trx->length, blocksize); +/* Next loop iteration will increase the offset */ + offset -= blocksize;continue ; }
drivers/net/ethernet/broadcom/genet/bcmgenet.c +4 -2
@@ -2695,7 +2695,8 @@ static int bcmgenet_suspend(struct device *d)bcmgenet_netif_stop (dev); -phy_suspend (priv->phydev); +if (!device_may_wakeup (d)) +phy_suspend (priv->phydev);netif_device_detach (dev);
@@ -2784,7 +2785,8 @@ static int bcmgenet_resume(struct device *d)netif_device_attach (dev); -phy_resume (priv->phydev); +if (!device_may_wakeup (d)) +phy_resume (priv->phydev);bcmgenet_netif_start (dev);
drivers/net/ethernet/intel/igb/e1000_phy.c +4 -0
@@ -83,6 +83,10 @@ s32 igb_get_phy_id(struct e1000_hw *hw)s32 ret_val =0 ;u16 phy_id; +/* ensure PHY page selection to fix misconfigured i210 */ +if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) + phy->ops.write_reg (hw,I347AT4_PAGE_SELECT ,0 ); + ret_val = phy->ops.read_reg (hw,PHY_ID1 , &phy_id);if (ret_val) goto out;
drivers/net/ethernet/mellanox/mlx5/core/main.c +1 -1
@@ -86,7 +86,7 @@ static struct mlx5_profile profile[] = { [2] = { .mask =MLX5_PROF_MASK_QP_SIZE | MLX5_PROF_MASK_MR_CACHE, - .log_max_qp = 17, + .log_max_qp = 18, .mr_cache[0] = { .size = 500, .limit =250
drivers/net/usb/catc.c +34 -22
90 lines not on this page · raw message
drivers/net/usb/pegasus.c +25 -4
@@ -126,40 +126,61 @@ static void async_ctrl_callback(struct urb *urb)static int get_registers (pegasus_t *pegasus,__u16 indx,__u16 size,void *data) { +u8 *buf;int ret; + buf =kmalloc (size,GFP_NOIO ); +if (!buf) +return -ENOMEM ; + ret =usb_control_msg (pegasus->usb,usb_rcvctrlpipe (pegasus->usb,0 ),PEGASUS_REQ_GET_REGS ,PEGASUS_REQT_READ ,0 , - indx, data, size,1000 ); + indx, buf, size,1000 );if (ret <0 )netif_dbg (pegasus, drv, pegasus->net,"%s returned %d\n" , __func__, ret); +else if (ret <= size) +memcpy (data, buf, ret); +kfree (buf);return ret; } -static int set_registers (pegasus_t *pegasus,__u16 indx,__u16 size,void *data) +static int set_registers (pegasus_t *pegasus,__u16 indx,__u16 size, +const void *data) { +u8 *buf;int ret; + buf =kmemdup (data, size,GFP_NOIO ); +if (!buf) +return -ENOMEM ; + ret =usb_control_msg (pegasus->usb,usb_sndctrlpipe (pegasus->usb,0 ),PEGASUS_REQ_SET_REGS ,PEGASUS_REQT_WRITE ,0 , - indx, data, size,100 ); + indx, buf, size,100 );if (ret <0 )netif_dbg (pegasus, drv, pegasus->net,"%s returned %d\n" , __func__, ret); +kfree (buf);return ret; }static int set_register (pegasus_t *pegasus,__u16 indx,__u8 data) { +u8 *buf;int ret; + buf =kmemdup (&data,1 ,GFP_NOIO ); +if (!buf) +return -ENOMEM ; + ret =usb_control_msg (pegasus->usb,usb_sndctrlpipe (pegasus->usb,0 ),PEGASUS_REQ_SET_REG ,PEGASUS_REQT_WRITE , data, - indx, &data,1 ,1000 ); + indx, buf,1 ,1000 );if (ret <0 )netif_dbg (pegasus, drv, pegasus->net,"%s returned %d\n" , __func__, ret); +kfree (buf);return ret; }
drivers/net/usb/rtl8150.c +27 -7
@@ -155,16 +155,36 @@ static const char driver_name [] = "rtl8150";*/ static int get_registers (rtl8150_t * dev,u16 indx,u16 size,void *data) { -return usb_control_msg (dev->udev,usb_rcvctrlpipe (dev->udev,0 ), -RTL8150_REQ_GET_REGS ,RTL8150_REQT_READ , - indx,0 , data, size,500 ); +void *buf; +int ret; + + buf =kmalloc (size,GFP_NOIO ); +if (!buf) +return -ENOMEM ; + + ret =usb_control_msg (dev->udev,usb_rcvctrlpipe (dev->udev,0 ), +RTL8150_REQ_GET_REGS ,RTL8150_REQT_READ , + indx,0 , buf, size,500 ); +if (ret >0 && ret <= size) +memcpy (data, buf, ret); +kfree (buf); +return ret; } -static int set_registers (rtl8150_t * dev,u16 indx,u16 size,void *data) +static int set_registers (rtl8150_t * dev,u16 indx,u16 size,const void *data) { -return usb_control_msg (dev->udev,usb_sndctrlpipe (dev->udev,0 ), -RTL8150_REQ_SET_REGS ,RTL8150_REQT_WRITE , - indx,0 , data, size,500 ); +void *buf; +int ret; + + buf =kmemdup (data, size,GFP_NOIO ); +if (!buf) +return -ENOMEM ; + + ret =usb_control_msg (dev->udev,usb_sndctrlpipe (dev->udev,0 ), +RTL8150_REQ_SET_REGS ,RTL8150_REQT_WRITE , + indx,0 , buf, size,500 ); +kfree (buf); +return ret; }static void async_set_reg_cb (struct urb *urb)
drivers/pinctrl/qcom/pinctrl-msm.c +0 -4
@@ -616,10 +616,6 @@ static void msm_gpio_irq_unmask(struct irq_data *d)spin_lock_irqsave (&pctrl->lock, flags); - val =readl (pctrl->regs + g->intr_status_reg); - val &= ~BIT (g->intr_status_bit); -writel (val, pctrl->regs + g->intr_status_reg); - val =readl (pctrl->regs + g->intr_cfg_reg); val |=BIT (g->intr_enable_bit);writel (val, pctrl->regs + g->intr_cfg_reg);
drivers/platform/x86/acer-wmi.c +18 -4
@@ -1867,11 +1867,24 @@ static int __init acer_wmi_enable_lm(void)return status; } +#define ACER_WMID_ACCEL_HID "BST0001" +static acpi_status __init acer_wmi_get_handle_cb (acpi_handle ah,u32 level,void *ctx,void **retval) { +struct acpi_device *dev; + +if (!strcmp (ctx,"SENR" )) { +if (acpi_bus_get_device (ah, &dev)) +return AE_OK ; +if (!strcmp (ACER_WMID_ACCEL_HID ,acpi_device_hid (dev))) +return AE_OK ; + }else +return AE_OK ; + *(acpi_handle *)retval = ah; -return AE_OK ; + +return AE_CTRL_TERMINATE ; } static int __init acer_wmi_get_handle(const char *name, const char *prop,
@@ -1898,7 +1911,7 @@ static int __init acer_wmi_accel_setup(void) {int err; - err =acer_wmi_get_handle ("SENR" ,"BST0001" , &gsensor_handle); + err =acer_wmi_get_handle ("SENR" ,ACER_WMID_ACCEL_HID , &gsensor_handle);if (err)return err;
@@ -2274,10 +2287,11 @@ static int __init acer_wmi_init(void) err =acer_wmi_input_setup ();if (err)return err; + err =acer_wmi_accel_setup (); +if (err) +return err; } -acer_wmi_accel_setup (); - err =platform_driver_register (&acer_platform_driver);if (err) {pr_err ("Unable to register platform driver\n" );
drivers/rtc/rtc-s35390a.c +131 -36
245 lines not on this page · raw message
drivers/rtc/rtc-tegra.c +26 -2
@@ -18,6 +18,7 @@* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <linux/kernel.h> +#include <linux/clk.h> #include <linux/init.h> #include <linux/module.h> #include <linux/slab.h>
@@ -59,6 +60,7 @@ struct tegra_rtc_info {struct platform_device *pdev;struct rtc_device *rtc_dev;void __iomem *rtc_base;/* NULL if not initialized. */ +struct clk *clk;int tegra_rtc_irq;/* alarm and periodic irq */ spinlock_t tegra_rtc_lock; };
@@ -330,6 +332,14 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)if (info->tegra_rtc_irq <=0 )return -EBUSY ; + info->clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (info->clk)) +return PTR_ERR (info->clk); + + ret =clk_prepare_enable (info->clk); +if (ret <0 ) +return ret; +/* set context info. */ info->pdev = pdev;spin_lock_init (&info->tegra_rtc_lock);
@@ -350,7 +360,7 @@ static int __init tegra_rtc_probe(struct platform_device *pdev) ret =PTR_ERR (info->rtc_dev);dev_err (&pdev->dev,"Unable to register device (err=%d).\n" , ret); -return ret; + goto disable_clk; } ret = devm_request_irq(&pdev->dev, info->tegra_rtc_irq,
@@ -360,12 +370,25 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)dev_err (&pdev->dev,"Unable to request interrupt for device (err=%d).\n" , ret); -return ret; + goto disable_clk; }dev_notice (&pdev->dev,"Tegra internal Real Time Clock\n" );return 0 ; + +disable_clk: +clk_disable_unprepare (info->clk); +return ret; +} + +static int tegra_rtc_remove (struct platform_device *pdev) +{ +struct tegra_rtc_info *info =platform_get_drvdata (pdev); + +clk_disable_unprepare (info->clk); + +return 0 ; }#ifdef CONFIG_PM_SLEEP
@@ -417,6 +440,7 @@ static void tegra_rtc_shutdown(struct platform_device *pdev)MODULE_ALIAS ("platform:tegra_rtc" );static struct platform_driver tegra_rtc_driver = { + .remove = tegra_rtc_remove, .shutdown = tegra_rtc_shutdown, .driver = { .name ="tegra_rtc" ,
drivers/scsi/libiscsi.c +25 -1
@@ -560,8 +560,12 @@ static void iscsi_complete_task(struct iscsi_task *task, int state)WARN_ON_ONCE (task->state ==ISCSI_TASK_FREE ); task->state = state; -if (!list_empty (&task->running)) +spin_lock_bh (&conn->taskqueuelock); +if (!list_empty (&task->running)) { +pr_debug_once ("%s while task on list" , __func__);list_del_init (&task->running); + } +spin_unlock_bh (&conn->taskqueuelock);if (conn->task == task) conn->task =NULL ;
@@ -783,7 +787,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,if (session->tt->xmit_task (task)) goto free_task; }else { +spin_lock_bh (&conn->taskqueuelock);list_add_tail (&task->running, &conn->mgmtqueue); +spin_unlock_bh (&conn->taskqueuelock);iscsi_conn_queue_work (conn); }
@@ -1474,8 +1480,10 @@ void iscsi_requeue_task(struct iscsi_task *task)* this may be on the requeue list already if the xmit_task callout * is handling the r2ts while we are adding new ones */ +spin_lock_bh (&conn->taskqueuelock);if (list_empty (&task->running))list_add_tail (&task->running, &conn->requeue); +spin_unlock_bh (&conn->taskqueuelock);iscsi_conn_queue_work (conn); }EXPORT_SYMBOL_GPL (iscsi_requeue_task);
@@ -1512,22 +1520,26 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)* only have one nop-out as a ping from us and targets should not * overflow us with nop-ins */ +spin_lock_bh (&conn->taskqueuelock); check_mgmt:while (!list_empty (&conn->mgmtqueue)) { conn->task =list_entry (conn->mgmtqueue.next, struct iscsi_task, running);list_del_init (&conn->task->running); +spin_unlock_bh (&conn->taskqueuelock);if (iscsi_prep_mgmt_task (conn, conn->task)) {/* regular RX path uses back_lock */ spin_lock_bh (&conn->session->back_lock);__iscsi_put_task (conn->task);spin_unlock_bh (&conn->session->back_lock); conn->task =NULL ; +spin_lock_bh (&conn->taskqueuelock);continue ; } rc =iscsi_xmit_task (conn);if (rc) goto done; +spin_lock_bh (&conn->taskqueuelock); }/* process pending command queue */
@@ -1535,19 +1547,24 @@ check_mgmt: conn->task = list_entry(conn->cmdqueue.next, struct iscsi_task, running);list_del_init (&conn->task->running); +spin_unlock_bh (&conn->taskqueuelock);if (conn->session->state ==ISCSI_STATE_LOGGING_OUT ) {fail_scsi_task (conn->task,DID_IMM_RETRY ); +spin_lock_bh (&conn->taskqueuelock);continue ; } rc =iscsi_prep_scsi_cmd_pdu (conn->task);if (rc) {if (rc == -ENOMEM || rc == -EACCES ) { +spin_lock_bh (&conn->taskqueuelock);list_add_tail (&conn->task->running, &conn->cmdqueue); conn->task =NULL ; +spin_unlock_bh (&conn->taskqueuelock); goto done; }else fail_scsi_task (conn->task,DID_ABORT ); +spin_lock_bh (&conn->taskqueuelock);continue ; } rc =iscsi_xmit_task (conn);
@@ -1558,6 +1575,7 @@ check_mgmt:* we need to check the mgmt queue for nops that need to * be sent to aviod starvation */ +spin_lock_bh (&conn->taskqueuelock);if (!list_empty (&conn->mgmtqueue)) goto check_mgmt; }
@@ -1577,12 +1595,15 @@ check_mgmt: conn->task = task;list_del_init (&conn->task->running); conn->task->state =ISCSI_TASK_RUNNING ; +spin_unlock_bh (&conn->taskqueuelock); rc =iscsi_xmit_task (conn);if (rc) goto done; +spin_lock_bh (&conn->taskqueuelock);if (!list_empty (&conn->mgmtqueue)) goto check_mgmt; } +spin_unlock_bh (&conn->taskqueuelock);spin_unlock_bh (&conn->session->frwd_lock);return -ENODATA ;
@@ -1738,7 +1759,9 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) goto prepd_reject; } }else { +spin_lock_bh (&conn->taskqueuelock);list_add_tail (&task->running, &conn->cmdqueue); +spin_unlock_bh (&conn->taskqueuelock);iscsi_conn_queue_work (conn); }
@@ -2917,6 +2940,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,INIT_LIST_HEAD (&conn->mgmtqueue);INIT_LIST_HEAD (&conn->cmdqueue);INIT_LIST_HEAD (&conn->requeue); +spin_lock_init (&conn->taskqueuelock);INIT_WORK (&conn->xmitwork, iscsi_xmitworker);/* allocate login_task used for the login/text sequences */
drivers/scsi/libsas/sas_ata.c +1 -1
@@ -219,7 +219,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) task->num_scatter = qc->n_elem; }else {for_each_sg (qc->sg, sg, qc->n_elem, si) - xfer += sg->length; + xfer +=sg_dma_len (sg); task->total_xfer_len = xfer; task->num_scatter = si;
drivers/scsi/lpfc/lpfc_init.c +1 -0
@@ -11249,6 +11249,7 @@ static struct pci_driver lpfc_driver = { .id_table = lpfc_id_table, .probe = lpfc_pci_probe_one, .remove = lpfc_pci_remove_one, + .shutdown = lpfc_pci_remove_one, .suspend = lpfc_pci_suspend_one, .resume = lpfc_pci_resume_one, .err_handler = &lpfc_err_handler,
drivers/scsi/sd.c +18 -2
@@ -1979,6 +1979,22 @@ static void read_capacity_error(struct scsi_disk *sdkp, struct scsi_device *sdp,#define READ_CAPACITY_RETRIES_ON_RESET 10 +/* +* Ensure that we don't overflow sector_t when CONFIG_LBDAF is not set +* and the reported logical block size is bigger than 512 bytes. Note +* that last_sector is a u64 and therefore logical_to_sectors() is not +* applicable. +*/ +static bool sd_addressable_capacity (u64 lba,unsigned int sector_size) +{ +u64 last_sector = (lba +1ULL ) << (ilog2 (sector_size) -9 ); + +if (sizeof (sector_t) ==4 && last_sector >U32_MAX ) +return false; + +return true; +} +static int read_capacity_16 (struct scsi_disk *sdkp,struct scsi_device *sdp,unsigned char *buffer) {
@@ -2044,7 +2060,7 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp,return -ENODEV ; } -if ((sizeof (sdkp->capacity) ==4 ) && (lba >=0xffffffffULL )) { +if (!sd_addressable_capacity (lba, sector_size)) {sd_printk (KERN_ERR , sdkp,"Too big for this kernel. Use a " "kernel compiled with support for large block " "devices.\n" );
@@ -2130,7 +2146,7 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,return sector_size; } -if ((sizeof (sdkp->capacity) ==4 ) && (lba ==0xffffffff )) { +if (!sd_addressable_capacity (lba, sector_size)) {sd_printk (KERN_ERR , sdkp,"Too big for this kernel. Use a " "kernel compiled with support for large block " "devices.\n" );
drivers/scsi/sg.c +2 -0
@@ -1017,6 +1017,8 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) result =get_user (val, ip);if (result)return result; +if (val >SG_MAX_CDB_SIZE ) +return -ENOMEM ; sfp->next_cmd_len = (val >0 ) ? val :0 ;return 0 ;case SG_GET_VERSION_NUM :
drivers/scsi/sr.c +4 -2
@@ -839,6 +839,7 @@ static void get_capabilities(struct scsi_cd *cd)unsigned char *buffer;struct scsi_mode_data data;struct scsi_sense_hdr sshdr; +unsigned int ms_len =128 ;int rc, n; static const char *loadmech[] =
@@ -865,10 +866,11 @@ static void get_capabilities(struct scsi_cd *cd)scsi_test_unit_ready (cd->device,SR_TIMEOUT ,MAX_RETRIES , &sshdr);/* ask for mode page 0x2a */ - rc =scsi_mode_sense (cd->device,0 ,0x2a , buffer,128 , + rc =scsi_mode_sense (cd->device,0 ,0x2a , buffer, ms_len,SR_TIMEOUT ,3 , &data,NULL ); -if (!scsi_status_is_good (rc)) { +if (!scsi_status_is_good (rc) || data.length > ms_len || + data.header_length + data.block_descriptor_length > data.length) {/* failed, drive doesn't have capabilities mode page */ cd->cdi.speed =1 ; cd->cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R |
drivers/target/iscsi/iscsi_target_parameters.c +0 -16
@@ -804,22 +804,6 @@ static void iscsi_check_proposer_for_optional_reply(struct iscsi_param *param)if (!strcmp (param->name,MAXRECVDATASEGMENTLENGTH ))SET_PSTATE_REPLY_OPTIONAL (param);/* -* The GlobalSAN iSCSI Initiator for MacOSX does -* not respond to MaxBurstLength, FirstBurstLength, -* DefaultTime2Wait or DefaultTime2Retain parameter keys. -* So, we set them to 'reply optional' here, and assume the -* the defaults from iscsi_parameters.h if the initiator -* is not RFC compliant and the keys are not negotiated. -*/ -if (!strcmp (param->name,MAXBURSTLENGTH )) -SET_PSTATE_REPLY_OPTIONAL (param); -if (!strcmp (param->name,FIRSTBURSTLENGTH )) -SET_PSTATE_REPLY_OPTIONAL (param); -if (!strcmp (param->name,DEFAULTTIME2WAIT )) -SET_PSTATE_REPLY_OPTIONAL (param); -if (!strcmp (param->name,DEFAULTTIME2RETAIN )) -SET_PSTATE_REPLY_OPTIONAL (param); -/* * Required for gPXE iSCSI boot client */ if (!strcmp (param->name,MAXCONNECTIONS ))
drivers/target/iscsi/iscsi_target_util.c +7 -5
@@ -731,21 +731,23 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) {struct se_cmd *se_cmd =NULL ;int rc; +bool op_scsi = false;/* * Determine if a struct se_cmd is associated with * this struct iscsi_cmd. */ switch (cmd->iscsi_opcode) {case ISCSI_OP_SCSI_CMD : - se_cmd = &cmd->se_cmd; -__iscsit_free_cmd (cmd, true, shutdown); + op_scsi = true;/* * Fallthrough */ case ISCSI_OP_SCSI_TMFUNC : - rc =transport_generic_free_cmd (&cmd->se_cmd, shutdown); -if (!rc && shutdown && se_cmd && se_cmd->se_sess) { -__iscsit_free_cmd (cmd, true, shutdown); + se_cmd = &cmd->se_cmd; +__iscsit_free_cmd (cmd, op_scsi, shutdown); + rc =transport_generic_free_cmd (se_cmd, shutdown); +if (!rc && shutdown && se_cmd->se_sess) { +__iscsit_free_cmd (cmd, op_scsi, shutdown);target_put_sess_cmd (se_cmd); }break ;
drivers/target/target_core_pscsi.c +12 -35
81 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.