Linux 3.18.123
Greg KH
maintainerI'm announcing the release of the 3.18.124 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/mach-mvebu/pmsu.c | 6 - arch/arm64/include/asm/kvm_emulate.h | 5 + arch/arm64/kernel/entry.S | 3 arch/arm64/kvm/guest.c | 55 +++++++++++++++ arch/hexagon/include/asm/bitops.h | 4 - arch/hexagon/kernel/dma.c | 2 arch/powerpc/kernel/machine_kexec.c | 7 +- arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 arch/s390/mm/extmem.c | 4 - arch/x86/kernel/tsc_msr.c | 1 arch/x86/mm/numa_emulation.c | 2 arch/x86/vdso/vclock_gettime.c | 26 ++++--- crypto/ablkcipher.c | 2 crypto/blkcipher.c | 1 drivers/base/power/main.c | 5 + drivers/block/floppy.c | 3 drivers/crypto/mxs-dcp.c | 53 ++++++++------- drivers/gpio/gpio-adp5588.c | 24 +++++- drivers/hid/hid-core.c | 3 drivers/hid/hid-ids.h | 2 drivers/hid/hid-ntrig.c | 2 drivers/hid/hid-sony.c | 6 + drivers/hwmon/adt7475.c | 14 ++-- drivers/infiniband/core/ucma.c | 6 + drivers/md/dm-thin-metadata.c | 34 +++++++++ drivers/md/dm-thin.c | 73 ++++++++++++++++++--- drivers/md/raid10.c | 5 + drivers/media/i2c/soc_camera/ov772x.c | 2 drivers/media/platform/exynos4-is/fimc-isp-video.c | 11 ++- drivers/media/platform/s3c-camif/camif-capture.c | 2 drivers/media/usb/tm6000/tm6000-dvb.c | 5 + drivers/media/usb/uvc/uvc_video.c | 24 +++++- drivers/media/v4l2-core/v4l2-event.c | 37 +++++----- drivers/media/v4l2-core/v4l2-fh.c | 2 drivers/misc/tsl2550.c | 2 drivers/mtd/spi-nor/fsl-quadspi.c | 20 ++--- drivers/net/appletalk/ipddp.c | 8 +- drivers/net/ethernet/cadence/macb.c | 2 drivers/net/ethernet/hp/hp100.c | 2 drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 7 +- drivers/net/ethernet/realtek/r8169.c | 9 +- drivers/net/wireless/rndis_wlan.c | 2 drivers/net/wireless/ti/wlcore/cmd.c | 6 + drivers/pci/pci.c | 27 +++++-- drivers/s390/net/qeth_l2_main.c | 2 drivers/s390/net/qeth_l3_main.c | 2 drivers/scsi/bnx2i/bnx2i_hwi.c | 2 drivers/scsi/ibmvscsi/ibmvscsi.c | 4 - drivers/spi/spi-rspi.c | 10 +- drivers/spi/spi-sh-msiof.c | 3 drivers/spi/spi-tegra20-slink.c | 31 ++++++-- drivers/staging/android/ashmem.c | 6 + drivers/staging/android/ion/ion.c | 60 ++++++++++------- drivers/target/iscsi/iscsi_target_auth.c | 45 ++++-------- drivers/target/iscsi/iscsi_target_tpg.c | 3 drivers/thermal/of-thermal.c | 7 +- drivers/tty/serial/8250/serial_cs.c | 6 + drivers/tty/serial/cpm_uart/cpm_uart_core.c | 10 ++ drivers/usb/class/cdc-wdm.c | 2 drivers/usb/core/devio.c | 24 ++++++ drivers/usb/core/driver.c | 28 ++++---- drivers/usb/core/usb.c | 2 drivers/usb/misc/yurex.c | 3 drivers/usb/serial/kobil_sct.c | 12 ++- drivers/usb/serial/usb-serial-simple.c | 3 drivers/usb/wusbcore/security.c | 2 drivers/uwb/hwa-rc.c | 1 drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c | 5 + drivers/xen/events/events_base.c | 2 drivers/xen/manage.c | 6 + fs/cifs/cifs_unicode.c | 3 fs/cifs/cifssmb.c | 11 ++- fs/cifs/misc.c | 8 ++ fs/cifs/smb2ops.c | 2 fs/ext4/balloc.c | 21 +++--- fs/ext4/dir.c | 20 ++--- fs/ext4/ext4.h | 8 -- fs/ext4/ext4_extents.h | 1 fs/ext4/extents.c | 6 + fs/ext4/ialloc.c | 19 ++++- fs/ext4/inline.c | 42 +----------- fs/ext4/inode.c | 3 fs/ext4/mballoc.c | 6 + fs/ext4/mmp.c | 1 fs/ext4/resize.c | 20 +++++ fs/ext4/super.c | 14 +++- fs/ext4/xattr.c | 49 ++++++-------- fs/jbd2/transaction.c | 2 fs/nfsd/nfs4proc.c | 1 fs/ocfs2/buffer_head_io.c | 1 fs/ocfs2/dlm/dlmmaster.c | 4 - fs/proc/base.c | 14 ++++ fs/seq_file.c | 7 +- fs/ubifs/super.c | 3 include/linux/netfilter_bridge/ebtables.h | 5 + include/linux/seq_file.h | 13 +-- include/linux/slub_def.h | 3 include/media/v4l2-fh.h | 1 kernel/cgroup.c | 6 + kernel/module.c | 6 + kernel/time/alarmtimer.c | 3 kernel/trace/ring_buffer.c | 2 mm/madvise.c | 2 mm/shmem.c | 2 mm/slub.c | 6 - net/bridge/netfilter/ebt_arpreply.c | 3 net/core/neighbour.c | 13 ++- net/ipv4/af_inet.c | 1 net/ipv6/ip6_offload.c | 1 net/ipv6/ip6_output.c | 3 net/mac80211/cfg.c | 2 net/mac80211/ibss.c | 22 +++--- net/mac80211/main.c | 26 ++++++- net/mac80211/mlme.c | 53 +++++++++++++++ net/wireless/nl80211.c | 1 sound/aoa/core/gpio-feature.c | 4 - sound/firewire/bebob/bebob_maudio.c | 24 ++++-- sound/pci/emu10k1/emufx.c | 2 sound/pci/hda/hda_intel.c | 3 sound/soc/codecs/cs4265.c | 4 - sound/soc/soc-dapm.c | 7 ++ tools/vm/page-types.c | 6 - tools/vm/slabinfo.c | 4 - 124 files changed, 891 insertions(+), 404 deletions(-)
Akinobu Mita (2):
media: s3c-camif: ignore -ENOIOCTLCMD from v4l2_subdev_call for s_power
media: soc_camera: ov772x: correct setting of banding filter
Alan Stern (3):
USB: fix error handling in usb_driver_claim_interface()
USB: handle NULL config in usb_find_alt_setting()
USB: remove LPM management from usb_driver_claim_interface()
Alexey Dobriyan (1):
slub: make ->cpu_partial unsigned int
Alistair Strachan (1):
staging: android: ashmem: Fix mmap size validation
Andy Lutomirski (2):
x86/vdso: Fix asm constraints on vDSO syscall fallbacks x86/vdso: Fix vDSO syscall fallback asm constraint regression
Andy Shevchenko (1):
x86/tsc: Add missing header to tsc_msr.c
Andy Whitcroft (1):
floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl
Anson Huang (1):
thermal: of-thermal: disable passive polling when thermal zone is disabled
Anton Vasilyev (1):
uwb: hwa-rc: fix memory leak at probe
Arunk Khandavalli (1):
cfg80211: nl80211_update_ft_ies() to validate NL80211_ATTR_IE
Ashish Samant (1):
ocfs2: fix locking for res->tracking and dlm->tracking_list
Aurelien Aptel (1):
smb2: fix missing files in root share directory listing
Bart Van Assche (1):
scsi: target/iscsi: Make iscsit_ta_authentication() respect the output buffer size
Ben Hutchings (1):
USB: yurex: Check for truncation in yurex_read()
Bo Chen (2):
e1000: check on netif_running() before calling e1000_up()
e1000: ensure to free old tx/rx rings in set_ringparam()
Breno Leitao (1):
scsi: ibmvscsi: Improve strings handling
Catalin Marinas (1):
arm64: Add trace_hardirqs_off annotation in ret_to_user
Christophe Leroy (1):
serial: cpm_uart: return immediately from console poll
Colin Ian King (1):
net: hp100: fix always-true check for link up state
Dan Carpenter (3):
rndis_wlan: potential buffer overflow in rndis_wlan_auth_indication()
hwmon: (adt7475) Make adt7475_read_word() return errors
cifs: read overflow in is_valid_oplock_break()
Dan Williams (1):
x86/numa_emulation: Fix emulated-to-physical node mapping
Danek Duvall (1):
mac80211: correct use of IEEE80211_VHT_CAP_RXSTBC_X
Daniel Black (1):
mm: madvise(MADV_DODUMP): allow hugetlbfs pages
Daniel Drake (1):
PCI: Reprogram bridge prefetch registers on resume
Dave Martin (1):
arm64: KVM: Tighten guest core register access from userspace
Emmanuel Grumbach (2):
mac80211: fix a race between restart and CSA flows
mac80211: shorten the IBSS debug messages
Eric Dumazet (1):
ipv6: fix possible use-after-free in ip6_xmit()
Ethan Tuttle (1):
ARM: mvebu: declare asm symbols as character arrays in pmsu.c
Felix Fietkau (1):
mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys
Gao Feng (1):
ebtables: arpreply: Add the standard target sanity check
Geert Uytterhoeven (1):
spi: rspi: Fix interrupted DMA transfers
Greg Hackmann (1):
staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free
Greg Kroah-Hartman (1):
Linux 3.18.124
Han Xu (1):
mtd: fsl-quadspi: fix macro collision problems with READ/WRITE
Hari Bathini (1):
powerpc/kdump: Handle crashkernel memory reservation failure
Hiromitsu Yamasaki (1):
spi: sh-msiof: Fix handling of write value for SISTR register
Ilan Peer (1):
mac80211: Fix station bandwidth setting after channel switch
J. Bruce Fields (1):
nfsd: fix corrupted reply to badly ordered compound
Jann Horn (2):
RDMA/ucma: check fd type in ucma_migrate_id()
proc: restrict kernel stack dumps to root
Jessica Yu (1):
module: exclude SHN_UNDEF symbols from kallsyms api
Jia-Ju Bai (1):
net: cadence: Fix a sleep-in-atomic-context bug in macb_halt_tx()
Joe Thornber (1):
dm thin metadata: try to avoid ever aborting transactions
Joel Fernandes (Google) (1):
mm: shmem.c: Correctly annotate new inodes for lockdep
Johan Hovold (2):
USB: serial: kobil_sct: fix modem-status error handling
USB: serial: simple: add Motorola Tetra MTP6550 id
Jon Kuhn (1):
fs/cifs: don't translate SFM_SLASH (U+F026) to backslash
Josh Abraham (1):
xen: fix GCC warning and remove duplicate EVTCHN_ROW/EVTCHN_COL usage
Julia Lawall (1):
usb: wusbcore: security: cast sizeof to int for comparison
Julian Wiedmann (1):
s390/qeth: don't dump past end of unknown HW header
Junxiao Bi (1):
ocfs2: fix ocfs2 read block panic
Kai-Heng Feng (2):
ALSA: hda: Add AZX_DCAPS_PM_RUNTIME for AMD Raven Ridge
r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED
Leonard Crestez (1):
crypto: mxs-dcp - Fix wait logic on chan threads
Li Dongyang (1):
ext4: don't mark mmp buffer head dirty
Liam Girdwood (1):
ASoC: dapm: Fix potential DAI widget pointer deref when linking DAIs
Linus Torvalds (1):
Make file credentials available to the seqfile interfaces
Marc Zyngier (1):
arm64: KVM: Sanitize PSTATE.M when being set from userspace
Marcel Ziswiler (1):
spi: tegra20-slink: explicitly enable/disable clock
Matt Ranostay (1):
tsl2550: fix lux1_input error in low light
Michael Hennerich (1):
gpio: adp5588: Fix sleep-in-atomic-context bug
Mike Snitzer (1):
dm thin metadata: fix __udivdi3 undefined on 32-bit
Naoya Horiguchi (2):
tools/vm/slabinfo.c: fix sign-compare warning tools/vm/page-types.c: fix "defined but not used" warning
Nicholas Mc Guire (1):
ALSA: snd-aoa: add of_node_put() in error path
Oliver Neukum (2):
USB: usbdevfs: sanitize flags more
USB: usbdevfs: restore warning for nonsensical flags
Paul Mackerras (1):
KVM: PPC: Book3S HV: Don't truncate HPTE index in xlate function
Prateek Sood (1):
cgroup: Fix deadlock in cpu hotplug path
Rafael J. Wysocki (1):
PM / core: Clear the direct_complete flag on errors
Randy Dunlap (2):
arch/hexagon: fix kernel/dma.c build warning
hexagon: modify ffs() and fls() to return int
Richard Weinberger (1):
ubifs: Check for name being NULL while mounting
Roderick Colenbrander (2):
HID: sony: Update device ids
HID: sony: Support DS4 dongle
Sakari Ailus (1):
media: v4l: event: Prevent freeing event subscriptions while accessed
Sebastian Andrzej Siewior (1):
Revert "usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()"
Stafford Horne (1):
crypto: skcipher - Fix -Wstringop-truncation warnings
Stephen Rothwell (1):
fs/cifs: suppress a string overflow warning
Sylwester Nawrocki (1):
media: exynos4-is: Prevent NULL pointer dereference in __isp_video_try_fmt()
Sébastien Szymanski (1):
ASoC: cs4265: fix MMTLR Data switch control
Takashi Sakamoto (1):
ALSA: bebob: use address returned by kmalloc() instead of kernel stack for streaming DMA mapping
Theodore Ts'o (14):
ext4: avoid divide by zero fault when deleting corrupted inline directories
ext4: recalucate superblock checksum after updating free blocks/inodes
ext4: fix online resize's handling of a too-small final block group
ext4: verify the depth of extent tree in ext4_find_extent()
ext4: only look at the bg_flags field if it is valid
ext4: fix check to prevent initializing reserved inodes
ext4: always check block group bounds in ext4_init_block_bitmap()
ext4: fix false negatives *and* false positives in ext4_check_descriptors()
ext4: add corruption check in ext4_xattr_set_entry()
ext4: always verify the magic number in xattr blocks
ext4: never move the system.data xattr out of the inode body
ext4: add more inode number paranoia checks
jbd2: don't mark block as modified if the handle is out of credits
ext4: avoid running out of journal credits when appending to an inline file
Thomas Gleixner (1):
alarmtimer: Prevent overflow for relative nanosleep
Toke Høiland-Jørgensen (1):
gso_segment: Reset skb->mac_len after modifying network header
Tomi Valkeinen (1):
fbdev/omapfb: fix omapfb_memory_read infoleak
Tony Lindgren (1):
wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()
Vaibhav Nagarnaik (1):
ring-buffer: Allow for rescheduling when removing pages
Vasily Gorbik (1):
s390/extmem: fix gcc 8 stringop-overflow warning
Vasily Khoruzhick (1):
neighbour: confirm neigh entries when ARP packet is received
Vincent Pelletier (2):
scsi: target: iscsi: Use hex2bin instead of a re-implementation
scsi: target: iscsi: Use bin2hex instead of a re-implementation
Vitaly Kuznetsov (1):
xen/manage: don't complain about an empty value in control/sysrq node
Willy Tarreau (2):
ALSA: emu10k1: fix possible info leak to userspace on SNDRV_EMU10K1_IOCTL_INFO net/appletalk: fix minor pointer leak to userspace in SIOCFINDIPDDPRT
Xiao Ni (1):
RAID10 BUG_ON in raise_barrier when force is true and conf->barrier is 0
Zhouyang Jia (4):
drivers/tty: add error handling for pcmcia_loop_config
media: tm6000: add error handling for dvb_register_adapter
HID: hid-ntrig: add error handling for sysfs_create_group
scsi: bnx2i: add error handling for ioremap_nocache
ming_qian (1):
media: uvcvideo: Support realtek's UVC 1.5 device
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 123 +SUBLEVEL = 124 EXTRAVERSION = NAME = Diseased Newt
arch/arm/mach-mvebu/pmsu.c +3 -3
@@ -117,8 +117,8 @@ void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr) PMSU_BOOT_ADDR_REDIRECT_OFFSET(hw_cpu)); } -extern unsigned char mvebu_boot_wa_start; -extern unsigned char mvebu_boot_wa_end; +extern unsigned char mvebu_boot_wa_start[]; +extern unsigned char mvebu_boot_wa_end[];/* * This function sets up the boot address workaround needed for SMP
@@ -131,7 +131,7 @@ int mvebu_setup_boot_addr_wa(unsigned int crypto_eng_target, phys_addr_t resume_addr_reg) {void __iomem *sram_virt_base; -u32 code_len = &mvebu_boot_wa_end - &mvebu_boot_wa_start; +u32 code_len = mvebu_boot_wa_end - mvebu_boot_wa_start;mvebu_mbus_del_window (BOOTROM_BASE ,BOOTROM_SIZE ); mvebu_mbus_add_window_by_id(crypto_eng_target, crypto_eng_attribute,
arch/arm64/include/asm/kvm_emulate.h +5 -0
@@ -38,6 +38,11 @@ void kvm_inject_undefined(struct kvm_vcpu *vcpu);void kvm_inject_dabt (struct kvm_vcpu *vcpu,unsigned long addr);void kvm_inject_pabt (struct kvm_vcpu *vcpu,unsigned long addr); +static inline bool vcpu_el1_is_32bit (struct kvm_vcpu *vcpu) +{ +return !(vcpu->arch.hcr_el2 &HCR_RW ); +} +static inline void vcpu_reset_hcr (struct kvm_vcpu *vcpu) { vcpu->arch.hcr_el2 =HCR_GUEST_FLAGS ;
arch/arm64/kernel/entry.S +3 -0
@@ -633,6 +633,9 @@ work_pending: bl do_notify_resume b ret_to_user work_resched: +#ifdef CONFIG_TRACE_IRQFLAGS + bl trace_hardirqs_off // the IRQs are off here, inform the tracing code +#endif bl schedule /*
arch/arm64/kvm/guest.c +54 -1
89 lines not on this page · raw message
arch/hexagon/include/asm/bitops.h +2 -2
@@ -211,7 +211,7 @@ static inline long ffz(int x)* This is defined the same way as ffs. * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ -static inline long fls (int x) +static inline int fls (int x) {int r;
@@ -232,7 +232,7 @@ static inline long fls(int x)* the libc and compiler builtin ffs routines, therefore * differs in spirit from the above ffz (man ffs). */ -static inline long ffs (int x) +static inline int ffs (int x) {int r;
arch/hexagon/kernel/dma.c +1 -1
@@ -79,7 +79,7 @@ static void *hexagon_dma_alloc_coherent(struct device *dev, size_t size,panic ("Can't create %s() memory pool!" , __func__); else gen_pool_add(coherent_pool, -pfn_to_virt (max_low_pfn ), + (unsigned long )pfn_to_virt (max_low_pfn ), hexagon_coherent_pool_size, -1); }
arch/powerpc/kernel/machine_kexec.c +6 -1
@@ -186,7 +186,12 @@ void __init reserve_crashkernel(void) (unsigned long )(crashk_res.start >>20 ), (unsigned long)(memblock_phys_mem_size() >> 20)); -memblock_reserve (crashk_res.start, crash_size); +if (!memblock_is_region_memory (crashk_res.start, crash_size) || +memblock_reserve (crashk_res.start, crash_size)) { +pr_err ("Failed to reserve memory for crashkernel!\n" ); + crashk_res.start = crashk_res.end =0 ; +return ; + } }int overlaps_crashkernel (unsigned long start,unsigned long size)
arch/powerpc/kvm/book3s_64_mmu_hv.c +1 -1
@@ -449,7 +449,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,unsigned long pp, key;unsigned long v, gr;__be64 *hptep; -int index; +long int index;int virtmode = vcpu->arch.shregs.msr & (data ?MSR_DR :MSR_IR );/* Get SLB entry */
arch/s390/mm/extmem.c +2 -2
@@ -80,7 +80,7 @@ struct qin64 {struct dcss_segment {struct list_head list;char dcss_name[8 ]; -char res_name[15 ]; +char res_name[16 ];unsigned long start_addr;unsigned long end;atomic_t ref_count;
@@ -445,7 +445,7 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned longmemcpy (&seg->res_name, seg->dcss_name,8 );EBCASC (seg->res_name,8 ); seg->res_name[8 ] ='\0' ; -strncat (seg->res_name," (DCSS)" ,7 ); +strlcat (seg->res_name," (DCSS)" ,sizeof (seg->res_name)); seg->res->name = seg->res_name; rc = seg->vm_segtype; if (rc == SEG_TYPE_SC ||
arch/x86/kernel/tsc_msr.c +1 -0
@@ -21,6 +21,7 @@#include <asm/setup.h> #include <asm/apic.h> #include <asm/param.h> +#include <asm/tsc.h> /* CPU reference clock frequency: in KHz */ #define FREQ_83 83200
arch/x86/mm/numa_emulation.c +1 -1
@@ -60,7 +60,7 @@ static int __init emu_setup_memblk(struct numa_meminfo *ei, eb->nid = nid;if (emu_nid_to_phys[nid] ==NUMA_NO_NODE ) - emu_nid_to_phys[nid] = nid; + emu_nid_to_phys[nid] = pb->nid; pb->start += size;if (pb->start >= pb->end) {
arch/x86/vdso/vclock_gettime.c +14 -12
@@ -46,8 +46,9 @@ static notrace cycle_t vread_hpet(void) notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) {long ret; - asm("syscall" :"=a" (ret) : -"0" (__NR_clock_gettime),"D" (clock),"S" (ts) :"memory" ); + asm ("syscall" :"=a" (ret),"=m" (*ts) : +"0" (__NR_clock_gettime),"D" (clock),"S" (ts) : +"memory" ,"rcx" ,"r11" );return ret; }
@@ -55,8 +56,9 @@ notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz) {long ret; - asm("syscall" :"=a" (ret) : -"0" (__NR_gettimeofday),"D" (tv),"S" (tz) :"memory" ); + asm ("syscall" :"=a" (ret),"=m" (*tv),"=m" (*tz) : +"0" (__NR_gettimeofday),"D" (tv),"S" (tz) : +"memory" ,"rcx" ,"r11" );return ret; }
@@ -136,13 +138,13 @@ notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) {long ret; - asm( + asm ("mov %%ebx, %%edx \n" -"mov %2, %%ebx \n" +"mov %[clock], %%ebx \n" "call __kernel_vsyscall \n" "mov %%edx, %%ebx \n" - :"=a" (ret) - :"0" (__NR_clock_gettime),"g" (clock),"c" (ts) + :"=a" (ret),"=m" (*ts) + :"0" (__NR_clock_gettime), [clock]"g" (clock),"c" (ts) :"memory" ,"edx" );return ret; }
@@ -151,13 +153,13 @@ notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz) {long ret; - asm( + asm ("mov %%ebx, %%edx \n" -"mov %2, %%ebx \n" +"mov %[tv], %%ebx \n" "call __kernel_vsyscall \n" "mov %%edx, %%ebx \n" - :"=a" (ret) - :"0" (__NR_gettimeofday),"g" (tv),"c" (tz) + :"=a" (ret),"=m" (*tv),"=m" (*tz) + :"0" (__NR_gettimeofday), [tv]"g" (tv),"c" (tz) :"memory" ,"edx" );return ret; }
crypto/ablkcipher.c +2 -0
@@ -382,6 +382,7 @@ static int crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)strncpy (rblkcipher.type,"ablkcipher" ,sizeof (rblkcipher.type));strncpy (rblkcipher.geniv, alg->cra_ablkcipher.geniv ?:"<default>" ,sizeof (rblkcipher.geniv)); + rblkcipher.geniv[sizeof (rblkcipher.geniv) -1 ] ='\0' ; rblkcipher.blocksize = alg->cra_blocksize; rblkcipher.min_keysize = alg->cra_ablkcipher.min_keysize;
@@ -463,6 +464,7 @@ static int crypto_givcipher_report(struct sk_buff *skb, struct crypto_alg *alg)strncpy (rblkcipher.type,"givcipher" ,sizeof (rblkcipher.type));strncpy (rblkcipher.geniv, alg->cra_ablkcipher.geniv ?:"<built-in>" ,sizeof (rblkcipher.geniv)); + rblkcipher.geniv[sizeof (rblkcipher.geniv) -1 ] ='\0' ; rblkcipher.blocksize = alg->cra_blocksize; rblkcipher.min_keysize = alg->cra_ablkcipher.min_keysize;
crypto/blkcipher.c +1 -0
@@ -514,6 +514,7 @@ static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)strncpy (rblkcipher.type,"blkcipher" ,sizeof (rblkcipher.type));strncpy (rblkcipher.geniv, alg->cra_blkcipher.geniv ?:"<default>" ,sizeof (rblkcipher.geniv)); + rblkcipher.geniv[sizeof (rblkcipher.geniv) -1 ] ='\0' ; rblkcipher.blocksize = alg->cra_blocksize; rblkcipher.min_keysize = alg->cra_blkcipher.min_keysize;
drivers/base/power/main.c +4 -1
@@ -1341,8 +1341,10 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)dpm_wait_for_children (dev, async); -if (async_error) +if (async_error) { + dev->power.direct_complete = false; goto Complete; + }/* * If a device configured to wake up the system from sleep states
@@ -1354,6 +1356,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)pm_wakeup_event (dev,0 );if (pm_wakeup_pending ()) { + dev->power.direct_complete = false; async_error = -EBUSY ; goto Complete; }
drivers/block/floppy.c +3 -0
@@ -3459,6 +3459,9 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int (struct floppy_struct **)&outparam);if (ret)return ret; +memcpy (&inparam.g, outparam, + offsetof(struct floppy_struct , name)); + outparam = &inparam.g;break ;case FDMSGON :UDP ->flags |=FTD_MSG ;
drivers/crypto/mxs-dcp.c +30 -23
111 lines not on this page · raw message
drivers/gpio/gpio-adp5588.c +20 -4
@@ -41,6 +41,8 @@ struct adp5588_gpio {uint8_t int_en[3 ];uint8_t irq_mask[3 ];uint8_t irq_stat[3 ]; +uint8_t int_input_en[3 ]; +uint8_t int_lvl_cached[3 ]; };static int adp5588_gpio_read (struct i2c_client *client,u8 reg)
@@ -177,12 +179,28 @@ static void adp5588_irq_bus_sync_unlock(struct irq_data *d)struct adp5588_gpio *dev =irq_data_get_irq_chip_data (d);int i; -for (i =0 ; i <=ADP5588_BANK (ADP5588_MAXGPIO ); i++) +for (i =0 ; i <=ADP5588_BANK (ADP5588_MAXGPIO ); i++) { +if (dev->int_input_en[i]) { +mutex_lock (&dev->lock); + dev->dir[i] &= ~dev->int_input_en[i]; + dev->int_input_en[i] =0 ; +adp5588_gpio_write (dev->client,GPIO_DIR1 + i, + dev->dir[i]); +mutex_unlock (&dev->lock); + } + +if (dev->int_lvl_cached[i] != dev->int_lvl[i]) { + dev->int_lvl_cached[i] = dev->int_lvl[i]; +adp5588_gpio_write (dev->client,GPIO_INT_LVL1 + i, + dev->int_lvl[i]); + } +if (dev->int_en[i] ^ dev->irq_mask[i]) { dev->int_en[i] = dev->irq_mask[i];adp5588_gpio_write (dev->client,GPIO_INT_EN1 + i, dev->int_en[i]); } + }mutex_unlock (&dev->irq_lock); }
@@ -225,9 +243,7 @@ static int adp5588_irq_set_type(struct irq_data *d, unsigned int type)else return -EINVAL ; -adp5588_gpio_direction_input (&dev->gpio_chip, gpio); -adp5588_gpio_write (dev->client,GPIO_INT_LVL1 + bank, - dev->int_lvl[bank]); + dev->int_input_en[bank] |= bit;return 0 ; }
drivers/hid/hid-core.c +3 -0
@@ -1935,6 +1935,9 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) }, { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
drivers/hid/hid-ids.h +2 -0
@@ -846,6 +846,8 @@#define USB_DEVICE_ID_SONY_PS3_BDREMOTE 0x0306#define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268#define USB_DEVICE_ID_SONY_PS4_CONTROLLER 0x05c4 +#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_2 0x09cc +#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE 0x0ba0#define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER 0x042f#define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER 0x0002#define USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER 0x1000
drivers/hid/hid-ntrig.c +2 -0
@@ -953,6 +953,8 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) ret =sysfs_create_group (&hdev->dev.kobj, &ntrig_attribute_group); +if (ret) +hid_err (hdev,"cannot create sysfs group\n" );return 0 ; err_free:
drivers/hid/hid-sony.c +6 -0
@@ -2042,6 +2042,12 @@ static const struct hid_device_id sony_devices[] = { .driver_data = DUALSHOCK4_CONTROLLER_USB }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER), .driver_data = DUALSHOCK4_CONTROLLER_BT }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2), + .driver_data = DUALSHOCK4_CONTROLLER_USB }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2), + .driver_data = DUALSHOCK4_CONTROLLER_BT }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE), + .driver_data = DUALSHOCK4_CONTROLLER_USB }, { } };MODULE_DEVICE_TABLE (hid, sony_devices);
drivers/hwmon/adt7475.c +9 -5
@@ -274,14 +274,18 @@ static inline u16 volt2reg(int channel, long volt, u8 bypass_attn)return clamp_val (reg,0 ,1023 ) & (0xff <<2 ); } -static u16 adt7475_read_word (struct i2c_client *client,int reg) +static int adt7475_read_word (struct i2c_client *client,int reg) { -u16 val; +int val1, val2; - val =i2c_smbus_read_byte_data (client, reg); - val |= (i2c_smbus_read_byte_data (client, reg +1 ) <<8 ); + val1 =i2c_smbus_read_byte_data (client, reg); +if (val1 <0 ) +return val1; + val2 =i2c_smbus_read_byte_data (client, reg +1 ); +if (val2 <0 ) +return val2; -return val; +return val1 | (val2 <<8 ); }static void adt7475_write_word (struct i2c_client *client,int reg,u16 val)
drivers/infiniband/core/ucma.c +6 -0
@@ -113,6 +113,8 @@ static DEFINE_MUTEX(mut);static DEFINE_IDR (ctx_idr);static DEFINE_IDR (multicast_idr); +static const struct file_operations ucma_fops; +static inline struct ucma_context *_ucma_find_context (int id,struct ucma_file *file) {
@@ -1416,6 +1418,10 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file, f =fdget (cmd.fd);if (!f.file)return -ENOENT ; +if (f.file->f_op != &ucma_fops) { + ret = -EINVAL ; + goto file_put; + }/* Validate current fd and prevent destruction of id. */ ctx =ucma_get_ctx (f.file->private_data, cmd.id);
drivers/md/dm-thin-metadata.c +33 -1
@@ -190,6 +190,12 @@ struct dm_pool_metadata {sector_t data_block_size; bool read_only:1; +/* +* We reserve a section of the metadata for commit overhead. +* All reported space does *not* include this. +*/ +dm_block_t metadata_reserve; +/* * Set if a transaction has to be aborted but the attempt to roll back * to the previous (good) transaction failed. The only pool metadata
@@ -824,6 +830,20 @@ static int __commit_transaction(struct dm_pool_metadata *pmd)return dm_tm_commit (pmd->tm, sblock); } +static void __set_metadata_reserve (struct dm_pool_metadata *pmd) +{ +int r; +dm_block_t total; +dm_block_t max_blocks =4096 ;/* 16M */ + + r =dm_sm_get_nr_blocks (pmd->metadata_sm, &total); +if (r) { +DMERR ("could not get size of metadata device" ); + pmd->metadata_reserve = max_blocks; + }else + pmd->metadata_reserve =min (max_blocks,div_u64 (total,10 )); +} +struct dm_pool_metadata *dm_pool_metadata_open (struct block_device *bdev,sector_t data_block_size,bool format_device)
@@ -858,6 +878,8 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,return ERR_PTR (r); } +__set_metadata_reserve (pmd); +return pmd; }
@@ -1625,6 +1647,13 @@ int dm_pool_get_free_metadata_block_count(struct dm_pool_metadata *pmd,down_read (&pmd->root_lock);if (!pmd->fail_io) r =dm_sm_get_nr_free (pmd->metadata_sm, result); + +if (!r) { +if (*result < pmd->metadata_reserve) + *result =0 ; +else + *result -= pmd->metadata_reserve; + }up_read (&pmd->root_lock);return r;
@@ -1746,8 +1775,11 @@ int dm_pool_resize_metadata_dev(struct dm_pool_metadata *pmd, dm_block_t new_couint r = -EINVAL ;down_write (&pmd->root_lock); -if (!pmd->fail_io) +if (!pmd->fail_io) { r =__resize_space_map (pmd->metadata_sm, new_count); +if (!r) +__set_metadata_reserve (pmd); + }up_write (&pmd->root_lock);return r;
drivers/md/dm-thin.c +65 -8
141 lines not on this page · raw message
drivers/md/raid10.c +4 -1
@@ -4423,11 +4423,12 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,allow_barrier (conf); } +raise_barrier (conf,0 ); read_more:/* Now schedule reads for blocks from sector_nr to last */ r10_bio =mempool_alloc (conf->r10buf_pool,GFP_NOIO ); r10_bio->state =0 ; -raise_barrier (conf, sectors_done !=0 ); +raise_barrier (conf,1 );atomic_set (&r10_bio->remaining,0 ); r10_bio->mddev = mddev; r10_bio->sector = sector_nr;
@@ -4532,6 +4533,8 @@ bio_full:if (sector_nr <= last) goto read_more; +lower_barrier (conf); +/* Now that we have done the whole section we can * update reshape_progress */
drivers/media/i2c/soc_camera/ov772x.c +1 -1
@@ -834,7 +834,7 @@ static int ov772x_set_params(struct ov772x_priv *priv,* set COM8 */ if (priv->band_filter) { - ret =ov772x_mask_set (client,COM8 ,BNDF_ON_OFF ,1 ); + ret =ov772x_mask_set (client,COM8 ,BNDF_ON_OFF ,BNDF_ON_OFF );if (!ret) ret =ov772x_mask_set (client,BDBASE ,0xff ,256 - priv->band_filter);
drivers/media/platform/exynos4-is/fimc-isp-video.c +8 -3
@@ -389,12 +389,17 @@ static void __isp_video_try_fmt(struct fimc_isp *isp,struct v4l2_pix_format_mplane *pixm, const struct fimc_fmt **fmt) { - *fmt =fimc_isp_find_format (&pixm->pixelformat,NULL ,2 ); + const struct fimc_fmt *__fmt; + + __fmt =fimc_isp_find_format (&pixm->pixelformat,NULL ,2 ); + +if (fmt) + *fmt = __fmt; pixm->colorspace =V4L2_COLORSPACE_SRGB ; pixm->field =V4L2_FIELD_NONE ; - pixm->num_planes = (*fmt)->memplanes; - pixm->pixelformat = (*fmt)->fourcc; + pixm->num_planes = __fmt->memplanes; + pixm->pixelformat = __fmt->fourcc;/* * TODO: double check with the docmentation these width/height * constraints are correct.
drivers/media/platform/s3c-camif/camif-capture.c +2 -0
@@ -117,6 +117,8 @@ static int sensor_set_power(struct camif_dev *camif, int on)if (camif->sensor.power_count == !on) err =v4l2_subdev_call (sensor->sd, core, s_power, on); +if (err == -ENOIOCTLCMD ) + err =0 ;if (!err) sensor->power_count += on ?1 :-1 ;
drivers/media/usb/tm6000/tm6000-dvb.c +5 -0
@@ -275,6 +275,11 @@ static int register_dvb(struct tm6000_core *dev) ret =dvb_register_adapter (&dvb->adapter,"Trident TVMaster 6000 DVB-T" ,THIS_MODULE , &dev->udev->dev, adapter_nr); +if (ret <0 ) { +pr_err ("tm6000: couldn't register the adapter!\n" ); + goto err; + } + dvb->adapter.priv = dev;if (dvb->frontend) {
drivers/media/usb/uvc/uvc_video.c +18 -6
@@ -155,14 +155,27 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream, } } +static size_t uvc_video_ctrl_size (struct uvc_streaming *stream) +{ +/* +* Return the size of the video probe and commit controls, which depends +* on the protocol version. +*/ +if (stream->dev->uvc_version <0x0110 ) +return 26 ; +else if (stream->dev->uvc_version <0x0150 ) +return 34 ; +else +return 48 ; +} +static int uvc_get_video_ctrl (struct uvc_streaming *stream,struct uvc_streaming_control *ctrl,int probe,__u8 query) { +__u16 size =uvc_video_ctrl_size (stream);__u8 *data; -__u16 size;int ret; - size = stream->dev->uvc_version >=0x0110 ?34 :26 ;if ((stream->dev->quirks &UVC_QUIRK_PROBE_DEF ) && query ==UVC_GET_DEF )return -EIO ;
@@ -217,7 +230,7 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream, ctrl->dwMaxVideoFrameSize =get_unaligned_le32 (&data[18 ]); ctrl->dwMaxPayloadTransferSize =get_unaligned_le32 (&data[22 ]); -if (size ==34 ) { +if (size >=34 ) { ctrl->dwClockFrequency =get_unaligned_le32 (&data[26 ]); ctrl->bmFramingInfo = data[30 ]; ctrl->bPreferedVersion = data[31 ];
@@ -246,11 +259,10 @@ out:static int uvc_set_video_ctrl (struct uvc_streaming *stream,struct uvc_streaming_control *ctrl,int probe) { +__u16 size =uvc_video_ctrl_size (stream);__u8 *data; -__u16 size;int ret; - size = stream->dev->uvc_version >=0x0110 ?34 :26 ; data =kzalloc (size,GFP_KERNEL );if (data ==NULL )return -ENOMEM ;
@@ -267,7 +279,7 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,put_unaligned_le32 (ctrl->dwMaxVideoFrameSize, &data[18 ]);put_unaligned_le32 (ctrl->dwMaxPayloadTransferSize, &data[22 ]); -if (size ==34 ) { +if (size >=34 ) {put_unaligned_le32 (ctrl->dwClockFrequency, &data[26 ]); data[30 ] = ctrl->bmFramingInfo; data[31 ] = ctrl->bPreferedVersion;
drivers/media/v4l2-core/v4l2-event.c +19 -18
@@ -119,14 +119,6 @@ static void __v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *eif (sev ==NULL )return ; -/* -* If the event has been added to the fh->subscribed list, but its -* add op has not completed yet elems will be 0, treat this as -* not being subscribed. -*/ -if (!sev->elems) -return ; -/* Increase event sequence number on fh. */ fh->sequence++;
@@ -209,6 +201,7 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,struct v4l2_subscribed_event *sev, *found_ev;unsigned long flags;unsigned i; +int ret =0 ;if (sub->type ==V4L2_EVENT_ALL )return -EINVAL ;
@@ -226,31 +219,36 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, sev->flags = sub->flags; sev->fh = fh; sev->ops = ops; + sev->elems = elems; + +mutex_lock (&fh->subscribe_lock);spin_lock_irqsave (&fh->vdev->fh_lock, flags); found_ev =v4l2_event_subscribed (fh, sub->type, sub->id); -if (!found_ev) -list_add (&sev->list, &fh->subscribed);spin_unlock_irqrestore (&fh->vdev->fh_lock, flags);if (found_ev) { +/* Already listening */ kfree (sev); -return 0 ;/* Already listening */ + goto out_unlock; }if (sev->ops && sev->ops->add) { -int ret = sev->ops->add (sev, elems); + ret = sev->ops->add (sev, elems);if (ret) { - sev->ops =NULL ; -v4l2_event_unsubscribe (fh, sub); -return ret; +kfree (sev); + goto out_unlock; } } -/* Mark as ready for use */ - sev->elems = elems; +spin_lock_irqsave (&fh->vdev->fh_lock, flags); +list_add (&sev->list, &fh->subscribed); +spin_unlock_irqrestore (&fh->vdev->fh_lock, flags); -return 0 ; +out_unlock: +mutex_unlock (&fh->subscribe_lock); + +return ret; }EXPORT_SYMBOL_GPL (v4l2_event_subscribe);
@@ -289,6 +287,8 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,return 0 ; } +mutex_lock (&fh->subscribe_lock); +spin_lock_irqsave (&fh->vdev->fh_lock, flags); sev =v4l2_event_subscribed (fh, sub->type, sub->id);
@@ -307,6 +307,7 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, sev->ops->del (sev);kfree (sev); +mutex_unlock (&fh->subscribe_lock);return 0 ; }
drivers/media/v4l2-core/v4l2-fh.c +2 -0
@@ -49,6 +49,7 @@ void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)INIT_LIST_HEAD (&fh->available);INIT_LIST_HEAD (&fh->subscribed); fh->sequence =-1 ; +mutex_init (&fh->subscribe_lock); }EXPORT_SYMBOL_GPL (v4l2_fh_init);
@@ -93,6 +94,7 @@ void v4l2_fh_exit(struct v4l2_fh *fh)if (fh->vdev ==NULL )return ;v4l2_event_unsubscribe_all (fh); +mutex_destroy (&fh->subscribe_lock); fh->vdev =NULL ; }EXPORT_SYMBOL_GPL (v4l2_fh_exit);
drivers/misc/tsl2550.c +1 -1
@@ -177,7 +177,7 @@ static int tsl2550_calculate_lux(u8 ch0, u8 ch1) }else lux =0 ; else - return -EAGAIN; + return 0;/* LUX range check */ return lux >TSL2550_MAX_LUX ?TSL2550_MAX_LUX : lux;
drivers/mtd/spi-nor/fsl-quadspi.c +10 -10
@@ -138,15 +138,15 @@#define LUT_MODE 4#define LUT_MODE2 5#define LUT_MODE4 6 -#define LUT_READ 7 -#define LUT_WRITE 8 +#define LUT_FSL_READ 7 +#define LUT_FSL_WRITE 8#define LUT_JMP_ON_CS 9#define LUT_ADDR_DDR 10#define LUT_MODE_DDR 11#define LUT_MODE2_DDR 12#define LUT_MODE4_DDR 13 -#define LUT_READ_DDR 14 -#define LUT_WRITE_DDR 15 +#define LUT_FSL_READ_DDR 14 +#define LUT_FSL_WRITE_DDR 15#define LUT_DATA_LEARN 16/*
@@ -306,7 +306,7 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)writel (LUT0 (CMD ,PAD1 , cmd) |LUT1 (ADDR ,PAD1 , addrlen), base +QUADSPI_LUT (lut_base)); -writel (LUT0 (DUMMY ,PAD1 , dummy) |LUT1 (READ ,PAD4 , rxfifo), +writel (LUT0 (DUMMY ,PAD1 , dummy) |LUT1 (FSL_READ ,PAD4 , rxfifo), base +QUADSPI_LUT (lut_base +1 ));/* Write enable */
@@ -327,11 +327,11 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)writel (LUT0 (CMD ,PAD1 , cmd) |LUT1 (ADDR ,PAD1 , addrlen), base +QUADSPI_LUT (lut_base)); -writel (LUT0 (WRITE ,PAD1 ,0 ), base +QUADSPI_LUT (lut_base +1 )); +writel (LUT0 (FSL_WRITE ,PAD1 ,0 ), base +QUADSPI_LUT (lut_base +1 ));/* Read Status */ lut_base =SEQID_RDSR *4 ; -writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_RDSR ) |LUT1 (READ ,PAD1 ,0x1 ), +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_RDSR ) |LUT1 (FSL_READ ,PAD1 ,0x1 ), base +QUADSPI_LUT (lut_base));/* Erase a sector */
@@ -356,17 +356,17 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)/* READ ID */ lut_base =SEQID_RDID *4 ; -writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_RDID ) |LUT1 (READ ,PAD1 ,0x8 ), +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_RDID ) |LUT1 (FSL_READ ,PAD1 ,0x8 ), base +QUADSPI_LUT (lut_base));/* Write Register */ lut_base =SEQID_WRSR *4 ; -writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_WRSR ) |LUT1 (WRITE ,PAD1 ,0x2 ), +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_WRSR ) |LUT1 (FSL_WRITE ,PAD1 ,0x2 ), base +QUADSPI_LUT (lut_base));/* Read Configuration Register */ lut_base =SEQID_RDCR *4 ; -writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_RDCR ) |LUT1 (READ ,PAD1 ,0x1 ), +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_RDCR ) |LUT1 (FSL_READ ,PAD1 ,0x1 ), base +QUADSPI_LUT (lut_base));/* Write disable */
drivers/net/appletalk/ipddp.c +6 -2
@@ -284,8 +284,12 @@ static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)case SIOCFINDIPDDPRT :spin_lock_bh (&ipddp_route_lock); rp =__ipddp_find_route (&rcp); -if (rp) -memcpy (&rcp2, rp,sizeof (rcp2)); +if (rp) { +memset (&rcp2,0 ,sizeof (rcp2)); + rcp2.ip = rp->ip; + rcp2.at = rp->at; + rcp2.flags = rp->flags; + }spin_unlock_bh (&ipddp_route_lock);if (rp) {
drivers/net/ethernet/cadence/macb.c +1 -1
@@ -464,7 +464,7 @@ static int macb_halt_tx(struct macb *bp)if (!(status &MACB_BIT (TGO )))return 0 ; -usleep_range (10 ,250 ); +udelay (250 ); }while (time_before (halt_time, timeout));return -ETIMEDOUT ;
drivers/net/ethernet/hp/hp100.c +1 -1
@@ -2637,7 +2637,7 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)/* Wait for link to drop */ time = jiffies + (HZ /10 ); do { - if (~(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST)) + if (!(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST)) break; if (!in_interrupt()) schedule_timeout_interruptible(1);
drivers/net/ethernet/intel/e1000/e1000_ethtool.c +4 -3
@@ -646,14 +646,14 @@ static int e1000_set_ringparam(struct net_device *netdev, adapter->tx_ring = tx_old;e1000_free_all_rx_resources (adapter);e1000_free_all_tx_resources (adapter); -kfree (tx_old); -kfree (rx_old); adapter->rx_ring = rxdr; adapter->tx_ring = txdr; err =e1000_up (adapter);if (err) goto err_setup; } +kfree (tx_old); +kfree (rx_old);clear_bit (__E1000_RESETTING, &adapter->flags);return 0 ;
@@ -666,7 +666,8 @@ err_setup_rx: err_alloc_rx:kfree (txdr); err_alloc_tx: -e1000_up (adapter); +if (netif_running (adapter->netdev)) +e1000_up (adapter); err_setup:clear_bit (__E1000_RESETTING, &adapter->flags);return err;
drivers/net/ethernet/realtek/r8169.c +6 -3
@@ -749,7 +749,7 @@ struct rtl8169_counters { };enum rtl_flag { -RTL_FLAG_TASK_ENABLED , +RTL_FLAG_TASK_ENABLED =0 ,RTL_FLAG_TASK_SLOW_PENDING ,RTL_FLAG_TASK_RESET_PENDING ,RTL_FLAG_TASK_PHY_PENDING ,
@@ -7523,7 +7523,8 @@ static int rtl8169_close(struct net_device *dev)rtl8169_update_counters (dev);rtl_lock_work (tp); -clear_bit (RTL_FLAG_TASK_ENABLED , tp->wk.flags); +/* Clear all task flags */ +bitmap_zero (tp->wk.flags,RTL_FLAG_MAX );rtl8169_down (dev);rtl_unlock_work (tp);
@@ -7679,7 +7680,9 @@ static void rtl8169_net_suspend(struct net_device *dev)rtl_lock_work (tp);napi_disable (&tp->napi); -clear_bit (RTL_FLAG_TASK_ENABLED , tp->wk.flags); +/* Clear all task flags */ +bitmap_zero (tp->wk.flags,RTL_FLAG_MAX ); +rtl_unlock_work (tp);rtl_pll_power_down (tp);
drivers/net/wireless/rndis_wlan.c +2 -0
@@ -2919,6 +2919,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev,while (buflen >=sizeof (*auth_req)) { auth_req = (void *)buf; +if (buflen <le32_to_cpu (auth_req->length)) +return ; type ="unknown" ; flags =le32_to_cpu (auth_req->flags); pairwise_error = false;
drivers/net/wireless/ti/wlcore/cmd.c +6 -0
@@ -35,6 +35,7 @@#include "wl12xx_80211.h" #include "cmd.h" #include "event.h" +#include "ps.h" #include "tx.h" #include "hw_ops.h"
@@ -187,6 +188,10 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl, timeout_time = jiffies +msecs_to_jiffies (WL1271_EVENT_TIMEOUT ); + ret =wl1271_ps_elp_wakeup (wl); +if (ret <0 ) +return ret; + do { if (time_after(jiffies, timeout_time)) { wl1271_debug(DEBUG_CMD, "timeout waiting for event %d",
@@ -218,6 +223,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl, }while (!event); out: +wl1271_ps_elp_sleep (wl);kfree (events_vector);return ret; }
drivers/pci/pci.c +19 -8
@@ -1023,12 +1023,12 @@ int pci_save_state(struct pci_dev *dev)EXPORT_SYMBOL (pci_save_state);static void pci_restore_config_dword (struct pci_dev *pdev,int offset, -u32 saved_val,int retry) +u32 saved_val,int retry,bool force) {u32 val;pci_read_config_dword (pdev, offset, &val); -if (val == saved_val) +if (!force && val == saved_val)return ;for (;;) {
@@ -1047,25 +1047,36 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset, }static void pci_restore_config_space_range (struct pci_dev *pdev, -int start,int end,int retry) +int start,int end,int retry, +bool force) {int index;for (index = end; index >= start; index--)pci_restore_config_dword (pdev,4 * index, pdev->saved_config_space[index], - retry); + retry, force); }static void pci_restore_config_space (struct pci_dev *pdev) {if (pdev->hdr_type ==PCI_HEADER_TYPE_NORMAL ) { -pci_restore_config_space_range (pdev,10 ,15 ,0 ); +pci_restore_config_space_range (pdev,10 ,15 ,0 , false);/* Restore BARs before the command register. */ -pci_restore_config_space_range (pdev,4 ,9 ,10 ); -pci_restore_config_space_range (pdev,0 ,3 ,0 ); +pci_restore_config_space_range (pdev,4 ,9 ,10 , false); +pci_restore_config_space_range (pdev,0 ,3 ,0 , false); + }else if (pdev->hdr_type ==PCI_HEADER_TYPE_BRIDGE ) { +pci_restore_config_space_range (pdev,12 ,15 ,0 , false); + +/* +* Force rewriting of prefetch registers to avoid S3 resume +* issues on Intel PCI bridges that occur when these +* registers are not explicitly written. +*/ +pci_restore_config_space_range (pdev,9 ,11 ,0 , true); +pci_restore_config_space_range (pdev,0 ,8 ,0 , false); }else { -pci_restore_config_space_range (pdev,0 ,15 ,0 ); +pci_restore_config_space_range (pdev,0 ,15 ,0 , false); } }
drivers/s390/net/qeth_l2_main.c +1 -1
@@ -452,7 +452,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,default :dev_kfree_skb_any (skb);QETH_CARD_TEXT (card,3 ,"inbunkno" ); -QETH_DBF_HEX (CTRL ,3 , hdr,QETH_DBF_CTRL_LEN ); +QETH_DBF_HEX (CTRL ,3 , hdr,sizeof (*hdr));continue ; } work_done++;
drivers/s390/net/qeth_l3_main.c +1 -1
@@ -1993,7 +1993,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,default :dev_kfree_skb_any (skb);QETH_CARD_TEXT (card,3 ,"inbunkno" ); -QETH_DBF_HEX (CTRL ,3 , hdr,QETH_DBF_CTRL_LEN ); +QETH_DBF_HEX (CTRL ,3 , hdr,sizeof (*hdr));continue ; } work_done++;
drivers/scsi/bnx2i/bnx2i_hwi.c +2 -0
@@ -2742,6 +2742,8 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) BNX2X_DOORBELL_PCI_BAR); reg_off = (1 <<BNX2X_DB_SHIFT ) * (cid_num &0x1FFFF ); ep->qp.ctx_base =ioremap_nocache (reg_base + reg_off,4 ); +if (!ep->qp.ctx_base) +return -ENOMEM ; goto arm_cq; }
drivers/scsi/ibmvscsi/ibmvscsi.c +2 -2
@@ -93,7 +93,7 @@ static int max_requests = IBMVSCSI_MAX_REQUESTS_DEFAULT;static int max_events =IBMVSCSI_MAX_REQUESTS_DEFAULT +2 ;static int fast_fail =1 ;static int client_reserve =1 ; -static char partition_name[97 ] ="UNKNOWN" ; +static char partition_name[96 ] ="UNKNOWN" ;static unsigned int partition_number =-1 ;static struct scsi_transport_template *ibmvscsi_transport_template;
@@ -261,7 +261,7 @@ static void gather_partition_info(void) ppartition_name =of_get_property (rootdn,"ibm,partition-name" ,NULL );if (ppartition_name) -strncpy (partition_name, ppartition_name, +strlcpy (partition_name, ppartition_name,sizeof (partition_name)); p_number_ptr =of_get_property (rootdn,"ibm,partition-no" ,NULL );if (p_number_ptr)
drivers/spi/spi-rspi.c +6 -4
@@ -538,11 +538,13 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx, ret =wait_event_interruptible_timeout (rspi->wait, rspi->dma_callbacked,HZ ); -if (ret >0 && rspi->dma_callbacked) +if (ret >0 && rspi->dma_callbacked) { ret =0 ; -else if (!ret) { -dev_err (&rspi->master->dev,"DMA timeout\n" ); - ret = -ETIMEDOUT ; + }else { +if (!ret) { +dev_err (&rspi->master->dev,"DMA timeout\n" ); + ret = -ETIMEDOUT ; + }if (tx)dmaengine_terminate_all (rspi->master->dma_tx);if (rx)
drivers/spi/spi-sh-msiof.c +2 -1
@@ -332,7 +332,8 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p,static void sh_msiof_reset_str (struct sh_msiof_spi_priv *p) { -sh_msiof_write (p,STR ,sh_msiof_read (p,STR )); +sh_msiof_write (p,STR , +sh_msiof_read (p,STR ) & ~(STR_TDREQ |STR_RDREQ )); } static void sh_msiof_spi_write_fifo_8(struct sh_msiof_spi_priv *p,
drivers/spi/spi-tegra20-slink.c +23 -8
@@ -1063,6 +1063,24 @@ static int tegra_slink_probe(struct platform_device *pdev) goto exit_free_master; } +/* disabled clock may cause interrupt storm upon request */ + tspi->clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (tspi->clk)) { + ret =PTR_ERR (tspi->clk); +dev_err (&pdev->dev,"Can not get clock %d\n" , ret); + goto exit_free_master; + } + ret =clk_prepare (tspi->clk); +if (ret <0 ) { +dev_err (&pdev->dev,"Clock prepare failed %d\n" , ret); + goto exit_free_master; + } + ret =clk_enable (tspi->clk); +if (ret <0 ) { +dev_err (&pdev->dev,"Clock enable failed %d\n" , ret); + goto exit_free_master; + } + spi_irq =platform_get_irq (pdev,0 ); tspi->irq = spi_irq; ret = request_threaded_irq(tspi->irq, tegra_slink_isr,
@@ -1071,14 +1089,7 @@ static int tegra_slink_probe(struct platform_device *pdev)if (ret <0 ) {dev_err (&pdev->dev,"Failed to register ISR for IRQ %d\n" , tspi->irq); - goto exit_free_master; - } - - tspi->clk =devm_clk_get (&pdev->dev,NULL ); -if (IS_ERR (tspi->clk)) { -dev_err (&pdev->dev,"can not get clock\n" ); - ret =PTR_ERR (tspi->clk); - goto exit_free_irq; + goto exit_clk_disable; } tspi->rst =devm_reset_control_get (&pdev->dev,"spi" );
@@ -1138,6 +1149,8 @@ exit_rx_dma_free:tegra_slink_deinit_dma_param (tspi, true); exit_free_irq:free_irq (spi_irq, tspi); +exit_clk_disable: +clk_disable (tspi->clk); exit_free_master:spi_master_put (master);return ret;
@@ -1150,6 +1163,8 @@ static int tegra_slink_remove(struct platform_device *pdev)free_irq (tspi->irq, tspi); +clk_disable (tspi->clk); +if (tspi->tx_dma_chan)tegra_slink_deinit_dma_param (tspi, false);
drivers/staging/android/ashmem.c +6 -0
@@ -370,6 +370,12 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma) goto out; } +/* requested mapping size larger than object size */ +if (vma->vm_end - vma->vm_start >PAGE_ALIGN (asma->size)) { + ret = -EINVAL ; + goto out; + } +/* requested protection bits must match our allowed protection mask */ if (unlikely ((vma->vm_flags & ~calc_vm_prot_bits (asma->prot_mask)) &calc_vm_prot_bits (PROT_MASK ))) {
drivers/staging/android/ion/ion.c +37 -23
111 lines not on this page · raw message
drivers/target/iscsi/iscsi_target_auth.c +17 -28
89 lines not on this page · raw message
drivers/target/iscsi/iscsi_target_tpg.c +1 -2
@@ -651,8 +651,7 @@ int iscsit_ta_authentication(struct iscsi_portal_group *tpg, u32 authentication) none =strstr (buf1,NONE );if (none) goto out; -strncat (buf1,"," ,strlen ("," )); -strncat (buf1,NONE ,strlen (NONE )); +strlcat (buf1,"," NONE ,sizeof (buf1));if (iscsi_update_param_value (param, buf1) <0 )return -EINVAL ; }
drivers/thermal/of-thermal.c +5 -2
@@ -209,10 +209,13 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz,mutex_lock (&tz->lock); -if (mode ==THERMAL_DEVICE_ENABLED ) +if (mode ==THERMAL_DEVICE_ENABLED ) { tz->polling_delay = data->polling_delay; -else + tz->passive_delay = data->passive_delay; + }else { tz->polling_delay =0 ; + tz->passive_delay =0 ; + }mutex_unlock (&tz->lock);
drivers/tty/serial/8250/serial_cs.c +4 -2
@@ -629,8 +629,10 @@ static int serial_config(struct pcmcia_device * link) (link->has_func_id) && (link->socket->pcmcia_pfc ==0 ) && ((link->func_id ==CISTPL_FUNCID_MULTI ) || - (link->func_id == CISTPL_FUNCID_SERIAL))) -pcmcia_loop_config (link, serial_check_for_multi, info); + (link->func_id == CISTPL_FUNCID_SERIAL))) { + if (pcmcia_loop_config(link, serial_check_for_multi, info)) + goto failed; + }/* * Apply any multi-port quirk.
drivers/tty/serial/cpm_uart/cpm_uart_core.c +7 -3
@@ -1054,8 +1054,8 @@ static int poll_wait_key(char *obuf, struct uart_cpm_port *pinfo)/* Get the address of the host memory buffer. */ bdp = pinfo->rx_cur; -while (bdp->cbd_sc &BD_SC_EMPTY ) - ; +if (bdp->cbd_sc &BD_SC_EMPTY ) +return NO_POLL_CHAR ;/* If the buffer address is in the CPM DPRAM, don't * convert it.
@@ -1089,7 +1089,11 @@ static int cpm_get_poll_char(struct uart_port *port) poll_chars =0 ; }if (poll_chars <=0 ) { - poll_chars =poll_wait_key (poll_buf, pinfo); +int ret =poll_wait_key (poll_buf, pinfo); + +if (ret ==NO_POLL_CHAR ) +return ret; + poll_chars = ret; pollp = poll_buf; } poll_chars--;
drivers/usb/class/cdc-wdm.c +1 -1
@@ -452,7 +452,7 @@ static int clear_wdm_read_flag(struct wdm_device *desc)set_bit (WDM_RESPONDING , &desc->flags);spin_unlock_irq (&desc->iuspin); - rv =usb_submit_urb (desc->response,GFP_ATOMIC ); + rv =usb_submit_urb (desc->response,GFP_KERNEL );spin_lock_irq (&desc->iuspin);if (rv) { dev_err(&desc->intf->dev,
drivers/usb/core/devio.c +21 -3
@@ -1286,10 +1286,13 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurbstruct async *as =NULL ;struct usb_ctrlrequest *dr =NULL ;unsigned int u, totlen, isofrmlen; -int i, ret, is_in, num_sgs =0 , ifnum =-1 ; +int i, ret, num_sgs =0 , ifnum =-1 ;int number_of_packets =0 ;unsigned int stream_id =0 ;void *buf; +bool is_in; +bool allow_short = false; +bool allow_zero = false;unsigned long mask =USBDEVFS_URB_SHORT_NOT_OK |USBDEVFS_URB_BULK_CONTINUATION | USBDEVFS_URB_NO_FSBR |
@@ -1323,6 +1326,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb u =0 ;switch (uurb->type) {case USBDEVFS_URB_TYPE_CONTROL : +if (is_in) + allow_short = true;if (!usb_endpoint_xfer_control (&ep->desc))return -EINVAL ;/* min 8 byte setup packet */
@@ -1363,6 +1368,10 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurbbreak ;case USBDEVFS_URB_TYPE_BULK : +if (!is_in) + allow_zero = true; +else + allow_short = true;switch (usb_endpoint_type (&ep->desc)) {case USB_ENDPOINT_XFER_CONTROL :case USB_ENDPOINT_XFER_ISOC :
@@ -1383,6 +1392,10 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurbif (!usb_endpoint_xfer_int (&ep->desc))return -EINVAL ; interrupt_urb: +if (!is_in) + allow_zero = true; +else + allow_short = true;break ;case USBDEVFS_URB_TYPE_ISO :
@@ -1508,16 +1521,21 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb u = (is_in ?URB_DIR_IN :URB_DIR_OUT );if (uurb->flags &USBDEVFS_URB_ISO_ASAP ) u |=URB_ISO_ASAP ; -if (uurb->flags &USBDEVFS_URB_SHORT_NOT_OK && is_in) +if (allow_short && uurb->flags &USBDEVFS_URB_SHORT_NOT_OK ) u |=URB_SHORT_NOT_OK ;if (uurb->flags &USBDEVFS_URB_NO_FSBR ) u |=URB_NO_FSBR ; -if (uurb->flags &USBDEVFS_URB_ZERO_PACKET ) +if (allow_zero && uurb->flags &USBDEVFS_URB_ZERO_PACKET ) u |=URB_ZERO_PACKET ;if (uurb->flags &USBDEVFS_URB_NO_INTERRUPT ) u |=URB_NO_INTERRUPT ; as->urb->transfer_flags = u; +if (!allow_short && uurb->flags &USBDEVFS_URB_SHORT_NOT_OK ) +dev_warn (&ps->dev->dev,"Requested nonsensical USBDEVFS_URB_SHORT_NOT_OK.\n" ); +if (!allow_zero && uurb->flags &USBDEVFS_URB_ZERO_PACKET ) +dev_warn (&ps->dev->dev,"Requested nonsensical USBDEVFS_URB_ZERO_PACKET.\n" ); + as->urb->transfer_buffer_length = uurb->buffer_length; as->urb->setup_packet = (unsigned char *)dr; dr =NULL ;
drivers/usb/core/driver.c +14 -14
@@ -506,7 +506,6 @@ int usb_driver_claim_interface(struct usb_driver *driver,struct device *dev;struct usb_device *udev;int retval =0 ; -int lpm_disable_error = -ENODEV ;if (!iface)return -ENODEV ;
@@ -523,16 +522,6 @@ int usb_driver_claim_interface(struct usb_driver *driver, iface->condition =USB_INTERFACE_BOUND ; -/* See the comment about disabling LPM in usb_probe_interface(). */ -if (driver->disable_hub_initiated_lpm) { - lpm_disable_error =usb_unlocked_disable_lpm (udev); -if (lpm_disable_error) { -dev_err (&iface->dev,"%s Failed to disable LPM for driver %s\n." , - __func__, driver->name); -return -ENOMEM ; - } - } -/* Claimed interfaces are initially inactive (suspended) and * runtime-PM-enabled, but only if the driver has autosuspend * support. Otherwise they are marked active, to prevent the
@@ -551,9 +540,20 @@ int usb_driver_claim_interface(struct usb_driver *driver,if (device_is_registered (dev)) retval =device_bind_driver (dev); -/* Attempt to re-enable USB3 LPM, if the disable was successful. */ -if (!lpm_disable_error) -usb_unlocked_enable_lpm (udev); +if (retval) { + dev->driver =NULL ; +usb_set_intfdata (iface,NULL ); + iface->needs_remote_wakeup =0 ; + iface->condition =USB_INTERFACE_UNBOUND ; + +/* +* Unbound interfaces are always runtime-PM-disabled +* and runtime-PM-suspended +*/ +if (driver->supports_autosuspend) +pm_runtime_disable (dev); +pm_runtime_set_suspended (dev); + }return retval; }
drivers/usb/core/usb.c +2 -0
@@ -79,6 +79,8 @@ struct usb_host_interface *usb_find_alt_setting(struct usb_interface_cache *intf_cache =NULL ;int i; +if (!config) +return NULL ;for (i =0 ; i < config->desc.bNumInterfaces; i++) {if (config->intf_cache[i]->altsetting[0 ].desc.bInterfaceNumber == iface_num) {
drivers/usb/misc/yurex.c +3 -0
@@ -430,6 +430,9 @@ static ssize_t yurex_read(struct file *file, char *buffer, size_t count, loff_tspin_unlock_irqrestore (&dev->lock, flags);mutex_unlock (&dev->io_mutex); +if (WARN_ON_ONCE (len >=sizeof (in_buffer))) +return -EIO ; +return simple_read_from_buffer (buffer, count, ppos, in_buffer, len); }
drivers/usb/serial/kobil_sct.c +10 -2
@@ -396,12 +396,20 @@ static int kobil_tiocmget(struct tty_struct *tty) transfer_buffer_length, KOBIL_TIMEOUT); -dev_dbg (&port->dev,"%s - Send get_status_line_state URB returns: %i. Statusline: %02x\n" , - __func__, result, transfer_buffer[0 ]); +dev_dbg (&port->dev,"Send get_status_line_state URB returns: %i\n" , + result); +if (result <1 ) { +if (result >=0 ) + result = -EIO ; + goto out_free; + } + +dev_dbg (&port->dev,"Statusline: %02x\n" , transfer_buffer[0 ]); result =0 ;if ((transfer_buffer[0 ] &SUSBCR_GSL_DSR ) !=0 ) result =TIOCM_DSR ; +out_free:kfree (transfer_buffer);return result; }
drivers/usb/serial/usb-serial-simple.c +2 -1
@@ -74,7 +74,8 @@ DEVICE(moto_modem, MOTO_IDS);/* Motorola Tetra driver */ #define MOTOROLA_TETRA_IDS () \ - { USB_DEVICE(0x0cad, 0x9011) }/* Motorola Solutions TETRA PEI */ + { USB_DEVICE(0x0cad, 0x9011) },/* Motorola Solutions TETRA PEI */ \ + { USB_DEVICE(0x0cad, 0x9012) } /* MTP6550 */DEVICE (motorola_tetra,MOTOROLA_TETRA_IDS );/* Novatel Wireless GPS driver */
drivers/usb/wusbcore/security.c +1 -1
@@ -230,7 +230,7 @@ int wusb_dev_sec_add(struct wusbhc *wusbhc, result =usb_get_descriptor (usb_dev,USB_DT_SECURITY ,0 , secd,sizeof (*secd)); -if (result <sizeof (*secd)) { +if (result < (int )sizeof (*secd)) {dev_err (dev,"Can't read security descriptor or " "not enough data: %d\n" , result); goto out;
drivers/uwb/hwa-rc.c +1 -0
@@ -875,6 +875,7 @@ error_get_version: error_rc_add:usb_put_intf (iface);usb_put_dev (hwarc->usb_dev); +kfree (hwarc); error_alloc:uwb_rc_put (uwb_rc); error_rc_alloc:
drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +4 -1
@@ -493,6 +493,9 @@ static int omapfb_memory_read(struct fb_info *fbi,if (!access_ok (VERIFY_WRITE , mr->buffer, mr->buffer_size))return -EFAULT ; +if (mr->w >4096 || mr->h >4096 ) +return -EINVAL ; +if (mr->w * mr->h *3 > mr->buffer_size)return -EINVAL ;
@@ -506,7 +509,7 @@ static int omapfb_memory_read(struct fb_info *fbi, mr->x, mr->y, mr->w, mr->h);if (r >0 ) { -if (copy_to_user (mr->buffer, buf, mr->buffer_size)) +if (copy_to_user (mr->buffer, buf, r)) r = -EFAULT ; }
drivers/xen/events/events_base.c +1 -1
@@ -138,7 +138,7 @@ static int set_evtchn_to_irq(unsigned evtchn, unsigned irq)clear_evtchn_to_irq_row (row); } - evtchn_to_irq[EVTCHN_ROW (evtchn)][EVTCHN_COL (evtchn)] = irq; + evtchn_to_irq[row][col] = irq;return 0 ; }
drivers/xen/manage.c +4 -2
@@ -277,9 +277,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,/* * The Xenstore watch fires directly after registering it and * after a suspend/resume cycle. So ENOENT is no error but -* might happen in those cases. +* might happen in those cases. ERANGE is observed when we get +* an empty value (''), this happens when we acknowledge the +* request by writing '\0' below. */ -if (err != -ENOENT ) +if (err != -ENOENT && err != -ERANGE )pr_err ("Error %d reading sysrq code in control/sysrq\n" , err);xenbus_transaction_end (xbt,1 );
fs/cifs/cifs_unicode.c +0 -3
@@ -136,9 +136,6 @@ convert_sfm_char(const __u16 src_char, char *target)case SFM_LESSTHAN : *target ='<' ;break ; -case SFM_SLASH : - *target ='\\' ; -break ;case SFM_SPACE : *target =' ' ;break ;
fs/cifs/cifssmb.c +8 -3
@@ -577,10 +577,15 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses) } count =0 ; +/* +* We know that all the name entries in the protocols array +* are short (< 16 bytes anyway) and are NUL terminated. +*/ for (i =0 ; i <CIFS_NUM_PROT ; i++) { -strncpy (pSMB->DialectsArray+count, protocols[i].name,16 ); - count +=strlen (protocols[i].name) +1 ; -/* null at end of source and target buffers anyway */ +size_t len =strlen (protocols[i].name) +1 ; + +memcpy (pSMB->DialectsArray+count, protocols[i].name, len); + count += len; }inc_rfc1001_len (pSMB, count); pSMB->ByteCount =cpu_to_le16 (count);
fs/cifs/misc.c +8 -0
@@ -405,9 +405,17 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv) (struct smb_com_transaction_change_notify_rsp *)buf;struct file_notify_information *pnotify;__u32 data_offset =0 ; +size_t len = srv->total_read -sizeof (pSMBr->hdr.smb_buf_length); +if (get_bcc (buf) >sizeof (struct file_notify_information )) { data_offset =le32_to_cpu (pSMBr->DataOffset); +if (data_offset > + len -sizeof (struct file_notify_information )) { +cifs_dbg (FYI ,"invalid data_offset %u\n" , + data_offset); +return true; + } pnotify = (struct file_notify_information *) ((char *)&pSMBr->hdr.Protocol + data_offset); cifs_dbg(FYI, "dnotify on %s Action: 0x%x\n",
fs/cifs/smb2ops.c +1 -1
@@ -847,7 +847,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, } srch_inf->entries_in_buffer =0 ; - srch_inf->index_of_last_entry =0 ; + srch_inf->index_of_last_entry =2 ; rc =SMB2_query_directory (xid, tcon, fid->persistent_fid, fid->volatile_fid,0 , srch_inf);
fs/ext4/balloc.c +13 -8
@@ -184,7 +184,6 @@ static int ext4_init_block_bitmap(struct super_block *sb,unsigned int bit, bit_max;struct ext4_sb_info *sbi =EXT4_SB (sb);ext4_fsblk_t start, tmp; -int flex_bg =0 ;struct ext4_group_info *grp;J_ASSERT_BH (bh,buffer_locked (bh));
@@ -217,22 +216,19 @@ static int ext4_init_block_bitmap(struct super_block *sb, start =ext4_group_first_block_no (sb, block_group); -if (EXT4_HAS_INCOMPAT_FEATURE (sb,EXT4_FEATURE_INCOMPAT_FLEX_BG )) - flex_bg =1 ; -/* Set bits for block and inode bitmaps, and inode table */ tmp =ext4_block_bitmap (sb, gdp); -if (!flex_bg ||ext4_block_in_group (sb, tmp, block_group)) +if (ext4_block_in_group (sb, tmp, block_group))ext4_set_bit (EXT4_B2C (sbi, tmp - start), bh->b_data); tmp =ext4_inode_bitmap (sb, gdp); -if (!flex_bg ||ext4_block_in_group (sb, tmp, block_group)) +if (ext4_block_in_group (sb, tmp, block_group))ext4_set_bit (EXT4_B2C (sbi, tmp - start), bh->b_data); tmp =ext4_inode_table (sb, gdp);for (; tmp <ext4_inode_table (sb, gdp) + sbi->s_itb_per_group; tmp++) { -if (!flex_bg ||ext4_block_in_group (sb, tmp, block_group)) +if (ext4_block_in_group (sb, tmp, block_group))ext4_set_bit (EXT4_B2C (sbi, tmp - start), bh->b_data); }
@@ -451,9 +447,18 @@ ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group) goto verify; }ext4_lock_group (sb, block_group); -if (desc->bg_flags &cpu_to_le16 (EXT4_BG_BLOCK_UNINIT )) { +if (ext4_has_group_desc_csum (sb) && + (desc->bg_flags &cpu_to_le16 (EXT4_BG_BLOCK_UNINIT ))) {int err; +if (block_group ==0 ) { +ext4_unlock_group (sb, block_group); +unlock_buffer (bh); +ext4_error (sb,"Block bitmap for bg 0 marked " +"uninitialized" ); +put_bh (bh); +return NULL ; + } err =ext4_init_block_bitmap (sb, bh, block_group, desc);set_bitmap_uptodate (bh);set_buffer_uptodate (bh);
fs/ext4/dir.c +9 -11
@@ -77,7 +77,7 @@ int __ext4_check_dir_entry(const char *function, unsigned int line,else if (unlikely (rlen <EXT4_DIR_REC_LEN (de->name_len))) error_msg ="rec_len is too small for name_len" ;else if (unlikely (((char *) de - buf) + rlen > size)) - error_msg ="directory entry across range" ; + error_msg ="directory entry overrun" ;else if (unlikely (le32_to_cpu (de->inode) >le32_to_cpu (EXT4_SB (dir->i_sb)->s_es->s_inodes_count))) error_msg ="inode out of bounds" ;
@@ -86,18 +86,16 @@ int __ext4_check_dir_entry(const char *function, unsigned int line,if (filp)ext4_error_file (filp, function, line, bh->b_blocknr, -"bad entry in directory: %s - offset=%u(%u), " -"inode=%u, rec_len=%d, name_len=%d" , - error_msg, (unsigned ) (offset % size), - offset,le32_to_cpu (de->inode), - rlen, de->name_len); +"bad entry in directory: %s - offset=%u, " +"inode=%u, rec_len=%d, name_len=%d, size=%d" , + error_msg, offset,le32_to_cpu (de->inode), + rlen, de->name_len, size);else ext4_error_inode (dir, function, line, bh->b_blocknr, -"bad entry in directory: %s - offset=%u(%u), " -"inode=%u, rec_len=%d, name_len=%d" , - error_msg, (unsigned ) (offset % size), - offset,le32_to_cpu (de->inode), - rlen, de->name_len); +"bad entry in directory: %s - offset=%u, " +"inode=%u, rec_len=%d, name_len=%d, size=%d" , + error_msg, offset,le32_to_cpu (de->inode), + rlen, de->name_len, size);return 1 ; }
fs/ext4/ext4.h +0 -8
@@ -1386,11 +1386,6 @@ static inline struct timespec ext4_current_time(struct inode *inode)static inline int ext4_valid_inum (struct super_block *sb,unsigned long ino) {return ino ==EXT4_ROOT_INO || - ino ==EXT4_USR_QUOTA_INO || - ino ==EXT4_GRP_QUOTA_INO || - ino ==EXT4_BOOT_LOADER_INO || - ino ==EXT4_JOURNAL_INO || - ino ==EXT4_RESIZE_INO || (ino >=EXT4_FIRST_INO (sb) && ino <=le32_to_cpu (EXT4_SB (sb)->s_es->s_inodes_count)); }
@@ -2668,9 +2663,6 @@ extern struct buffer_head *ext4_get_first_inline_block(struct inode *inode,extern int ext4_inline_data_fiemap (struct inode *inode,struct fiemap_extent_info *fieinfo,int *has_inline); -extern int ext4_try_to_evict_inline_data (handle_t *handle, -struct inode *inode, -int needed);extern void ext4_inline_data_truncate (struct inode *inode,int *has_inline);extern int ext4_convert_inline_data (struct inode *inode);
fs/ext4/ext4_extents.h +1 -0
@@ -103,6 +103,7 @@ struct ext4_extent_header { };#define EXT4_EXT_MAGIC cpu_to_le16(0xf30a) +#define EXT4_MAX_EXTENT_DEPTH 5#define EXT4_EXTENT_TAIL_OFFSET (hdr) \ (sizeof(struct ext4_extent_header) + \
fs/ext4/extents.c +6 -0
@@ -870,6 +870,12 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block, eh =ext_inode_hdr (inode); depth =ext_depth (inode); +if (depth <0 || depth >EXT4_MAX_EXTENT_DEPTH ) { +EXT4_ERROR_INODE (inode,"inode has invalid extent depth: %d" , + depth); + ret = -EIO ; + goto err; + }if (path) {ext4_ext_drop_refs (path);
fs/ext4/ialloc.c +16 -3
@@ -117,7 +117,16 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) }ext4_lock_group (sb, block_group); -if (desc->bg_flags &cpu_to_le16 (EXT4_BG_INODE_UNINIT )) { +if (ext4_has_group_desc_csum (sb) && + (desc->bg_flags &cpu_to_le16 (EXT4_BG_INODE_UNINIT ))) { +if (block_group ==0 ) { +ext4_unlock_group (sb, block_group); +unlock_buffer (bh); +ext4_error (sb,"Inode bitmap for bg 0 marked " +"uninitialized" ); +put_bh (bh); +return NULL ; + }memset (bh->b_data,0 , (EXT4_INODES_PER_GROUP (sb) +7 ) /8 );ext4_mark_bitmap_end (EXT4_INODES_PER_GROUP (sb), sb->s_blocksize *8 , bh->b_data);
@@ -873,7 +882,8 @@ got:/* recheck and clear flag under lock if we still need to */ ext4_lock_group (sb, group); -if (gdp->bg_flags &cpu_to_le16 (EXT4_BG_BLOCK_UNINIT )) { +if (ext4_has_group_desc_csum (sb) && + (gdp->bg_flags &cpu_to_le16 (EXT4_BG_BLOCK_UNINIT ))) { gdp->bg_flags &=cpu_to_le16 (~EXT4_BG_BLOCK_UNINIT );ext4_free_group_clusters_set (sb, gdp,ext4_free_clusters_after_init (sb, group, gdp));
@@ -1243,7 +1253,10 @@ int ext4_init_inode_table(struct super_block *sb, ext4_group_t group, ext4_itable_unused_count(sb, gdp)), sbi->s_inodes_per_block); -if ((used_blks <0 ) || (used_blks > sbi->s_itb_per_group)) { +if ((used_blks <0 ) || (used_blks > sbi->s_itb_per_group) || + ((group ==0 ) && ((EXT4_INODES_PER_GROUP (sb) - +ext4_itable_unused_count (sb, gdp)) < +EXT4_FIRST_INO (sb)))) { ext4_error(sb, "Something is wrong with group %u: " "used itable blocks: %d; " "itable unused count: %u",
fs/ext4/inline.c +4 -38
71 lines not on this page · raw message
fs/ext4/inode.c +2 -1
@@ -3737,7 +3737,8 @@ static int __ext4_get_inode_loc(struct inode *inode,int inodes_per_block, inode_offset; iloc->bh =NULL ; -if (!ext4_valid_inum (sb, inode->i_ino)) +if (inode->i_ino <EXT4_ROOT_INO || + inode->i_ino >le32_to_cpu (EXT4_SB (sb)->s_es->s_inodes_count))return -EIO ; iloc->block_group = (inode->i_ino -1 ) /EXT4_INODES_PER_GROUP (sb);
fs/ext4/mballoc.c +4 -2
@@ -2415,7 +2415,8 @@ int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group,* initialize bb_free to be able to skip * empty groups without initialization */ -if (desc->bg_flags &cpu_to_le16 (EXT4_BG_BLOCK_UNINIT )) { +if (ext4_has_group_desc_csum (sb) && + (desc->bg_flags &cpu_to_le16 (EXT4_BG_BLOCK_UNINIT ))) { meta_group_info[i]->bb_free =ext4_free_clusters_after_init (sb, group, desc); }else {
@@ -2942,7 +2943,8 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,#endif ext4_set_bits (bitmap_bh->b_data, ac->ac_b_ex.fe_start, ac->ac_b_ex.fe_len); -if (gdp->bg_flags &cpu_to_le16 (EXT4_BG_BLOCK_UNINIT )) { +if (ext4_has_group_desc_csum (sb) && + (gdp->bg_flags &cpu_to_le16 (EXT4_BG_BLOCK_UNINIT ))) { gdp->bg_flags &=cpu_to_le16 (~EXT4_BG_BLOCK_UNINIT ); ext4_free_group_clusters_set(sb, gdp, ext4_free_clusters_after_init(sb,
fs/ext4/mmp.c +0 -1
@@ -48,7 +48,6 @@ static int write_mmp_block(struct super_block *sb, struct buffer_head *bh)*/ sb_start_write (sb);ext4_mmp_csum_set (sb, mmp); -mark_buffer_dirty (bh);lock_buffer (bh); bh->b_end_io = end_buffer_write_sync;get_bh (bh);
fs/ext4/resize.c +20 -0
@@ -1957,6 +1957,26 @@ retry: } } +/* +* Make sure the last group has enough space so that it's +* guaranteed to have enough space for all metadata blocks +* that it might need to hold. (We might not need to store +* the inode table blocks in the last block group, but there +* will be cases where this might be needed.) +*/ +if ((ext4_group_first_block_no (sb, n_group) + +ext4_group_overhead_blocks (sb, n_group) +2 + + sbi->s_itb_per_group + sbi->s_cluster_ratio) >= n_blocks_count) { + n_blocks_count =ext4_group_first_block_no (sb, n_group); + n_group--; + n_blocks_count_retry =0 ; +if (resize_inode) { +iput (resize_inode); + resize_inode =NULL ; + } + goto retry; + } +/* extend the last group */ if (n_group == o_group) add = n_blocks_count - o_blocks_count;
fs/ext4/super.c +12 -2
@@ -2064,7 +2064,7 @@ static int ext4_check_descriptors(struct super_block *sb,struct ext4_sb_info *sbi =EXT4_SB (sb);ext4_fsblk_t first_block =le32_to_cpu (sbi->s_es->s_first_data_block);ext4_fsblk_t last_block; -ext4_fsblk_t last_bg_block = sb_block +ext4_bg_num_gdb (sb,0 ) +1 ; +ext4_fsblk_t last_bg_block = sb_block +ext4_bg_num_gdb (sb,0 );ext4_fsblk_t block_bitmap;ext4_fsblk_t inode_bitmap;ext4_fsblk_t inode_table;
@@ -3132,6 +3132,9 @@ static ext4_group_t ext4_has_uninit_itable(struct super_block *sb)ext4_group_t group, ngroups =EXT4_SB (sb)->s_groups_count;struct ext4_group_desc *gdp =NULL ; +if (!ext4_has_group_desc_csum (sb)) +return ngroups; +for (group =0 ; group < ngroups; group++) { gdp =ext4_get_group_desc (sb, group,NULL );if (!gdp)
@@ -3791,6 +3794,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) }else { sbi->s_inode_size =le16_to_cpu (es->s_inode_size); sbi->s_first_ino =le32_to_cpu (es->s_first_ino); +if (sbi->s_first_ino <EXT4_GOOD_OLD_FIRST_INO ) { +ext4_msg (sb,KERN_ERR ,"invalid first ino: %u" , + sbi->s_first_ino); + goto failed_mount; + }if ((sbi->s_inode_size <EXT4_GOOD_OLD_INODE_SIZE ) || (!is_power_of_2 (sbi->s_inode_size)) || (sbi->s_inode_size > blocksize)) {
@@ -4015,12 +4023,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) goto failed_mount2; } } + sbi->s_gdb_count = db_count;if (!ext4_check_descriptors (sb, logical_sb_block, &first_not_zeroed)) {ext4_msg (sb,KERN_ERR ,"group descriptors corrupted!" ); goto failed_mount2; } - sbi->s_gdb_count = db_count;get_random_bytes (&sbi->s_next_generation,sizeof (u32));spin_lock_init (&sbi->s_next_gen_lock);
@@ -4237,11 +4245,13 @@ no_journal: block =ext4_count_free_clusters (sb);ext4_free_blocks_count_set (sbi->s_es,EXT4_C2B (sbi, block)); +ext4_superblock_csum_set (sb); err =percpu_counter_init (&sbi->s_freeclusters_counter, block,GFP_KERNEL );if (!err) {unsigned long freei =ext4_count_free_inodes (sb); sbi->s_es->s_free_inodes_count =cpu_to_le32 (freei); +ext4_superblock_csum_set (sb); err =percpu_counter_init (&sbi->s_freeinodes_counter, freei,GFP_KERNEL ); }
fs/ext4/xattr.c +23 -26
99 lines not on this page · raw message
fs/jbd2/transaction.c +1 -1
@@ -1283,11 +1283,11 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)* of the transaction. This needs to be done * once a transaction -bzzz */ - jh->b_modified =1 ;if (handle->h_buffer_credits <=0 ) { ret = -ENOSPC ; goto out_unlock_bh; } + jh->b_modified =1 ; handle->h_buffer_credits--; }
fs/nfsd/nfs4proc.c +1 -0
@@ -1347,6 +1347,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,if (status) { op = &args->ops[0 ]; op->status = status; + resp->opcnt =1 ; goto encode_op; }
fs/ocfs2/buffer_head_io.c +1 -0
@@ -330,6 +330,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,* for this bh as it's not marked locally * uptodate. */ status = -EIO ; +clear_buffer_needs_validate (bh);put_bh (bh); bhs[i] =NULL ;continue ;
fs/ocfs2/dlm/dlmmaster.c +2 -2
@@ -599,9 +599,9 @@ static void dlm_init_lockres(struct dlm_ctxt *dlm, res->last_used =0 ; -spin_lock (&dlm->spinlock); +spin_lock (&dlm->track_lock);list_add_tail (&res->tracking, &dlm->tracking_list); -spin_unlock (&dlm->spinlock); +spin_unlock (&dlm->track_lock);memset (res->lvb,0 ,DLM_LVB_LEN );memset (res->refmap,0 ,sizeof (res->refmap));
fs/proc/base.c +14 -0
@@ -279,6 +279,20 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,int err;int i; +/* +* The ability to racily run the kernel stack unwinder on a running task +* and then observe the unwinder output is scary; while it is useful for +* debugging kernel issues, it can also allow an attacker to leak kernel +* stack contents. +* Doing this in a manner that is at least safe from races would require +* some work to ensure that the remote task can not be scheduled; and +* even then, this would still expose the unwinder as local attack +* surface. +* Therefore, this interface is restricted to root. +*/ +if (!file_ns_capable (m->file, &init_user_ns,CAP_SYS_ADMIN )) +return -EACCES ; + entries =kmalloc (MAX_STACK_TRACE_DEPTH *sizeof (*entries),GFP_KERNEL );if (!entries)return -ENOMEM ;
fs/seq_file.c +4 -3
@@ -69,9 +69,10 @@ int seq_open(struct file *file, const struct seq_operations *op)memset (p,0 ,sizeof (*p));mutex_init (&p->lock); p->op = op; -#ifdef CONFIG_USER_NS - p->user_ns = file->f_cred->user_ns; -#endif + +// No refcounting: the lifetime of 'p' is constrained +// to the lifetime of the file. + p->file = file;/* * Wrappers around seq_open(e.g. swaps_open) need to be
fs/ubifs/super.c +3 -0
@@ -1917,6 +1917,9 @@ static struct ubi_volume_desc *open_ubi(const char *name, int mode)int dev, vol;char *endptr; +if (!name || !*name) +return ERR_PTR (-EINVAL ); +/* First, try to open using the device node path method */ ubi =ubi_open_volume_path (name, mode);if (!IS_ERR (ubi))
include/linux/netfilter_bridge/ebtables.h +5 -0
@@ -124,4 +124,9 @@ extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,/* True if the target is not a standard target */ #define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) +static inline bool ebt_invalid_target (int target) +{ +return (target < -NUM_STANDARD_TARGETS || target >=0 ); +} +#endif
include/linux/seq_file.h +4 -9
@@ -7,13 +7,10 @@#include <linux/mutex.h> #include <linux/cpumask.h> #include <linux/nodemask.h> +#include <linux/fs.h> +#include <linux/cred.h> struct seq_operations ; -struct file ; -struct path ; -struct inode ; -struct dentry ; -struct user_namespace ;struct seq_file {char *buf;
@@ -27,9 +24,7 @@ struct seq_file {struct mutex lock;const struct seq_operations *op;int poll_event; -#ifdef CONFIG_USER_NS -struct user_namespace *user_ns; -#endif +const struct file *file;void *private; };
@@ -151,7 +146,7 @@ int seq_put_decimal_ll(struct seq_file *m, char delimiter,static inline struct user_namespace *seq_user_ns (struct seq_file *seq) {#ifdef CONFIG_USER_NS -return seq->user_ns; +return seq->file->f_cred->user_ns;#else extern struct user_namespace init_user_ns;return &init_user_ns;
include/linux/slub_def.h +2 -1
@@ -67,7 +67,8 @@ struct kmem_cache {int size;/* The size of an object including meta data */ int object_size;/* The size of an object without meta data */ int offset;/* Free pointer offset. */ -int cpu_partial;/* Number of per cpu partial objects to keep around */ +/* Number of per cpu partial objects to keep around */ +unsigned int cpu_partial;struct kmem_cache_order_objects oo;/* Allocation and freeing of slabs */
include/media/v4l2-fh.h +1 -0
@@ -43,6 +43,7 @@ struct v4l2_fh {wait_queue_head_t wait;struct list_head subscribed;/* Subscribed events */ struct list_head available;/* Dequeueable event */ +struct mutex subscribe_lock;unsigned int navailable;u32 sequence;
kernel/cgroup.c +5 -1
@@ -3669,7 +3669,11 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from)*/ do { css_task_iter_start(&from->self, &it); - task = css_task_iter_next(&it); + + do { + task = css_task_iter_next(&it); + } while (task && (task->flags & PF_EXITING)); + if (task) get_task_struct(task); css_task_iter_end(&it);
kernel/module.c +5 -1
@@ -3592,7 +3592,7 @@ static unsigned long mod_find_symname(struct module *mod, const char *name)for (i =0 ; i < kallsyms->num_symtab; i++)if (strcmp (name,symname (kallsyms, i)) ==0 && - kallsyms->symtab[i].st_info !='U' ) + kallsyms->symtab[i].st_shndx !=SHN_UNDEF )return kallsyms->symtab[i].st_value;return 0 ; }
@@ -3636,6 +3636,10 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,if (mod->state ==MODULE_STATE_UNFORMED )continue ;for (i =0 ; i < kallsyms->num_symtab; i++) { + +if (kallsyms->symtab[i].st_shndx ==SHN_UNDEF ) +continue ; + ret =fn (data,symname (kallsyms, i), mod, kallsyms->symtab[i].st_value);if (ret !=0 )
kernel/time/alarmtimer.c +2 -1
@@ -776,7 +776,8 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags,/* Convert (if necessary) to absolute time */ if (flags !=TIMER_ABSTIME ) {ktime_t now = alarm_bases[type].gettime (); - exp =ktime_add (now, exp); + + exp =ktime_add_safe (now, exp); }if (alarmtimer_do_nsleep (&alarm, exp))
kernel/trace/ring_buffer.c +2 -0
@@ -1542,6 +1542,8 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages) tmp_iter_page = first_page; do { + cond_resched(); + to_remove_page = tmp_iter_page; rb_inc_page(cpu_buffer, &tmp_iter_page);
mm/madvise.c +1 -1
@@ -75,7 +75,7 @@ static long madvise_behavior(struct vm_area_struct *vma, new_flags |=VM_DONTDUMP ;break ;case MADV_DODUMP : -if (new_flags &VM_SPECIAL ) { +if (!is_vm_hugetlb_page (vma) && new_flags &VM_SPECIAL ) { error = -EINVAL ; goto out; }
mm/shmem.c +2 -0
@@ -1454,6 +1454,8 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inodempol_shared_policy_init (&info->policy,NULL );break ; } + +lockdep_annotate_inode_mutex_key (inode); }else shmem_free_inode (sb);return inode;
mm/slub.c +3 -3
@@ -1577,7 +1577,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, {struct page *page, *page2;void *object =NULL ; -int available =0 ; +unsigned int available =0 ;int objects;/*
@@ -4366,10 +4366,10 @@ static ssize_t cpu_partial_show(struct kmem_cache *s, char *buf)static ssize_t cpu_partial_store (struct kmem_cache *s,const char *buf,size_t length) { -unsigned long objects; +unsigned int objects;int err; - err =kstrtoul (buf,10 , &objects); + err =kstrtouint (buf,10 , &objects);if (err)return err;if (objects && !kmem_cache_has_cpu_partial (s))
net/bridge/netfilter/ebt_arpreply.c +3 -0
@@ -67,6 +67,9 @@ static int ebt_arpreply_tg_check(const struct xt_tgchk_param *par)if (e->ethproto !=htons (ETH_P_ARP ) || e->invflags &EBT_IPROTO )return -EINVAL ; +if (ebt_invalid_target (info->target)) +return -EINVAL ; +return 0 ; }
net/core/neighbour.c +8 -5
@@ -1147,6 +1147,12 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, lladdr = neigh->ha; } +/* Update confirmed timestamp for neighbour entry after we +* received ARP packet even if it doesn't change IP to MAC binding. +*/ +if (new &NUD_CONNECTED ) + neigh->confirmed = jiffies; +/* If entry was valid and address is not changed, do not change entry state, if new one is STALE. */
@@ -1170,15 +1176,12 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, } } -/* Update timestamps only once we know we will make a change to the +/* Update timestamp only once we know we will make a change to the * neighbour entry. Otherwise we risk to move the locktime window with * noop updates and ignore relevant ARP updates. */ -if (new != old || lladdr != neigh->ha) { -if (new &NUD_CONNECTED ) - neigh->confirmed = jiffies; +if (new != old || lladdr != neigh->ha) neigh->updated = jiffies; - }if (new != old) {neigh_del_timer (neigh);
net/ipv4/af_inet.c +1 -0
@@ -1288,6 +1288,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb,if (encap)skb_reset_inner_headers (skb); skb->network_header = (u8 *)iph - skb->head; +skb_reset_mac_len (skb); }while ((skb = skb->next)); out:
net/ipv6/ip6_offload.c +1 -0
@@ -118,6 +118,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, ipv6h = (struct ipv6hdr *)(skb_mac_header (skb) + nhoff); ipv6h->payload_len =htons (skb->len - nhoff -sizeof (*ipv6h)); skb->network_header = (u8 *)ipv6h - skb->head; +skb_reset_mac_len (skb);if (udpfrag) {int err =ip6_find_1stfragopt (skb, &prevhdr);
net/ipv6/ip6_output.c +2 -1
@@ -183,9 +183,10 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,kfree_skb (skb);return -ENOBUFS ; } +if (skb->sk) +skb_set_owner_w (skb2, skb->sk);consume_skb (skb); skb = skb2; -skb_set_owner_w (skb, sk); }if (opt->opt_flen)ipv6_push_frag_opts (skb, opt, &proto);
net/mac80211/cfg.c +1 -1
@@ -210,7 +210,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,case NL80211_IFTYPE_AP :case NL80211_IFTYPE_AP_VLAN :/* Keys without a station are used for TX only */ -if (key->sta &&test_sta_flag (key->sta,WLAN_STA_MFP )) +if (sta &&test_sta_flag (sta,WLAN_STA_MFP )) key->conf.flags |=IEEE80211_KEY_FLAG_RX_MGMT ;break ;case NL80211_IFTYPE_ADHOC :
net/mac80211/ibss.c +11 -11
@@ -944,8 +944,8 @@ static void ieee80211_rx_mgmt_deauth_ibss(struct ieee80211_sub_if_data *sdata,if (len <IEEE80211_DEAUTH_FRAME_LEN )return ; -ibss_dbg (sdata,"RX DeAuth SA=%pM DA=%pM BSSID=%pM (reason: %d)\n" , - mgmt->sa, mgmt->da, mgmt->bssid, reason); +ibss_dbg (sdata,"RX DeAuth SA=%pM DA=%pM\n" , mgmt->sa, mgmt->da); +ibss_dbg (sdata,"\tBSSID=%pM (reason: %d)\n" , mgmt->bssid, reason);sta_info_destroy_addr (sdata, mgmt->sa); }
@@ -963,9 +963,9 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata, auth_alg =le16_to_cpu (mgmt->u.auth.auth_alg); auth_transaction =le16_to_cpu (mgmt->u.auth.auth_transaction); -ibss_dbg (sdata, -"RX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=%d)\n" , - mgmt->sa, mgmt->da, mgmt->bssid, auth_transaction); +ibss_dbg (sdata,"RX Auth SA=%pM DA=%pM\n" , mgmt->sa, mgmt->da); +ibss_dbg (sdata,"\tBSSID=%pM (auth_transaction=%d)\n" , + mgmt->bssid, auth_transaction);if (auth_alg !=WLAN_AUTH_OPEN || auth_transaction !=1 )return ;
@@ -1130,10 +1130,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, rx_timestamp =drv_get_tsf (local, sdata); } -ibss_dbg (sdata, -"RX beacon SA=%pM BSSID=%pM TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n" , +ibss_dbg (sdata,"RX beacon SA=%pM BSSID=%pM TSF=0x%llx\n" , mgmt->sa, mgmt->bssid, - (unsigned long long )rx_timestamp, + (unsigned long long )rx_timestamp); +ibss_dbg (sdata,"\tBCN=0x%llx diff=%lld @%lu\n" , (unsigned long long )beacon_timestamp, (unsigned long long )(rx_timestamp - beacon_timestamp), jiffies);
@@ -1414,9 +1414,9 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata, tx_last_beacon =drv_tx_last_beacon (local); -ibss_dbg (sdata, -"RX ProbeReq SA=%pM DA=%pM BSSID=%pM (tx_last_beacon=%d)\n" , - mgmt->sa, mgmt->da, mgmt->bssid, tx_last_beacon); +ibss_dbg (sdata,"RX ProbeReq SA=%pM DA=%pM\n" , mgmt->sa, mgmt->da); +ibss_dbg (sdata,"\tBSSID=%pM (tx_last_beacon=%d)\n" , + mgmt->bssid, tx_last_beacon);if (!tx_last_beacon &&is_multicast_ether_addr (mgmt->da))return ;
net/mac80211/main.c +21 -5
@@ -258,8 +258,27 @@ static void ieee80211_restart_work(struct work_struct *work) "%s called with hardware scan in progress\n", __func__);rtnl_lock (); -list_for_each_entry (sdata, &local->interfaces, list) +list_for_each_entry (sdata, &local->interfaces, list) { +/* +* XXX: there may be more work for other vif types and even +* for station mode: a good thing would be to run most of +* the iface type's dependent _stop (ieee80211_mg_stop, +* ieee80211_ibss_stop) etc... +* For now, fix only the specific bug that was seen: race +* between csa_connection_drop_work and us. +*/ +if (sdata->vif.type ==NL80211_IFTYPE_STATION ) { +/* +* This worker is scheduled from the iface worker that +* runs on mac80211's workqueue, so we can't be +* scheduling this worker after the cancel right here. +* The exception is ieee80211_chswitch_done. +* Then we can have a race... +*/ +cancel_work_sync (&sdata->u.mgd.csa_connection_drop_work); + }flush_delayed_work (&sdata->dec_tailroom_needed_wk); + }ieee80211_scan_cancel (local);ieee80211_reconfig (local);rtnl_unlock ();
@@ -465,10 +484,7 @@ static const struct ieee80211_vht_cap mac80211_vht_capa_mod_mask = { cpu_to_le32(IEEE80211_VHT_CAP_RXLDPC | IEEE80211_VHT_CAP_SHORT_GI_80 | IEEE80211_VHT_CAP_SHORT_GI_160 | - IEEE80211_VHT_CAP_RXSTBC_1 | - IEEE80211_VHT_CAP_RXSTBC_2 | - IEEE80211_VHT_CAP_RXSTBC_3 | - IEEE80211_VHT_CAP_RXSTBC_4 | + IEEE80211_VHT_CAP_RXSTBC_MASK | IEEE80211_VHT_CAP_TXSTBC | IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
net/mac80211/mlme.c +53 -0
71 lines not on this page · raw message
net/wireless/nl80211.c +1 -0
@@ -9223,6 +9223,7 @@ static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info)return -EOPNOTSUPP ;if (!info->attrs[NL80211_ATTR_MDID ] || + !info->attrs[NL80211_ATTR_IE ] || !is_valid_ie_attr (info->attrs[NL80211_ATTR_IE ]))return -EINVAL ;
sound/aoa/core/gpio-feature.c +3 -1
@@ -88,8 +88,10 @@ static struct device_node *get_gpio(char *name, } reg =of_get_property (np,"reg" ,NULL ); -if (!reg) +if (!reg) { +of_node_put (np);return NULL ; + } *gpioptr = *reg;
sound/firewire/bebob/bebob_maudio.c +14 -10
@@ -96,17 +96,13 @@ int snd_bebob_maudio_load_firmware(struct fw_unit *unit)struct fw_device *device =fw_parent_device (unit);int err, rcode;u64 date; -__le32 cues[3 ] = { -cpu_to_le32 (MAUDIO_BOOTLOADER_CUE1 ), -cpu_to_le32 (MAUDIO_BOOTLOADER_CUE2 ), -cpu_to_le32 (MAUDIO_BOOTLOADER_CUE3 ) - }; +__le32 *cues;/* check date of software used to build */ err =snd_bebob_read_block (unit,INFO_OFFSET_SW_DATE , &date,sizeof (u64));if (err <0 ) - goto end; +return err;/* * firmware version 5058 or later has date later than "20070401", but * 'date' is not null-terminated.
@@ -114,20 +110,28 @@ int snd_bebob_maudio_load_firmware(struct fw_unit *unit)if (date <0x3230303730343031LL ) {dev_err (&unit->device,"Use firmware version 5058 or later\n" ); - err = -ENOSYS ; - goto end; +return -ENXIO ; } + cues =kmalloc_array (3 ,sizeof (*cues),GFP_KERNEL ); +if (!cues) +return -ENOMEM ; + + cues[0 ] =cpu_to_le32 (MAUDIO_BOOTLOADER_CUE1 ); + cues[1 ] =cpu_to_le32 (MAUDIO_BOOTLOADER_CUE2 ); + cues[2 ] =cpu_to_le32 (MAUDIO_BOOTLOADER_CUE3 ); + rcode =fw_run_transaction (device->card,TCODE_WRITE_BLOCK_REQUEST , device->node_id, device->generation, device->max_speed,BEBOB_ADDR_REG_REQ , - cues,sizeof (cues)); + cues,3 *sizeof (*cues)); +kfree (cues);if (rcode !=RCODE_COMPLETE ) {dev_err (&unit->device,"Failed to send a cue to load firmware\n" ); err = -EIO ; } -end: +return err; }
sound/pci/emu10k1/emufx.c +1 -1
@@ -2521,7 +2521,7 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un emu->support_tlv =1 ;return put_user (SNDRV_EMU10K1_VERSION , (int __user *)argp);case SNDRV_EMU10K1_IOCTL_INFO : - info =kmalloc (sizeof (*info),GFP_KERNEL ); + info =kzalloc (sizeof (*info),GFP_KERNEL );if (!info)return -ENOMEM ;snd_emu10k1_fx8010_info (emu, info);
sound/pci/hda/hda_intel.c +2 -1
@@ -2094,7 +2094,8 @@ static const struct pci_device_id azx_ids[] = { .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },/* AMD Raven */ { PCI_DEVICE(0x1022, 0x15e3), - .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB }, + .driver_data =AZX_DRIVER_GENERIC |AZX_DCAPS_PRESET_ATI_SB | + AZX_DCAPS_PM_RUNTIME }, /* ATI HDMI */ { PCI_DEVICE(0x1002, 0x0002), .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
sound/soc/codecs/cs4265.c +2 -2
@@ -174,8 +174,8 @@ static const struct snd_kcontrol_new cs4265_snd_controls[] = {SOC_SINGLE ("Validity Bit Control Switch" ,CS4265_SPDIF_CTL2 ,3 ,1 ,0 ),SOC_ENUM ("SPDIF Mono/Stereo" , spdif_mono_stereo_enum), -SOC_SINGLE ("MMTLR Data Switch" ,0 , -1 ,1 ,0 ), +SOC_SINGLE ("MMTLR Data Switch" ,CS4265_SPDIF_CTL2 , +0 ,1 ,0 ),SOC_ENUM ("Mono Channel Select" , spdif_mono_select_enum), SND_SOC_BYTES("C Data Buffer", CS4265_C_DATA_BUFF, 24), };
sound/soc/soc-dapm.c +7 -0
@@ -3400,6 +3400,13 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)continue ; } +/* let users know there is no DAI to link */ +if (!dai_w->priv) { +dev_dbg (card->dev,"dai widget %s has no DAI\n" , + dai_w->name); +continue ; + } + dai = dai_w->priv;/* ...find all widgets with the same stream and link them */
tools/vm/page-types.c +0 -6
@@ -151,12 +151,6 @@ static const char * const page_flag_names[] = { }; -static const char *const debugfs_known_mountpoints[] = { -"/sys/kernel/debug" , -"/debug" , -0 , -}; -/* * data structures */
tools/vm/slabinfo.c +2 -2
@@ -29,8 +29,8 @@ struct slabinfo {int alias;int refs;int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu; -int hwcache_align, object_size, objs_per_slab; -int sanity_checks, slab_size, store_user, trace; +unsigned int hwcache_align, object_size, objs_per_slab; +unsigned int sanity_checks, slab_size, store_user, trace;int order, poison, reclaim_account, red_zone;unsigned long partial, objects, slabs, objects_partial, objects_total;unsigned long alloc_fastpath, alloc_slowpath;
Quoted 1 line · Greg KH
I'm announcing the release of the 3.18.124 kernel.
$Subject inadvertently says 3.18.123, something wrong with your scripts?
Cheers,
Sven
Greg KH
maintainerQuoted 5 lines · Sven Joachim
Quoted 1 line · Greg KH
I'm announcing the release of the 3.18.124 kernel.
$Subject inadvertently says 3.18.123, something wrong with your scripts?
It's a manual thing, yeah, my fault, let me redo this...