Linux 3.18.126
Greg KH
maintainerI'm announcing the release of the 3.18.126 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/alpha/include/asm/termios.h | 8 - arch/alpha/include/uapi/asm/ioctls.h | 5 arch/alpha/include/uapi/asm/termbits.h | 17 ++ arch/mips/kernel/crash.c | 3 arch/mips/kernel/machine_kexec.c | 3 arch/powerpc/boot/crt0.S | 4 arch/powerpc/mm/tlb_nohash.c | 3 arch/sparc/kernel/perf_event.c | 26 ++- arch/x86/boot/tools/build.c | 7 arch/x86/kernel/check.c | 15 + arch/xtensa/kernel/head.S | 7 crypto/lrw.c | 7 drivers/block/ataflop.c | 25 +-- drivers/block/swim.c | 13 + drivers/cdrom/cdrom.c | 2 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 11 + drivers/iio/adc/at91_adc.c | 6 drivers/md/bcache/btree.c | 2 drivers/md/dm-ioctl.c | 18 -- drivers/md/dm.c | 1 drivers/media/i2c/tvp5150.c | 14 + drivers/media/pci/cx23885/altera-ci.c | 10 + drivers/media/usb/em28xx/em28xx-cards.c | 4 drivers/media/usb/em28xx/em28xx-video.c | 8 - drivers/misc/genwqe/card_base.h | 2 drivers/misc/genwqe/card_dev.c | 9 - drivers/mmc/host/sdhci-pci-o2micro.c | 3 drivers/mtd/devices/Kconfig | 2 drivers/net/ethernet/qlogic/qla3xxx.c | 2 drivers/net/tun.c | 2 drivers/net/wireless/ath/ath10k/wmi.c | 6 drivers/pcmcia/ricoh.h | 35 ++++ drivers/pcmcia/yenta_socket.c | 3 drivers/scsi/esp_scsi.c | 1 drivers/scsi/esp_scsi.h | 2 drivers/scsi/lpfc/lpfc_sli.c | 7 drivers/scsi/mac_esp.c | 2 drivers/tc/tc.c | 8 - drivers/tty/serial/kgdboc.c | 5 drivers/tty/tty_io.c | 2 drivers/tty/tty_ioctl.c | 4 drivers/uio/uio.c | 9 + drivers/usb/chipidea/otg.h | 3 drivers/video/fbdev/aty/mach64_accel.c | 28 +-- drivers/w1/masters/omap_hdq.c | 2 fs/cifs/cifs_debug.c | 3 fs/cifs/cifs_spnego.c | 6 fs/cifs/inode.c | 10 + fs/configfs/symlink.c | 2 fs/cramfs/inode.c | 3 fs/ext4/inline.c | 2 fs/ext4/move_extent.c | 8 - fs/ext4/namei.c | 5 fs/ext4/resize.c | 28 ++- fs/ext4/super.c | 16 +- fs/ext4/xattr.c | 4 fs/fuse/dev.c | 4 fs/gfs2/ops_fstype.c | 3 fs/jbd2/checkpoint.c | 4 fs/jffs2/super.c | 4 fs/lockd/host.c | 2 fs/namespace.c | 22 ++ fs/nfs/nfs4client.c | 16 +- fs/ocfs2/dir.c | 3 include/linux/ceph/libceph.h | 8 - include/linux/tc.h | 1 kernel/bounds.c | 4 kernel/kprobes.c | 27 ++- kernel/locking/lockdep.c | 4 kernel/printk/printk.c | 7 kernel/signal.c | 2 lib/debug_locks.c | 2 mm/hugetlb.c | 23 ++ net/9p/protocol.c | 5 net/ipv4/cipso_ipv4.c | 11 - net/sunrpc/svc_xprt.c | 2 net/sunrpc/xdr.c | 5 security/integrity/ima/ima_fs.c | 6 sound/pci/ca0106/ca0106.h | 2 tools/perf/util/trace-event-info.c | 2 tools/perf/util/trace-event-read.c | 5 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc | 80 ++++++++++ 83 files changed, 540 insertions(+), 159 deletions(-)
Al Viro (1):
gfs2_meta: ->mount() can get NULL dev_name
Alex Stanoev (1):
ALSA: ca0106: Disable IZD on SB0570 DAC to fix audio pops
Alexandre Belloni (1):
uio: ensure class is registered before devices
Amir Goldstein (1):
lockd: fix access beyond unterminated strings in prints
Andreas Kemnade (1):
w1: omap-hdq: fix missing bus unregister at removal
Arnd Bergmann (2):
kbuild: fix kernel/bounds.c 'W=1' warning
mtd: docg3: don't set conflicting BCH_CONST_PARAMS option
Ben Hutchings (1):
x86: boot: Fix EFI stub alignment
Changwei Ge (1):
ocfs2: fix a misuse a of brelse after failing ocfs2_check_dir_entry
Corey Wright (1):
dm: remove duplicate dm_get_live_table() in __dm_destroy()
Daniel Axtens (1):
powerpc/nohash: fix undefined behaviour when testing page size support
David S. Miller (2):
sparc: Fix single-pcr perf event counter management.
sparc: Throttle perf events properly.
Dengcheng Zhu (1):
MIPS: kexec: Mark CPU offline before disabling local IRQ
Dominique Martinet (1):
9p: clear dangling pointers in p9stat_free
Eric Biggers (1):
ima: fix showing large 'violations' or 'runtime_measurements_count'
Eric W. Biederman (5):
signal: Always deliver the kernel's SIGKILL and SIGSTOP to a pid namespace init signal/GenWQE: Fix sending of SIGKILL
mount: Retest MNT_LOCKED in do_umount
mount: Don't allow copying MNT_UNBINDABLE|MNT_LOCKED mounts
mount: Prevent MNT_DETACH from disconnecting locked mounts
Eugen Hristev (2):
iio: adc: at91: fix acking DRDY irq on simple conversions
iio: adc: at91: fix wrong channel number in triggered buffer mode
Finn Thain (1):
scsi: esp_scsi: Track residual for PIO transfers
Frank Sorenson (1):
sunrpc: correct the computation for page_ptr when truncating
Greg Kroah-Hartman (1):
Linux 3.18.126
Guenter Roeck (1):
configfs: replace strncpy with memcpy
H. Peter Anvin (1):
termios, tty/tty_baudrate.c: fix buffer overrun
H. Peter Anvin (Intel) (1):
arch/alpha, termios: implement BOTHER, IBSHIFT and termios2
He Zhe (3):
x86/corruption-check: Fix panic in memory_corruption_check() when boot option without value is provided
printk: Fix panic caused by passing log_buf_len to command line
kgdboc: Passing ekgdboc to command line causes panic
Hou Tao (1):
jffs2: free jffs2_sb_info through jffs2_kill_sb()
Ilya Dryomov (1):
libceph: bump CEPH_MSG_MAX_DATA_LEN
James Smart (1):
scsi: lpfc: Correct soft lockup when running mds diagnostics
Jan Kara (1):
jbd2: fix use after free in jbd2_log_do_checkpoint()
Joel Stanley (1):
powerpc/boot: Ensure _zimage_start is a weak symbol
Loic Poulain (1):
usb: chipidea: Prevent unbalanced IRQ disable
Lukas Czerner (1):
ext4: initialize retries variable in ext4_da_write_inline_data_begin()
Maciej S. Szmigiero (1):
pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges
Maciej W. Rozycki (1):
TC: Set DMA masks for devices
Marco Felsch (1):
media: tvp5150: fix width alignment during set_selection()
Martin Willi (1):
ath10k: schedule hardware restart if WMI command times out
Masami Hiramatsu (2):
selftests: ftrace: Add synthetic event syntax testcase
kprobes: Return error if we fail to reuse kprobe instead of BUG_ON()
Mauro Carvalho Chehab (3):
media: em28xx: use a default format if TRY_FMT fails
media: em28xx: fix input name for Terratec AV 350
media: em28xx: make v4l2-compliance happier by starting sequence on zero
Max Filippov (1):
xtensa: fix boot parameters address translation
Mike Kravetz (1):
hugetlbfs: fix kernel BUG at fs/hugetlbfs/inode.c:444!
Miklos Szeredi (1):
fuse: fix leaked notify reply
Mikulas Patocka (2):
mach64: fix display corruption on big endian machines
mach64: fix image corruption due to reading accelerator registers
Miles Chen (1):
tty: check name length in tty_find_polling_driver()
Nathan Chancellor (1):
net: qla3xxx: Remove overflowing shift statement
Nicholas Mc Guire (1):
media: pci: cx23885: handle adding to list failure
Nicolas Pitre (1):
Cramfs: fix abad comparison when wrap-arounds occur
Omar Sandoval (2):
ataflop: fix error handling during setup
swim: fix cleanup on setup error
Ondrej Mosnacek (1):
crypto: lrw - Fix out-of bounds access on counter overflow
Sanskriti Sharma (2):
perf tools: Free temporary 'sys' string in read_event_files() perf tools: Cleanup trace-event-info 'tdata' leak
Serhey Popovych (1):
tun: Consistently configure generic netdev params via rtnetlink
Stefan Nuernberger (1):
net/ipv4: defensive cipso option parsing
Steve French (3):
smb3: allow stats which track session and share reconnects to be reset
smb3: do not attempt cifs operation in smb3 query info error path
smb3: on kerberos mount if server doesn't specify auth type use krb5
Tang Junhui (1):
bcache: fix miss key refill->end in writeback
Theodore Ts'o (3):
ext4: fix argument checking in EXT4_IOC_MOVE_EXT
ext4: avoid possible double brelse() in add_new_gdb() on error path
ext4: fix possible leak of sbi->s_group_desc_leak in error path
Tomi Valkeinen (1):
drm/omap: fix memory barrier bug in DMM driver
Trond Myklebust (2):
NFSv4.1: Fix the r/wsize checking
nfsd: Fix an Oops in free_session()
Vasily Averin (10):
ext4: add missing brelse() update_backups()'s error path
ext4: add missing brelse() in set_flexbg_block_bitmap()'s error path
ext4: add missing brelse() add_new_gdb_meta_bg()'s error path
ext4: avoid potential extra brelse in setup_new_flex_group_blocks()
ext4: fix possible inode leak in the retry loop of ext4_resize_fs()
ext4: avoid buffer leak in ext4_orphan_add() after prior errors
ext4: fix missing cleanup if ext4_alloc_flex_bg_array() fails while resizing
ext4: release bs.bh before re-using in ext4_xattr_block_find()
ext4: fix buffer leak in ext4_xattr_move_to_block() on error path
ext4: fix buffer leak in __ext4_read_dirblock() on error path
Waiman Long (1):
locking/lockdep: Fix debug_locks off performance problem
Wenwen Wang (1):
dm ioctl: harden copy_params()'s copy_from_user() from malicious users
Young_X (1):
cdrom: fix improper type cast, which can leat to information leak.
Yu Zhao (1):
mmc: sdhci-pci-o2micro: Add quirk for O2 Micro dev 0x8620 rev 0x01
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 125 +SUBLEVEL = 126 EXTRAVERSION = NAME = Diseased Newt
arch/alpha/include/asm/termios.h +7 -1
@@ -72,9 +72,15 @@ })#define user_termios_to_kernel_termios (k, u) \ - copy_from_user(k, u, sizeof(struct termios)) + copy_from_user(k, u, sizeof(struct termios2))#define kernel_termios_to_user_termios (u, k) \ + copy_to_user(u, k, sizeof(struct termios2)) + +#define user_termios_to_kernel_termios_1 (k, u) \ + copy_from_user(k, u, sizeof(struct termios)) + +#define kernel_termios_to_user_termios_1 (u, k) \ copy_to_user(u, k, sizeof(struct termios))#endif /* _ALPHA_TERMIOS_H */
arch/alpha/include/uapi/asm/ioctls.h +5 -0
@@ -31,6 +31,11 @@#define TCXONC _IO('t', 30)#define TCFLSH _IO('t', 31) +#define TCGETS2 _IOR('T', 42, struct termios2) +#define TCSETS2 _IOW('T', 43, struct termios2) +#define TCSETSW2 _IOW('T', 44, struct termios2) +#define TCSETSF2 _IOW('T', 45, struct termios2) +#define TIOCSWINSZ _IOW('t', 103, struct winsize)#define TIOCGWINSZ _IOR('t', 104, struct winsize)#define TIOCSTART _IO('t', 110)/* start output, like ^Q */
arch/alpha/include/uapi/asm/termbits.h +17 -0
@@ -25,6 +25,19 @@ struct termios {speed_t c_ospeed;/* output speed */ }; +/* Alpha has identical termios and termios2 */ + +struct termios2 { +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_cc[NCCS ];/* control characters */ +cc_t c_line;/* line discipline (== c_cc[19]) */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ +}; +/* Alpha has matching termios and ktermios */ struct ktermios {
@@ -147,6 +160,7 @@ struct ktermios {#define B3000000 00034#define B3500000 00035#define B4000000 00036 +#define BOTHER 00037#define CSIZE 00001400#define CS5 00000000
@@ -164,6 +178,9 @@ struct ktermios {#define CMSPAR 010000000000/* mark or space (stick) parity */ #define CRTSCTS 020000000000/* flow control */ +#define CIBAUD 07600000 +#define IBSHIFT 16 +/* c_lflag bits */ #define ISIG 0x00000080#define ICANON 0x00000100
arch/mips/kernel/crash.c +3 -0
@@ -34,6 +34,9 @@ static void crash_shutdown_secondary(void *passed_regs)if (!cpu_online (cpu))return ; +/* We won't be sent IPIs any more. */ +set_cpu_online (cpu, false); +local_irq_disable ();if (!cpu_isset (cpu, cpus_in_crash))crash_save_cpu (regs, cpu);
arch/mips/kernel/machine_kexec.c +3 -0
@@ -95,6 +95,9 @@ machine_kexec(struct kimage *image) *ptr = (unsigned long )phys_to_virt (*ptr); } +/* Mark offline BEFORE disabling local irq. */ +set_cpu_online (smp_processor_id (), false); +/* * we do not want to be bothered. */
arch/powerpc/boot/crt0.S +3 -1
@@ -47,8 +47,10 @@ p_end: .long _end p_pstack: .long _platform_stack_top #endif - .weak _zimage_start .globl _zimage_start + /* Clang appears to require the .weak directive to be after the symbol + * is defined. See https://bugs.llvm.org/show_bug.cgi?id=38921 */ + .weak _zimage_start _zimage_start: .globl _zimage_start_lib _zimage_start_lib:
arch/powerpc/mm/tlb_nohash.c +3 -0
@@ -479,6 +479,9 @@ static void setup_page_sizes(void)for (psize =0 ; psize <MMU_PAGE_COUNT ; ++psize) {struct mmu_psize_def *def = &mmu_psize_defs[psize]; +if (!def->shift) +continue ; +if (tlb1ps & (1U << (def->shift -10 ))) { def->flags |=MMU_PAGE_SIZE_DIRECT ;
arch/sparc/kernel/perf_event.c +22 -4
@@ -23,6 +23,7 @@#include <asm/cpudata.h> #include <asm/uaccess.h> #include <linux/atomic.h> +#include <linux/sched_clock.h> #include <asm/nmi.h> #include <asm/pcr.h> #include <asm/cacheflush.h>
@@ -919,6 +920,8 @@ static void read_in_all_counters(struct cpu_hw_events *cpuc)sparc_perf_event_update (cp, &cp->hw, cpuc->current_idx[i]); cpuc->current_idx[i] =PIC_NO_INDEX ; +if (cp->hw.state &PERF_HES_STOPPED ) + cp->hw.state |=PERF_HES_ARCH ; } } }
@@ -951,10 +954,12 @@ static void calculate_single_pcr(struct cpu_hw_events *cpuc) enc =perf_event_get_enc (cpuc->events[i]); cpuc->pcr[0 ] &= ~mask_for_index (idx); -if (hwc->state &PERF_HES_STOPPED ) +if (hwc->state &PERF_HES_ARCH ) { cpuc->pcr[0 ] |=nop_for_index (idx); -else + }else { cpuc->pcr[0 ] |=event_encoding (enc, idx); + hwc->state =0 ; + } } out: cpuc->pcr[0 ] |= cpuc->event[0 ]->hw.config_base;
@@ -980,6 +985,9 @@ static void calculate_multiple_pcrs(struct cpu_hw_events *cpuc) cpuc->current_idx[i] = idx; +if (cp->hw.state &PERF_HES_ARCH ) +continue ; +sparc_pmu_start (cp,PERF_EF_RELOAD ); } out:
@@ -1071,6 +1079,8 @@ static void sparc_pmu_start(struct perf_event *event, int flags) event->hw.state =0 ;sparc_pmu_enable_event (cpuc, &event->hw, idx); + +perf_event_update_userpage (event); }static void sparc_pmu_stop (struct perf_event *event,int flags)
@@ -1363,9 +1373,9 @@ static int sparc_pmu_add(struct perf_event *event, int ef_flags) cpuc->events[n0] = event->hw.event_base; cpuc->current_idx[n0] =PIC_NO_INDEX ; - event->hw.state =PERF_HES_UPTODATE ; + event->hw.state =PERF_HES_UPTODATE |PERF_HES_STOPPED ;if (!(ef_flags &PERF_EF_START )) - event->hw.state |=PERF_HES_STOPPED ; + event->hw.state |=PERF_HES_ARCH ;/* * If group events scheduling transaction was started,
@@ -1577,6 +1587,8 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,struct perf_sample_data data;struct cpu_hw_events *cpuc;struct pt_regs *regs; +u64 finish_clock; +u64 start_clock;int i;if (!atomic_read (&active_events))
@@ -1590,6 +1602,8 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,return NOTIFY_DONE ; } + start_clock =sched_clock (); + regs = args->regs; cpuc =this_cpu_ptr (&cpu_hw_events);
@@ -1628,6 +1642,10 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,sparc_pmu_stop (event,0 ); } + finish_clock =sched_clock (); + +perf_sample_event_took (finish_clock - start_clock); +return NOTIFY_STOP ; }
arch/x86/boot/tools/build.c +7 -0
@@ -391,6 +391,13 @@ int main(int argc, char ** argv)die ("Unable to mmap '%s': %m" , argv[2 ]);/* Number of 16-byte paragraphs, including space for a 4-byte CRC */ sys_size = (sz +15 +4 ) /16 ; +#ifdef CONFIG_EFI_STUB +/* +* COFF requires minimum 32-byte alignment of sections, and +* adding a signature is problematic without that alignment. +*/ + sys_size = (sys_size +1 ) & ~1 ; +#endif /* Patch the setup code with the appropriate size parameters */ buf[0x1f1 ] = setup_sectors-1 ;
arch/x86/kernel/check.c +15 -0
@@ -30,6 +30,11 @@ static __init int set_corruption_check(char *arg)ssize_t ret;unsigned long val; +if (!arg) { +pr_err ("memory_corruption_check config string not provided\n" ); +return -EINVAL ; + } + ret =kstrtoul (arg,10 , &val);if (ret)return ret;
@@ -44,6 +49,11 @@ static __init int set_corruption_check_period(char *arg)ssize_t ret;unsigned long val; +if (!arg) { +pr_err ("memory_corruption_check_period config string not provided\n" ); +return -EINVAL ; + } + ret =kstrtoul (arg,10 , &val);if (ret)return ret;
@@ -58,6 +68,11 @@ static __init int set_corruption_check_size(char *arg)char *end;unsigned size; +if (!arg) { +pr_err ("memory_corruption_check_size config string not provided\n" ); +return -EINVAL ; + } + size =memparse (arg, &end);if (*end =='\0' )
arch/xtensa/kernel/head.S +5 -2
@@ -88,9 +88,12 @@ _SetupMMU: initialize_mmu #if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY rsr a2, excsave1 - movi a3, 0x08000000 + movi a3, XCHAL_KSEG_PADDR + bltu a2, a3, 1f + sub a2, a2, a3 + movi a3, XCHAL_KSEG_SIZE bgeu a2, a3, 1f - movi a3, 0xd0000000 + movi a3, XCHAL_KSEG_CACHED_VADDR add a2, a2, a3 wsr a2, excsave1 1:
crypto/lrw.c +6 -1
@@ -132,7 +132,12 @@ static inline int get_index128(be128 *block)return x +ffz (val); } -return x; +/* +* If we get here, then x == 128 and we are incrementing the counter +* from all ones to all zeros. This means we must return index 127, i.e. +* the one corresponding to key2*{ 1,...,1 }. +*/ +return 127 ; } static int crypt(struct blkcipher_desc *d,
drivers/block/ataflop.c +15 -10
@@ -1933,6 +1933,11 @@ static int __init atari_floppy_init (void) unit[i].disk =alloc_disk (1 );if (!unit[i].disk) goto Enomem; + + unit[i].disk->queue =blk_init_queue (do_fd_request, + &ataflop_lock); +if (!unit[i].disk->queue) + goto Enomem; }if (UseTrackbuffer <0 )
@@ -1964,10 +1969,6 @@ static int __init atari_floppy_init (void)sprintf (unit[i].disk->disk_name,"fd%d" , i); unit[i].disk->fops = &floppy_fops; unit[i].disk->private_data = &unit[i]; - unit[i].disk->queue =blk_init_queue (do_fd_request, - &ataflop_lock); -if (!unit[i].disk->queue) - goto Enomem;set_capacity (unit[i].disk,MAX_DISK_SIZE *2 );add_disk (unit[i].disk); }
@@ -1982,13 +1983,17 @@ static int __init atari_floppy_init (void)return 0 ; Enomem: -while (i--) { -struct request_queue *q = unit[i].disk->queue; +do { +struct gendisk *disk = unit[i].disk; -put_disk (unit[i].disk); -if (q) -blk_cleanup_queue (q); - } +if (disk) { +if (disk->queue) { +blk_cleanup_queue (disk->queue); + disk->queue =NULL ; + } +put_disk (unit[i].disk); + } + }while (i--);unregister_blkdev (FLOPPY_MAJOR ,"fd" );return -ENOMEM ;
drivers/block/swim.c +11 -2
@@ -868,8 +868,17 @@ static int swim_floppy_init(struct swim_priv *swd) exit_put_disks:unregister_blkdev (FLOPPY_MAJOR ,"fd" ); -while (drive--) -put_disk (swd->unit[drive].disk); +do { +struct gendisk *disk = swd->unit[drive].disk; + +if (disk) { +if (disk->queue) { +blk_cleanup_queue (disk->queue); + disk->queue =NULL ; + } +put_disk (disk); + } + }while (drive--);return err; }
drivers/cdrom/cdrom.c +1 -1
@@ -2424,7 +2424,7 @@ static int cdrom_ioctl_select_disc(struct cdrom_device_info *cdi,return -ENOSYS ;if (arg !=CDSL_CURRENT && arg !=CDSL_NONE ) { -if ((int )arg >= cdi->capacity) +if (arg >= cdi->capacity)return -EINVAL ; }
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +11 -0
@@ -256,6 +256,17 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait) } txn->last_pat->next_pa =0 ; +/* ensure that the written descriptors are visible to DMM */ +wmb (); + +/* +* NOTE: the wmb() above should be enough, but there seems to be a bug +* in OMAP's memory barrier implementation, which in some rare cases may +* cause the writes not to be observable after wmb(). +*/ + +/* read back to ensure the data is in RAM */ +readl (&txn->last_pat->next_pa);/* write to PAT_DESCR to clear out any pending transaction */ writel (0x0 , dmm->base + reg[PAT_DESCR ][engine->id]);
drivers/iio/adc/at91_adc.c +5 -1
@@ -245,12 +245,14 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)struct iio_poll_func *pf = p;struct iio_dev *idev = pf->indio_dev;struct at91_adc_state *st =iio_priv (idev); +struct iio_chan_spec const *chan;int i, j =0 ;for (i =0 ; i < idev->masklength; i++) {if (!test_bit (i, idev->active_scan_mask))continue ; - st->buffer[j] =at91_adc_readl (st,AT91_ADC_CHAN (st, i)); + chan = idev->channels + i; + st->buffer[j] =at91_adc_readl (st,AT91_ADC_CHAN (st, chan->channel)); j++; }
@@ -276,6 +278,8 @@ static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)iio_trigger_poll (idev->trig); }else { st->last_value =at91_adc_readl (st,AT91_ADC_CHAN (st, st->chnb)); +/* Needed to ACK the DRDY interruption */ +at91_adc_readl (st,AT91_ADC_LCDR ); st->done = true;wake_up_interruptible (&st->wq_data_avail); }
drivers/md/bcache/btree.c +1 -1
@@ -2372,7 +2372,7 @@ static int refill_keybuf_fn(struct btree_op *op, struct btree *b,struct keybuf *buf = refill->buf;int ret =MAP_CONTINUE ; -if (bkey_cmp (k, refill->end) >=0 ) { +if (bkey_cmp (k, refill->end) >0 ) { ret =MAP_DONE ; goto out; }
drivers/md/dm-ioctl.c +6 -12
@@ -1681,8 +1681,7 @@ static void free_params(struct dm_ioctl *param, size_t param_size, int param_fla }static int copy_params (struct dm_ioctl __user *user,struct dm_ioctl *param_kernel, -int ioctl_flags, -struct dm_ioctl **param,int *param_flags) +int ioctl_flags,struct dm_ioctl **param,int *param_flags) {struct dm_ioctl *dmi;int secure_data;
@@ -1730,18 +1729,13 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kernreturn -ENOMEM ; } -if (copy_from_user (dmi, user, param_kernel->data_size)) - goto bad; +/* Copy from param_kernel (which was already copied from user) */ +memcpy (dmi, param_kernel, minimum_data_size); -data_copied: -/* -* Abort if something changed the ioctl data while it was being copied. -*/ -if (dmi->data_size != param_kernel->data_size) { -DMERR ("rejecting ioctl: data size modified while processing parameters" ); +if (copy_from_user (&dmi->data, (char __user *)user + minimum_data_size, + param_kernel->data_size - minimum_data_size)) goto bad; - } - +data_copied:/* Wipe the user buffer so we do not return it to userspace */ if (secure_data &&clear_user (user, param_kernel->data_size)) goto bad;
drivers/md/dm.c +0 -1
@@ -2589,7 +2589,6 @@ static void __dm_destroy(struct mapped_device *md, bool wait)might_sleep ();spin_lock (&_minor_lock); - map =dm_get_live_table (md, &srcu_idx);idr_replace (&_minor_idr,MINOR_ALLOCED ,MINOR (disk_devt (dm_disk (md))));set_bit (DMF_FREEING , &md->flags);spin_unlock (&_minor_lock);
drivers/media/i2c/tvp5150.c +9 -5
@@ -864,9 +864,6 @@ static int tvp5150_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)/* tvp5150 has some special limits */ rect.left =clamp (rect.left,0 ,TVP5150_MAX_CROP_LEFT ); - rect.width = clamp_t(unsigned int, rect.width, -TVP5150_H_MAX -TVP5150_MAX_CROP_LEFT - rect.left, -TVP5150_H_MAX - rect.left); rect.top =clamp (rect.top,0 ,TVP5150_MAX_CROP_TOP );/* Calculate height based on current standard */
@@ -880,9 +877,16 @@ static int tvp5150_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)else hmax =TVP5150_V_MAX_OTHERS ; - rect.height = clamp_t(unsigned int, rect.height, +/* +* alignments: +* - width = 2 due to UYVY colorspace +* - height, image = no special alignment +*/ +v4l_bound_align_image (&rect.width, +TVP5150_H_MAX -TVP5150_MAX_CROP_LEFT - rect.left, +TVP5150_H_MAX - rect.left,1 , &rect.height, hmax -TVP5150_MAX_CROP_TOP - rect.top, - hmax - rect.top); + hmax - rect.top,0 ,0 );tvp5150_write (sd,TVP5150_VERT_BLANKING_START , rect.top); tvp5150_write(sd, TVP5150_VERT_BLANKING_STOP,
drivers/media/pci/cx23885/altera-ci.c +10 -0
@@ -662,6 +662,10 @@ static int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr) } temp_int =append_internal (inter); +if (!temp_int) { + ret = -ENOMEM ; + goto err; + } inter->filts_used =1 ; inter->dev = config->dev; inter->fpga_rw = config->fpga_rw;
@@ -696,6 +700,7 @@ err: __func__, ret);kfree (pid_filt); +kfree (inter);return ret; }
@@ -731,6 +736,10 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr) } temp_int =append_internal (inter); +if (!temp_int) { + ret = -ENOMEM ; + goto err; + } inter->cis_used =1 ; inter->dev = config->dev; inter->fpga_rw = config->fpga_rw;
@@ -799,6 +808,7 @@ err:ci_dbg_print ("%s: Cannot initialize CI: Error %d.\n" , __func__, ret);kfree (state); +kfree (inter);return ret; }
drivers/media/usb/em28xx/em28xx-cards.c +2 -2
@@ -2001,13 +2001,13 @@ struct em28xx_board em28xx_boards[] = { .input = { { .type = EM28XX_VMUX_COMPOSITE1, .vmux = TVP5150_COMPOSITE1, - .amux = EM28XX_AUDIO_SRC_LINE, + .amux = EM28XX_AMUX_LINE_IN, .gpio = terratec_av350_unmute_gpio, }, { .type = EM28XX_VMUX_SVIDEO, .vmux = TVP5150_SVIDEO, - .amux = EM28XX_AUDIO_SRC_LINE, + .amux = EM28XX_AMUX_LINE_IN, .gpio = terratec_av350_unmute_gpio, } }, },
drivers/media/usb/em28xx/em28xx-video.c +5 -3
@@ -1141,6 +1141,8 @@ static void em28xx_ctrl_notify(struct v4l2_ctrl *ctrl, void *priv) {struct em28xx *dev = priv; + dev->v4l2->field_count =0 ; +/* * In the case of non-AC97 volume controls, we still need * to do some setups at em28xx, in order to mute/unmute
@@ -1280,9 +1282,9 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, fmt =format_by_fourcc (f->fmt.pix.pixelformat);if (!fmt) { -em28xx_videodbg ("Fourcc format (%08x) invalid.\n" , - f->fmt.pix.pixelformat); -return -EINVAL ; + fmt = &format[0 ]; +em28xx_videodbg ("Fourcc format (%08x) invalid. Using default (%08x).\n" , + f->fmt.pix.pixelformat, fmt->fourcc); }if (dev->board.is_em2800) {
drivers/misc/genwqe/card_base.h +1 -1
@@ -405,7 +405,7 @@ struct genwqe_file {struct file *filp;struct fasync_struct *async_queue; -struct task_struct *owner; +struct pid *opener;struct list_head list;/* entry in list of open files */ spinlock_t map_lock;/* lock for dma_mappings */
drivers/misc/genwqe/card_dev.c +5 -4
@@ -52,7 +52,7 @@ static void genwqe_add_file(struct genwqe_dev *cd, struct genwqe_file *cfile) {unsigned long flags; - cfile->owner = current; + cfile->opener =get_pid (task_tgid (current));spin_lock_irqsave (&cd->file_lock, flags);list_add (&cfile->list, &cd->file_list);spin_unlock_irqrestore (&cd->file_lock, flags);
@@ -65,6 +65,7 @@ static int genwqe_del_file(struct genwqe_dev *cd, struct genwqe_file *cfile)spin_lock_irqsave (&cd->file_lock, flags);list_del (&cfile->list);spin_unlock_irqrestore (&cd->file_lock, flags); +put_pid (cfile->opener);return 0 ; }
@@ -275,7 +276,7 @@ static int genwqe_kill_fasync(struct genwqe_dev *cd, int sig)return files; } -static int genwqe_force_sig (struct genwqe_dev *cd,int sig) +static int genwqe_terminate (struct genwqe_dev *cd) {unsigned int files =0 ;unsigned long flags;
@@ -283,7 +284,7 @@ static int genwqe_force_sig(struct genwqe_dev *cd, int sig)spin_lock_irqsave (&cd->file_lock, flags);list_for_each_entry (cfile, &cd->file_list, list) { -force_sig (sig, cfile->owner); +kill_pid (cfile->opener,SIGKILL ,1 ); files++; }spin_unlock_irqrestore (&cd->file_lock, flags);
@@ -1356,7 +1357,7 @@ static int genwqe_inform_and_stop_processes(struct genwqe_dev *cd)dev_warn (&pci_dev->dev,"[%s] send SIGKILL and wait ...\n" , __func__); - rc =genwqe_force_sig (cd,SIGKILL );/* force terminate */ + rc =genwqe_terminate (cd);if (rc) {/* Give kill_timout more seconds to end processes */ for (i = 0; (i < genwqe_kill_timeout) &&
drivers/mmc/host/sdhci-pci-o2micro.c +3 -0
@@ -336,6 +336,9 @@ int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip)pci_write_config_byte (chip->pdev,O2_SD_LOCK_WP , scratch);break ;case PCI_DEVICE_ID_O2_SEABIRD0 : +if (chip->pdev->revision ==0x01 ) + chip->quirks |=SDHCI_QUIRK_DELAY_AFTER_POWER ; +/* fall through */ case PCI_DEVICE_ID_O2_SEABIRD1 :/* UnLock WP */ ret = pci_read_config_byte(chip->pdev,
drivers/mtd/devices/Kconfig +1 -1
@@ -200,7 +200,7 @@ comment "Disk-On-Chip Device Drivers" config MTD_DOCG3 tristate "M-Systems Disk-On-Chip G3" select BCH - select BCH_CONST_PARAMS + select BCH_CONST_PARAMS if !MTD_NAND_BCH select BITREVERSE ---help--- This provides an MTD device driver for the M-Systems DiskOnChip
drivers/net/ethernet/qlogic/qla3xxx.c +0 -2
@@ -382,8 +382,6 @@ static void fm93c56a_select(struct ql3_adapter *qdev) qdev->eeprom_cmd_data =AUBURN_EEPROM_CS_1 ;ql_write_nvram_reg (qdev, spir,ISP_NVRAM_MASK | qdev->eeprom_cmd_data); -ql_write_nvram_reg (qdev, spir, - ((ISP_NVRAM_MASK <<16 ) | qdev->eeprom_cmd_data)); }/*
drivers/net/tun.c +2 -0
@@ -1423,6 +1423,8 @@ static void tun_setup(struct net_device *dev)*/ static int tun_validate (struct nlattr *tb[],struct nlattr *data[]) { +if (!data) +return 0 ;return -EINVAL ; }
drivers/net/wireless/ath/ath10k/wmi.c +6 -0
@@ -751,6 +751,12 @@ int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id)if (ret)dev_kfree_skb_any (skb); +if (ret == -EAGAIN ) { +ath10k_warn (ar,"wmi command %d timeout, restarting hardware\n" , + cmd_id); +queue_work (ar->workqueue, &ar->restart_work); + } +return ret; }
drivers/pcmcia/ricoh.h +35 -0
@@ -119,6 +119,10 @@#define RL5C4XX_MISC_CONTROL 0x2F/* 8 bit */ #define RL5C4XX_ZV_ENABLE 0x08 +/* Misc Control 3 Register */ +#define RL5C4XX_MISC3 0x00A2/* 16 bit */ +#define RL5C47X_MISC3_CB_CLKRUN_DIS BIT(1) +#ifdef __YENTA_H#define rl_misc (socket) ((socket)->private[0])
@@ -156,6 +160,35 @@ static void ricoh_set_zv(struct yenta_socket *socket) } } +static void ricoh_set_clkrun (struct yenta_socket *socket,bool quiet) +{ +u16 misc3; + +/* +* RL5C475II likely has this setting, too, however no datasheet +* is publicly available for this chip +*/ +if (socket->dev->device !=PCI_DEVICE_ID_RICOH_RL5C476 && + socket->dev->device !=PCI_DEVICE_ID_RICOH_RL5C478 ) +return ; + +if (socket->dev->revision <0x80 ) +return ; + + misc3 =config_readw (socket,RL5C4XX_MISC3 ); +if (misc3 &RL5C47X_MISC3_CB_CLKRUN_DIS ) { +if (!quiet) +dev_dbg (&socket->dev->dev, +"CLKRUN feature already disabled\n" ); + }else if (disable_clkrun) { +if (!quiet) +dev_info (&socket->dev->dev, +"Disabling CLKRUN feature\n" ); + misc3 |=RL5C47X_MISC3_CB_CLKRUN_DIS ; +config_writew (socket,RL5C4XX_MISC3 , misc3); + } +} +static void ricoh_save_state (struct yenta_socket *socket) {rl_misc (socket) =config_readw (socket,RL5C4XX_MISC );
@@ -172,6 +205,7 @@ static void ricoh_restore_state(struct yenta_socket *socket)config_writew (socket,RL5C4XX_16BIT_IO_0 ,rl_io (socket));config_writew (socket,RL5C4XX_16BIT_MEM_0 ,rl_mem (socket));config_writew (socket,RL5C4XX_CONFIG ,rl_config (socket)); +ricoh_set_clkrun (socket, true); }
@@ -197,6 +231,7 @@ static int ricoh_override(struct yenta_socket *socket)config_writew (socket,RL5C4XX_CONFIG , config);ricoh_set_zv (socket); +ricoh_set_clkrun (socket, false);return 0 ; }
drivers/pcmcia/yenta_socket.c +2 -1
@@ -26,7 +26,8 @@static bool disable_clkrun;module_param (disable_clkrun, bool,0444 ); -MODULE_PARM_DESC (disable_clkrun,"If PC card doesn't function properly, please try this option" ); +MODULE_PARM_DESC (disable_clkrun, +"If PC card doesn't function properly, please try this option (TI and Ricoh bridges only)" );static bool isa_probe =1 ;module_param (isa_probe, bool,0444 );
drivers/scsi/esp_scsi.c +1 -0
@@ -1316,6 +1316,7 @@ static int esp_data_bytes_sent(struct esp *esp, struct esp_cmd_entry *ent, bytes_sent = esp->data_dma_len; bytes_sent -= ecount; + bytes_sent -= esp->send_cmd_residual;if (!(ent->flags &ESP_CMD_FLAG_WRITE )) bytes_sent -= fifo_cnt;
drivers/scsi/esp_scsi.h +2 -0
@@ -524,6 +524,8 @@ struct esp {void *dma;int dmarev; + +u32 send_cmd_residual; };/* A front-end driver for the ESP chip should do the following in
drivers/scsi/lpfc/lpfc_sli.c +7 -0
@@ -3441,6 +3441,7 @@ lpfc_sli_handle_slow_ring_event_s4(struct lpfc_hba *phba,struct hbq_dmabuf *dmabuf;struct lpfc_cq_event *cq_event;unsigned long iflag; +int count =0 ;spin_lock_irqsave (&phba->hbalock, iflag); phba->hba_flag &= ~HBA_SP_QUEUE_EVT ;
@@ -3462,16 +3463,22 @@ lpfc_sli_handle_slow_ring_event_s4(struct lpfc_hba *phba,if (irspiocbq)lpfc_sli_sp_handle_rspiocb (phba, pring, irspiocbq); + count++;break ;case CQE_CODE_RECEIVE :case CQE_CODE_RECEIVE_V1 : dmabuf = container_of(cq_event, struct hbq_dmabuf, cq_event);lpfc_sli4_handle_received_buffer (phba, dmabuf); + count++;break ;default :break ; } + +/* Limit the number of events to 64 to avoid soft lockups */ +if (count ==64 ) +break ; } }
drivers/scsi/mac_esp.c +2 -0
@@ -426,6 +426,8 @@ static void mac_esp_send_pio_cmd(struct esp *esp, u32 addr, u32 esp_count,scsi_esp_cmd (esp,ESP_CMD_TI ); } } + + esp->send_cmd_residual = esp_count; }static int mac_esp_irq_pending (struct esp *esp)
drivers/tc/tc.c +7 -1
@@ -2,7 +2,7 @@* TURBOchannel bus services. * * Copyright (c) Harald Koerfgen, 1998 -* Copyright (c) 2001, 2003, 2005, 2006 Maciej W. Rozycki +* Copyright (c) 2001, 2003, 2005, 2006, 2018 Maciej W. Rozycki * Copyright (c) 2005 James Simmons * * This file is subject to the terms and conditions of the GNU
@@ -10,6 +10,7 @@* directory of this archive for more details. */ #include <linux/compiler.h> +#include <linux/dma-mapping.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/ioport.h>
@@ -93,6 +94,11 @@ static void __init tc_bus_add_devices(struct tc_bus *tbus) tdev->dev.bus = &tc_bus_type; tdev->slot = slot; +/* TURBOchannel has 34-bit DMA addressing (16GiB space). */ + tdev->dma_mask =DMA_BIT_MASK (34 ); + tdev->dev.dma_mask = &tdev->dma_mask; + tdev->dev.coherent_dma_mask =DMA_BIT_MASK (34 ); +for (i =0 ; i <8 ; i++) { tdev->firmware[i] =readb (module + offset +TC_FIRM_VER +4 * i);
drivers/tty/serial/kgdboc.c +5 -0
@@ -133,6 +133,11 @@ static void kgdboc_unregister_kbd(void)static int kgdboc_option_setup (char *opt) { +if (!opt) { +pr_err ("kgdboc: config string not provided\n" ); +return -EINVAL ; + } +if (strlen (opt) >=MAX_CONFIG_LEN ) {printk (KERN_ERR "kgdboc: config string too long\n" );return -ENOSPC ;
drivers/tty/tty_io.c +1 -1
@@ -357,7 +357,7 @@ struct tty_driver *tty_find_polling_driver(char *name, int *line)mutex_lock (&tty_mutex);/* Search through the tty devices to look for a match */ list_for_each_entry (p, &tty_drivers, tty_drivers) { -if (strncmp (name, p->name, len) !=0 ) +if (!len ||strncmp (name, p->name, len) !=0 )continue ; stp = str;if (*stp ==',' )
drivers/tty/tty_ioctl.c +2 -2
@@ -327,7 +327,7 @@ speed_t tty_termios_baud_rate(struct ktermios *termios)else cbaud +=15 ; } -return baud_table[cbaud]; +return cbaud >= n_baud_table ?0 : baud_table[cbaud]; }EXPORT_SYMBOL (tty_termios_baud_rate);
@@ -363,7 +363,7 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios) else cbaud += 15; } -return baud_table[cbaud]; +return cbaud >= n_baud_table ?0 : baud_table[cbaud];#else return tty_termios_baud_rate (termios);#endif
drivers/uio/uio.c +9 -0
@@ -249,6 +249,8 @@ static struct class uio_class = { .dev_groups = uio_groups, }; +bool uio_class_registered; +/* * device functions */
@@ -771,6 +773,9 @@ static int init_uio_class(void)printk (KERN_ERR "class_register failed for uio\n" ); goto err_class_register; } + + uio_class_registered = true; +return 0 ; err_class_register:
@@ -781,6 +786,7 @@ exit:static void release_uio_class (void ) { + uio_class_registered = false;class_unregister (&uio_class);uio_major_cleanup (); }
@@ -800,6 +806,9 @@ int __uio_register_device(struct module *owner,struct uio_device *idev;int ret =0 ; +if (!uio_class_registered) +return -EPROBE_DEFER ; +if (!parent || !info || !info->name || !info->version)return -EINVAL ;
drivers/usb/chipidea/otg.h +2 -1
@@ -20,7 +20,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci);static inline void ci_otg_queue_work (struct ci_hdrc *ci) {disable_irq_nosync (ci->irq); -queue_work (ci->wq, &ci->work); +if (queue_work (ci->wq, &ci->work) == false) +enable_irq (ci->irq); }#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
drivers/video/fbdev/aty/mach64_accel.c +12 -16
@@ -126,7 +126,7 @@ void aty_init_engine(struct atyfb_par *par, struct fb_info *info)/* set host attributes */ wait_for_fifo (13 , par); -aty_st_le32 (HOST_CNTL ,0 , par); +aty_st_le32 (HOST_CNTL ,HOST_BYTE_ALIGN , par);/* set pattern attributes */ aty_st_le32 (PAT_REG0 ,0 , par);
@@ -232,7 +232,8 @@ void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) rotation =rotation24bpp (dx, direction); } -wait_for_fifo (4 , par); +wait_for_fifo (5 , par); +aty_st_le32 (DP_PIX_WIDTH , par->crtc.dp_pix_width, par);aty_st_le32 (DP_SRC ,FRGD_SRC_BLIT , par);aty_st_le32 (SRC_Y_X , (sx <<16 ) | sy, par);aty_st_le32 (SRC_HEIGHT1_WIDTH1 , (width <<16 ) | area->height, par);
@@ -268,7 +269,8 @@ void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) rotation =rotation24bpp (dx,DST_X_LEFT_TO_RIGHT ); } -wait_for_fifo (3 , par); +wait_for_fifo (4 , par); +aty_st_le32 (DP_PIX_WIDTH , par->crtc.dp_pix_width, par);aty_st_le32 (DP_FRGD_CLR , color, par); aty_st_le32(DP_SRC, BKGD_SRC_BKGD_CLR | FRGD_SRC_FRGD_CLR | MONO_SRC_ONE,
@@ -283,7 +285,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) {struct atyfb_par *par = (struct atyfb_par *) info->par;u32 src_bytes, dx = image->dx, dy = image->dy, width = image->width; -u32 pix_width_save, pix_width, host_cntl, rotation =0 , src, mix; +u32 pix_width, rotation =0 , src, mix;if (par->asleep)return ;
@@ -295,8 +297,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image)return ; } - pix_width = pix_width_save =aty_ld_le32 (DP_PIX_WIDTH , par); - host_cntl =aty_ld_le32 (HOST_CNTL , par) |HOST_BYTE_ALIGN ; + pix_width = par->crtc.dp_pix_width;switch (image->depth) {case 1 :
@@ -344,7 +345,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image)* since Rage 3D IIc we have DP_HOST_TRIPLE_EN bit * this hwaccelerated triple has an issue with not aligned data */ -if (M64_HAS (HW_TRIPLE ) && image->width %8 ==0 ) +if (image->depth ==1 &&M64_HAS (HW_TRIPLE ) && image->width %8 ==0 ) pix_width |=DP_HOST_TRIPLE_EN ; }
@@ -369,19 +370,18 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) mix =FRGD_MIX_D_XOR_S |BKGD_MIX_D ; } -wait_for_fifo (6 , par); -aty_st_le32 (DP_WRITE_MASK ,0xFFFFFFFF , par); +wait_for_fifo (5 , par);aty_st_le32 (DP_PIX_WIDTH , pix_width, par);aty_st_le32 (DP_MIX , mix, par);aty_st_le32 (DP_SRC , src, par); -aty_st_le32 (HOST_CNTL , host_cntl, par); +aty_st_le32 (HOST_CNTL ,HOST_BYTE_ALIGN , par);aty_st_le32 (DST_CNTL ,DST_Y_TOP_TO_BOTTOM |DST_X_LEFT_TO_RIGHT | rotation, par);draw_rect (dx, dy, width, image->height, par); src_bytes = (((image->width * image->depth) +7 ) /8 ) * image->height;/* manual triple each pixel */ -if (info->var.bits_per_pixel ==24 && !(pix_width &DP_HOST_TRIPLE_EN )) { +if (image->depth ==1 && info->var.bits_per_pixel ==24 && !(pix_width &DP_HOST_TRIPLE_EN )) {int inbit, outbit, mult24, byte_id_in_dword, width;u8 *pbitmapin = (u8 *)image->data, *pbitmapout;u32 hostdword;
@@ -414,7 +414,7 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image) } }wait_for_fifo (1 , par); -aty_st_le32 (HOST_DATA0 , hostdword, par); +aty_st_le32 (HOST_DATA0 ,le32_to_cpu (hostdword), par); } }else {u32 *pbitmap, dwords = (src_bytes +3 ) /4 ;
@@ -423,8 +423,4 @@ void atyfb_imageblit(struct fb_info *info, const struct fb_image *image)aty_st_le32 (HOST_DATA0 ,get_unaligned_le32 (pbitmap), par); } } - -/* restore pix_width */ -wait_for_fifo (1 , par); -aty_st_le32 (DP_PIX_WIDTH , pix_width_save, par); }
drivers/w1/masters/omap_hdq.c +2 -0
@@ -622,6 +622,8 @@ static int omap_hdq_remove(struct platform_device *pdev)/* remove module dependency */ pm_runtime_disable (&pdev->dev); +w1_remove_master_device (&omap_w1_master); +return 0 ; }
fs/cifs/cifs_debug.c +3 -0
@@ -271,6 +271,9 @@ static ssize_t cifs_stats_proc_write(struct file *file,atomic_set (&totBufAllocCount,0 );atomic_set (&totSmBufAllocCount,0 );#endif /* CONFIG_CIFS_STATS2 */ +atomic_set (&tcpSesReconnectCount,0 ); +atomic_set (&tconInfoReconnectCount,0 ); +spin_lock (&GlobalMid_Lock); GlobalMaxActiveXid =0 ; GlobalCurrentXid =0 ;
fs/cifs/cifs_spnego.c +4 -2
@@ -147,8 +147,10 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)sprintf (dp,";sec=krb5" ); else if (server->sec_mskerberos) sprintf(dp, ";sec=mskrb5"); - else - goto out; + else { +cifs_dbg (VFS ,"unknown or missing server auth type, use krb5\n" ); +sprintf (dp,";sec=krb5" ); + } dp = description +strlen (description); sprintf(dp, ";uid=0x%x",
fs/cifs/inode.c +9 -1
@@ -741,7 +741,15 @@ cifs_get_inode_info(struct inode **inode, const char *full_path, }else if (rc == -EREMOTE ) {cifs_create_dfs_fattr (&fattr, sb); rc =0 ; - }else if (rc == -EACCES &&backup_cred (cifs_sb)) { + }else if ((rc == -EACCES ) &&backup_cred (cifs_sb) && + (strcmp (server->vals->version_string,SMB1_VERSION_STRING ) + ==0 )) { +/* +* For SMB2 and later the backup intent flag is already +* sent if needed on open and there is no path based +* FindFirst operation to use to retry with +*/ + srchinf =kzalloc (sizeof (struct cifs_search_info ),GFP_KERNEL );if (srchinf ==NULL ) {
fs/configfs/symlink.c +1 -1
@@ -64,7 +64,7 @@ static void fill_item_path(struct config_item * item, char * buffer, int length)/* back up enough to print this bus id with '/' */ length -= cur; -strncpy (buffer + length,config_item_name (p),cur); +memcpy (buffer + length,config_item_name (p), cur); *(buffer + --length) ='/' ; } }
fs/cramfs/inode.c +2 -1
@@ -185,7 +185,8 @@ static void *cramfs_read(struct super_block *sb, unsigned int offset, unsigned icontinue ; blk_offset = (blocknr - buffer_blocknr[i]) <<PAGE_CACHE_SHIFT ; blk_offset += offset; -if (blk_offset + len >BUFFER_SIZE ) +if (blk_offset >BUFFER_SIZE || + blk_offset + len >BUFFER_SIZE )continue ;return read_buffers[i] + blk_offset; }
fs/ext4/inline.c +1 -1
@@ -850,7 +850,7 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping,handle_t *handle;struct page *page;struct ext4_iloc iloc; -int retries; +int retries =0 ; ret =ext4_get_inode_loc (inode, &iloc);if (ret)
fs/ext4/move_extent.c +6 -2
@@ -533,9 +533,13 @@ mext_check_arguments(struct inode *orig_inode, orig_inode->i_ino, donor_inode->i_ino);return -EINVAL ; } -if (orig_eof < orig_start + *len -1 ) +if (orig_eof <= orig_start) + *len =0 ; +else if (orig_eof < orig_start + *len -1 ) *len = orig_eof - orig_start; -if (donor_eof < donor_start + *len -1 ) +if (donor_eof <= donor_start) + *len =0 ; +else if (donor_eof < donor_start + *len -1 ) *len = donor_eof - donor_start;if (!*len) { ext4_debug("ext4 move extent: len should not be 0 "
fs/ext4/namei.c +4 -1
@@ -122,6 +122,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,if (!is_dx_block && type ==INDEX ) {ext4_error_inode (inode, __func__, line, block,"directory leaf block found instead of index block" ); +brelse (bh);return ERR_PTR (-EIO ); } if (!ext4_has_metadata_csum(inode->i_sb) ||
@@ -2604,7 +2605,9 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode)list_del_init (&EXT4_I (inode)->i_orphan);mutex_unlock (&sbi->s_orphan_lock); } - } + }else +brelse (iloc.bh); +jbd_debug (4 ,"superblock will point to %lu\n" , inode->i_ino);jbd_debug (4 ,"orphan inode %lu will point to %d\n" , inode->i_ino,NEXT_ORPHAN (inode));
fs/ext4/resize.c +16 -12
@@ -429,16 +429,18 @@ static int set_flexbg_block_bitmap(struct super_block *sb, handle_t *handle,BUFFER_TRACE (bh,"get_write_access" ); err =ext4_journal_get_write_access (handle, bh); -if (err) +if (err) { +brelse (bh);return err; + }ext4_debug ("mark block bitmap %#04llx (+%llu/%u)\n" , block, block - start, count2);ext4_set_bits (bh->b_data, block - start, count2); err =ext4_handle_dirty_metadata (handle,NULL , bh); +brelse (bh);if (unlikely (err))return err; -brelse (bh); }return 0 ;
@@ -575,7 +577,6 @@ handle_bb: bh =bclean (handle, sb, block);if (IS_ERR (bh)) { err =PTR_ERR (bh); - bh =NULL ; goto out; } overhead =ext4_group_overhead_blocks (sb, group);
@@ -587,9 +588,9 @@ handle_bb:ext4_mark_bitmap_end (group_data[i].blocks_count, sb->s_blocksize *8 , bh->b_data); err =ext4_handle_dirty_metadata (handle,NULL , bh); +brelse (bh);if (err) goto out; -brelse (bh); handle_ib:if (bg_flags[i] &EXT4_BG_INODE_UNINIT )
@@ -604,18 +605,16 @@ handle_ib: bh =bclean (handle, sb, block);if (IS_ERR (bh)) { err =PTR_ERR (bh); - bh =NULL ; goto out; }ext4_mark_bitmap_end (EXT4_INODES_PER_GROUP (sb), sb->s_blocksize *8 , bh->b_data); err =ext4_handle_dirty_metadata (handle,NULL , bh); +brelse (bh);if (err) goto out; -brelse (bh); } - bh =NULL ;/* Mark group tables in block bitmap */ for (j =0 ; j <GROUP_TABLE_COUNT ; j++) {
@@ -646,7 +645,6 @@ handle_ib: } out: -brelse (bh); err2 =ext4_journal_stop (handle);if (err2 && !err) err = err2;
@@ -846,6 +844,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode, err =ext4_handle_dirty_metadata (handle,NULL , gdb_bh);if (unlikely (err)) {ext4_std_error (sb, err); + iloc.bh =NULL ; goto exit_inode; }brelse (dind);
@@ -897,6 +896,7 @@ static int add_new_gdb_meta_bg(struct super_block *sb,sizeof (struct buffer_head *), GFP_NOFS);if (!n_group_desc) { +brelse (gdb_bh); err = -ENOMEM ;ext4_warning (sb,"not enough memory for %lu groups" , gdb_num +1 );
@@ -912,8 +912,6 @@ static int add_new_gdb_meta_bg(struct super_block *sb,ext4_kvfree (o_group_desc);BUFFER_TRACE (gdb_bh,"get_write_access" ); err =ext4_journal_get_write_access (handle, gdb_bh); -if (unlikely (err)) -brelse (gdb_bh);return err; }
@@ -1095,8 +1093,10 @@ static void update_backups(struct super_block *sb, int blk_off, char *data, backup_block, backup_block - ext4_group_first_block_no(sb, group));BUFFER_TRACE (bh,"get_write_access" ); -if ((err =ext4_journal_get_write_access (handle, bh))) +if ((err =ext4_journal_get_write_access (handle, bh))) { +brelse (bh);break ; + }lock_buffer (bh);memcpy (bh->b_data, data, size);if (rest)
@@ -1993,7 +1993,7 @@ retry: err =ext4_alloc_flex_bg_array (sb, n_group +1 );if (err) -return err; + goto out; err =ext4_mb_alloc_groupinfo (sb, n_group +1 );if (err)
@@ -2029,6 +2029,10 @@ retry: n_blocks_count_retry =0 ;free_flex_gd (flex_gd); flex_gd =NULL ; +if (resize_inode) { +iput (resize_inode); + resize_inode =NULL ; + } goto retry; }
fs/ext4/super.c +8 -8
@@ -3976,6 +3976,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_groups_count = blocks_count; sbi->s_blockfile_groups =min_t (ext4_group_t, sbi->s_groups_count, (EXT4_MAX_BLOCK_FILE_PHYS /EXT4_BLOCKS_PER_GROUP (sb))); +if (((u64 )sbi->s_groups_count * sbi->s_inodes_per_group) != +le32_to_cpu (es->s_inodes_count)) { +ext4_msg (sb,KERN_ERR ,"inodes count not valid: %u vs %llu" , +le32_to_cpu (es->s_inodes_count), + ((u64 )sbi->s_groups_count * sbi->s_inodes_per_group)); + ret = -EINVAL ; + goto failed_mount; + } db_count = (sbi->s_groups_count +EXT4_DESC_PER_BLOCK (sb) -1 ) /EXT4_DESC_PER_BLOCK (sb);if (EXT4_HAS_INCOMPAT_FEATURE (sb,EXT4_FEATURE_INCOMPAT_META_BG )) {
@@ -3995,14 +4003,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ret = -ENOMEM ; goto failed_mount; } -if (((u64 )sbi->s_groups_count * sbi->s_inodes_per_group) != -le32_to_cpu (es->s_inodes_count)) { -ext4_msg (sb,KERN_ERR ,"inodes count not valid: %u vs %llu" , -le32_to_cpu (es->s_inodes_count), - ((u64 )sbi->s_groups_count * sbi->s_inodes_per_group)); - ret = -EINVAL ; - goto failed_mount; - }if (ext4_proc_root) sbi->s_proc =proc_mkdir (sb->s_id, ext4_proc_root);
fs/ext4/xattr.c +4 -0
@@ -1162,6 +1162,8 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, error =ext4_xattr_block_set (handle, inode, &i, &bs); }else if (error == -ENOSPC ) {if (EXT4_I (inode)->i_file_acl && !bs.s.base) { +brelse (bs.bh); + bs.bh =NULL ; error =ext4_xattr_block_find (inode, &i, &bs);if (error) goto cleanup;
@@ -1487,6 +1489,8 @@ cleanup:kfree (buffer);if (is)brelse (is->iloc.bh); +if (bs) +brelse (bs->bh);kfree (is);kfree (bs);brelse (bh);
fs/fuse/dev.c +3 -1
@@ -1675,8 +1675,10 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode, req->in.args[1 ].size = total_len; err =fuse_request_send_notify_reply (fc, req, outarg->notify_unique); -if (err) +if (err) {fuse_retrieve_end (fc, req); +fuse_put_request (fc, req); + }return err; }
fs/gfs2/ops_fstype.c +3 -0
@@ -1358,6 +1358,9 @@ static struct dentry *gfs2_mount_meta(struct file_system_type *fs_type,struct path path;int error; +if (!dev_name || !*dev_name) +return ERR_PTR (-EINVAL ); + error =kern_path (dev_name,LOOKUP_FOLLOW , &path);if (error) { pr_warn("path_lookup on %s returned error %d\n",
fs/jbd2/checkpoint.c +2 -2
@@ -254,8 +254,8 @@ restart: bh =jh2bh (jh);if (buffer_locked (bh)) { -spin_unlock (&journal->j_list_lock);get_bh (bh); +spin_unlock (&journal->j_list_lock);wait_on_buffer (bh);/* the journal_head may have gone by now */ BUFFER_TRACE (bh,"brelse" );
@@ -336,8 +336,8 @@ restart2: jh = transaction->t_checkpoint_io_list; bh =jh2bh (jh);if (buffer_locked (bh)) { -spin_unlock (&journal->j_list_lock);get_bh (bh); +spin_unlock (&journal->j_list_lock);wait_on_buffer (bh);/* the journal_head may have gone by now */ BUFFER_TRACE (bh,"brelse" );
fs/jffs2/super.c +1 -3
@@ -285,10 +285,8 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent) sb->s_fs_info = c; ret =jffs2_parse_options (c, data); -if (ret) { -kfree (c); +if (ret)return -EINVAL ; - }/* Initialize JFFS2 superblock locks, the further initialization will * be done later */
fs/lockd/host.c +1 -1
@@ -339,7 +339,7 @@ struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, };struct lockd_net *ln =net_generic (net, lockd_net_id); -dprintk ("lockd: %s(host='%*s', vers=%u, proto=%s)\n" , __func__, +dprintk ("lockd: %s(host='%.*s', vers=%u, proto=%s)\n" , __func__, (int )hostname_len, hostname, rqstp->rq_vers, (rqstp->rq_prot ==IPPROTO_UDP ?"udp" :"tcp" ));
fs/namespace.c +17 -5
@@ -1478,8 +1478,13 @@ static int do_umount(struct mount *mnt, int flags)namespace_lock ();lock_mount_hash (); - event++; +/* Recheck MNT_LOCKED with the locks held */ + retval = -EINVAL ; +if (mnt->mnt.mnt_flags &MNT_LOCKED ) + goto out; + + event++;if (flags &MNT_DETACH ) {if (!list_empty (&mnt->mnt_list))umount_tree (mnt,UMOUNT_PROPAGATE );
@@ -1493,6 +1498,7 @@ static int do_umount(struct mount *mnt, int flags) retval =0 ; } } +out:unlock_mount_hash ();namespace_unlock ();return retval;
@@ -1571,7 +1577,7 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags) goto dput_and_out;if (!check_mnt (mnt)) goto dput_and_out; -if (mnt->mnt.mnt_flags &MNT_LOCKED ) +if (mnt->mnt.mnt_flags &MNT_LOCKED )/* Check optimistically */ goto dput_and_out; retval = -EPERM ;if (flags &MNT_FORCE && !capable (CAP_SYS_ADMIN ))
@@ -1655,8 +1661,14 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry,struct mount *t =NULL ;if (!(flag &CL_COPY_UNBINDABLE ) &&IS_MNT_UNBINDABLE (s)) { - s =skip_mnt_tree (s); -continue ; +if (s->mnt.mnt_flags &MNT_LOCKED ) { +/* Both unbindable and locked. */ + q =ERR_PTR (-EPERM ); + goto out; + }else { + s =skip_mnt_tree (s); +continue ; + } }if (!(flag &CL_COPY_MNT_NS_FILE ) &&is_mnt_ns_file (s->mnt.mnt_root)) {
@@ -1716,7 +1728,7 @@ void drop_collected_mounts(struct vfsmount *mnt) {namespace_lock ();lock_mount_hash (); -umount_tree (real_mount (mnt),UMOUNT_SYNC ); +umount_tree (real_mount (mnt),0 );unlock_mount_hash ();namespace_unlock (); }
fs/nfs/nfs4client.c +9 -7
@@ -891,10 +891,10 @@ EXPORT_SYMBOL_GPL(nfs4_set_ds_client);/* * Session has been established, and the client marked ready. -* Set the mount rsize and wsize with negotiated fore channel -* attributes which will be bound checked in nfs_server_set_fsinfo. +* Limit the mount rsize, wsize and dtsize using negotiated fore +* channel attributes. */ -static void nfs4_session_set_rwsize (struct nfs_server *server) +static void nfs4_session_limit_rwsize (struct nfs_server *server) {#ifdef CONFIG_NFS_V4_1 struct nfs4_session *sess;
@@ -907,9 +907,11 @@ static void nfs4_session_set_rwsize(struct nfs_server *server) server_resp_sz = sess->fc_attrs.max_resp_sz - nfs41_maxread_overhead; server_rqst_sz = sess->fc_attrs.max_rqst_sz - nfs41_maxwrite_overhead; -if (!server->rsize || server->rsize > server_resp_sz) +if (server->dtsize > server_resp_sz) + server->dtsize = server_resp_sz; +if (server->rsize > server_resp_sz) server->rsize = server_resp_sz; -if (!server->wsize || server->wsize > server_rqst_sz) +if (server->wsize > server_rqst_sz) server->wsize = server_rqst_sz;#endif /* CONFIG_NFS_V4_1 */ }
@@ -956,12 +958,12 @@ static int nfs4_server_common_setup(struct nfs_server *server, (unsigned long long) server->fsid.minor);nfs_display_fhandle (mntfh,"Pseudo-fs root FH" ); -nfs4_session_set_rwsize (server); - error =nfs_probe_fsinfo (server, mntfh, fattr);if (error <0 ) goto out; +nfs4_session_limit_rwsize (server); +if (server->namelen ==0 || server->namelen >NFS4_MAXNAMLEN ) server->namelen =NFS4_MAXNAMLEN ;
fs/ocfs2/dir.c +1 -2
@@ -1906,8 +1906,7 @@ static int ocfs2_dir_foreach_blk_el(struct inode *inode,/* On error, skip the f_pos to the next block. */ ctx->pos = (ctx->pos | (sb->s_blocksize -1 )) +1 ; -brelse (bh); -continue ; +break ; }if (le64_to_cpu (de->inode)) {unsigned char d_type =DT_UNKNOWN ;
include/linux/ceph/libceph.h +7 -1
@@ -67,7 +67,13 @@ struct ceph_options {#define CEPH_MSG_MAX_FRONT_LEN (16*1024*1024)#define CEPH_MSG_MAX_MIDDLE_LEN (16*1024*1024) -#define CEPH_MSG_MAX_DATA_LEN (16*1024*1024) + +/* +* Handle the largest possible rbd object in one message. +* There is no limit on the size of cephfs objects, but it has to obey +* rsize and wsize mount options anyway. +*/ +#define CEPH_MSG_MAX_DATA_LEN (32*1024*1024)#define CEPH_AUTH_NAME_DEFAULT "guest"
include/linux/tc.h +1 -0
@@ -84,6 +84,7 @@ struct tc_dev {device. */ struct device dev;/* Generic device interface. */ struct resource resource;/* Address space of this device. */ +u64 dma_mask;/* DMA addressable range. */ char vendor[9 ];char name[9 ];char firmware[9 ];
kernel/bounds.c +3 -1
@@ -12,7 +12,7 @@#include <linux/log2.h> #include <linux/spinlock_types.h> -void foo (void ) +int main (void ) {/* The enum constants to put into include/generated/bounds.h */ DEFINE (NR_PAGEFLAGS , __NR_PAGEFLAGS);
@@ -22,4 +22,6 @@ void foo(void)#endif DEFINE (SPINLOCK_SIZE ,sizeof (spinlock_t));/* End of constants */ + +return 0 ; }
kernel/kprobes.c +20 -7
@@ -665,9 +665,10 @@ static void unoptimize_kprobe(struct kprobe *p, bool force) }/* Cancel unoptimizing for reusing */ -static void reuse_unused_kprobe (struct kprobe *ap) +static int reuse_unused_kprobe (struct kprobe *ap) {struct optimized_kprobe *op; +int ret;BUG_ON (!kprobe_unused (ap));/*
@@ -681,8 +682,12 @@ static void reuse_unused_kprobe(struct kprobe *ap)/* Enable the probe again */ ap->flags &= ~KPROBE_FLAG_DISABLED ;/* Optimize it again (remove from op->list) */ -BUG_ON (!kprobe_optready (ap)); + ret =kprobe_optready (ap); +if (ret) +return ret; +optimize_kprobe (ap); +return 0 ; }/* Remove optimized instructions */
@@ -893,11 +898,16 @@ static void __disarm_kprobe(struct kprobe *p, bool reopt)#define kprobe_disarmed (p) kprobe_disabled(p)#define wait_for_kprobe_optimizer () do {} while (0) -/* There should be no unused kprobes can be reused without optimization */ -static void reuse_unused_kprobe (struct kprobe *ap) +static int reuse_unused_kprobe (struct kprobe *ap) { +/* +* If the optimized kprobe is NOT supported, the aggr kprobe is +* released at the same time that the last aggregated kprobe is +* unregistered. +* Thus there should be no chance to reuse unused kprobe. +*/ printk (KERN_ERR "Error: There should be no unused kprobe here.\n" ); -BUG_ON (kprobe_unused (ap)); +return -EINVAL ; }static void free_aggr_kprobe (struct kprobe *p)
@@ -1275,9 +1285,12 @@ static int register_aggr_kprobe(struct kprobe *orig_p, struct kprobe *p) goto out; }init_aggr_kprobe (ap, orig_p); - }else if (kprobe_unused (ap)) + }else if (kprobe_unused (ap)) {/* This probe is going to die. Rescue it */ -reuse_unused_kprobe (ap); + ret =reuse_unused_kprobe (ap); +if (ret) + goto out; + }if (kprobe_gone (ap)) {/*
kernel/locking/lockdep.c +2 -2
@@ -3808,7 +3808,7 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip) {unsigned long flags; -if (unlikely (!lock_stat)) +if (unlikely (!lock_stat || !debug_locks))return ;if (unlikely (current->lockdep_recursion))
@@ -3828,7 +3828,7 @@ void lock_acquired(struct lockdep_map *lock, unsigned long ip) {unsigned long flags; -if (unlikely (!lock_stat)) +if (unlikely (!lock_stat || !debug_locks))return ;if (unlikely (current->lockdep_recursion))
kernel/printk/printk.c +6 -1
@@ -844,7 +844,12 @@ static void __init log_buf_len_update(unsigned size)/* save requested log_buf_len since it's too early to process it */ static int __init log_buf_len_setup (char *str) { -unsigned size =memparse (str, &str); +unsigned int size; + +if (!str) +return -EINVAL ; + + size =memparse (str, &str);log_buf_len_update (size);
kernel/signal.c +1 -1
@@ -1042,7 +1042,7 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t, result =TRACE_SIGNAL_IGNORED ;if (!prepare_signal (sig, t, - from_ancestor_ns || (info ==SEND_SIG_FORCED ))) + from_ancestor_ns || (info ==SEND_SIG_PRIV ) || (info ==SEND_SIG_FORCED ))) goto ret; pending = group ? &t->signal->shared_pending : &t->pending;
lib/debug_locks.c +1 -1
@@ -37,7 +37,7 @@ EXPORT_SYMBOL_GPL(debug_locks_silent);*/ int debug_locks_off (void ) { -if (__debug_locks_off ()) { +if (debug_locks &&__debug_locks_off ()) {if (!debug_locks_silent) {console_verbose ();return 1 ;
mm/hugetlb.c +19 -4
@@ -2576,7 +2576,7 @@ static int is_hugetlb_entry_hwpoisoned(pte_t pte)int copy_hugetlb_page_range (struct mm_struct *dst,struct mm_struct *src,struct vm_area_struct *vma) { -pte_t *src_pte, *dst_pte, entry; +pte_t *src_pte, *dst_pte, entry, dst_entry;struct page *ptepage;unsigned long addr;int cow;
@@ -2604,15 +2604,30 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,break ; } -/* If the pagetables are shared don't copy or take references */ -if (dst_pte == src_pte) +/* +* If the pagetables are shared don't copy or take references. +* dst_pte == src_pte is the common case of src/dest sharing. +* +* However, src could have 'unshared' and dst shares with +* another vma. If dst_pte !none, this implies sharing. +* Check here before taking page table lock, and once again +* after taking the lock below. +*/ + dst_entry =huge_ptep_get (dst_pte); +if ((dst_pte == src_pte) || !huge_pte_none (dst_entry))continue ; dst_ptl =huge_pte_lock (h, dst, dst_pte); src_ptl =huge_pte_lockptr (h, src, src_pte);spin_lock_nested (src_ptl,SINGLE_DEPTH_NESTING ); entry =huge_ptep_get (src_pte); -if (huge_pte_none (entry)) {/* skip none entry */ + dst_entry =huge_ptep_get (dst_pte); +if (huge_pte_none (entry) || !huge_pte_none (dst_entry)) { +/* +* Skip if src entry none. Also, skip in the +* unlikely case dst entry !none as this implies +* sharing with another vma. +*/ ; }else if (unlikely (is_hugetlb_entry_migration (entry) ||is_hugetlb_entry_hwpoisoned (entry))) {
net/9p/protocol.c +5 -0
@@ -45,10 +45,15 @@ p9pdu_writef(struct p9_fcall *pdu, int proto_version, const char *fmt, ...);void p9stat_free (struct p9_wstat *stbuf) {kfree (stbuf->name); + stbuf->name =NULL ;kfree (stbuf->uid); + stbuf->uid =NULL ;kfree (stbuf->gid); + stbuf->gid =NULL ;kfree (stbuf->muid); + stbuf->muid =NULL ;kfree (stbuf->extension); + stbuf->extension =NULL ; }EXPORT_SYMBOL (p9stat_free);
net/ipv4/cipso_ipv4.c +7 -4
@@ -1580,7 +1580,7 @@ static int cipso_v4_parsetag_loc(const struct cipso_v4_doi *doi_def,* * Description: * Parse the packet's IP header looking for a CIPSO option. Returns a pointer -* to the start of the CIPSO option on success, NULL if one if not found. +* to the start of the CIPSO option on success, NULL if one is not found. * */ unsigned char *cipso_v4_optptr (const struct sk_buff *skb)
@@ -1590,10 +1590,8 @@ unsigned char *cipso_v4_optptr(const struct sk_buff *skb)int optlen;int taglen; -for (optlen = iph->ihl*4 -sizeof (struct iphdr ); optlen >0 ; ) { +for (optlen = iph->ihl*4 -sizeof (struct iphdr ); optlen >1 ; ) {switch (optptr[0 ]) { -case IPOPT_CIPSO : -return optptr;case IPOPT_END :return NULL ;case IPOPT_NOOP :
@@ -1602,6 +1600,11 @@ unsigned char *cipso_v4_optptr(const struct sk_buff *skb)default : taglen = optptr[1 ]; } +if (!taglen || taglen > optlen) +return NULL ; +if (optptr[0 ] ==IPOPT_CIPSO ) +return optptr; + optlen -= taglen; optptr += taglen; }
net/sunrpc/svc_xprt.c +1 -1
@@ -902,7 +902,7 @@ static void call_xpt_users(struct svc_xprt *xprt)spin_lock (&xprt->xpt_lock);while (!list_empty (&xprt->xpt_users)) { u = list_first_entry(&xprt->xpt_users, struct svc_xpt_user, list); -list_del (&u->list); +list_del_init (&u->list); u->callback (u); }spin_unlock (&xprt->xpt_lock);
net/sunrpc/xdr.c +2 -3
@@ -638,11 +638,10 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len)/* xdr->iov should already be NULL */ return ; } -if (fraglen) { +if (fraglen) xdr->end = head->iov_base + head->iov_len; - xdr->page_ptr--; - }/* (otherwise assume xdr->end is already set) */ + xdr->page_ptr--; head->iov_len = len; buf->len = len; xdr->p = head->iov_base + head->iov_len;
security/integrity/ima/ima_fs.c +3 -3
@@ -26,14 +26,14 @@#include "ima.h" static int valid_policy =1 ; -#define TMPBUFLEN 12 +static ssize_t ima_show_htable_value (char __user *buf,size_t count,loff_t *ppos,atomic_long_t *val) { -char tmpbuf[TMPBUFLEN ]; +char tmpbuf[32 ];/* greater than largest 'long' string value */ ssize_t len; - len =scnprintf (tmpbuf,TMPBUFLEN ,"%li\n" ,atomic_long_read (val)); + len =scnprintf (tmpbuf,sizeof (tmpbuf),"%li\n" ,atomic_long_read (val));return simple_read_from_buffer (buf, count, ppos, tmpbuf, len); }
sound/pci/ca0106/ca0106.h +1 -1
@@ -582,7 +582,7 @@#define SPI_PL_BIT_R_R (2<<7)/* right channel = right */ #define SPI_PL_BIT_R_C (3<<7)/* right channel = (L+R)/2 */ #define SPI_IZD_REG 2 -#define SPI_IZD_BIT (1<<4)/* infinite zero detect */ +#define SPI_IZD_BIT (0<<4)/* infinite zero detect */ #define SPI_FMT_REG 3#define SPI_FMT_BIT_RJ (0<<0)/* right justified mode */
tools/perf/util/trace-event-info.c +2 -0
@@ -513,12 +513,14 @@ struct tracing_data *tracing_data_get(struct list_head *pattrs, "/tmp/perf-XXXXXX");if (!mkstemp (tdata->temp_file)) {pr_debug ("Can't make temp file" ); +free (tdata);return NULL ; } temp_fd =open (tdata->temp_file,O_RDWR );if (temp_fd <0 ) {pr_debug ("Can't read '%s'" , tdata->temp_file); +free (tdata);return NULL ; }
tools/perf/util/trace-event-read.c +4 -1
@@ -336,9 +336,12 @@ static int read_event_files(struct pevent *pevent)for (x=0 ; x < count; x++) { size =read8 (pevent); ret =read_event_file (pevent, sys, size); -if (ret) +if (ret) { +free (sys);return ret; + } } +free (sys); }return 0 ; }
tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc new file +80 -0
80 lines not on this page · raw message