Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Commit

Permalink
Merge tag 'v3.18.126' into XOS-8.1
Browse files Browse the repository at this point in the history
This is the 3.18.126 stable release

* tag 'v3.18.126': (88 commits)
  Linux 3.18.126
  hugetlbfs: fix kernel BUG at fs/hugetlbfs/inode.c:444!
  configfs: replace strncpy with memcpy
  fuse: fix leaked notify reply
  sunrpc: correct the computation for page_ptr when truncating
  mount: Prevent MNT_DETACH from disconnecting locked mounts
  mount: Don't allow copying MNT_UNBINDABLE|MNT_LOCKED mounts
  mount: Retest MNT_LOCKED in do_umount
  ext4: fix buffer leak in __ext4_read_dirblock() on error path
  ext4: fix buffer leak in ext4_xattr_move_to_block() on error path
  ext4: release bs.bh before re-using in ext4_xattr_block_find()
  ext4: fix possible leak of sbi->s_group_desc_leak in error path
  ext4: avoid possible double brelse() in add_new_gdb() on error path
  ext4: fix missing cleanup if ext4_alloc_flex_bg_array() fails while resizing
  ext4: avoid buffer leak in ext4_orphan_add() after prior errors
  ext4: fix possible inode leak in the retry loop of ext4_resize_fs()
  ext4: avoid potential extra brelse in setup_new_flex_group_blocks()
  ext4: add missing brelse() add_new_gdb_meta_bg()'s error path
  ext4: add missing brelse() in set_flexbg_block_bitmap()'s error path
  ext4: add missing brelse() update_backups()'s error path
  ...
  • Loading branch information
msfjarvis committed Nov 22, 2018
2 parents 848fe2c + 1ed0896 commit 8165cf9
Show file tree
Hide file tree
Showing 82 changed files with 539 additions and 158 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 18
SUBLEVEL = 125
SUBLEVEL = 126
EXTRAVERSION =
NAME = Diseased Newt

Expand Down
8 changes: 7 additions & 1 deletion arch/alpha/include/asm/termios.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
5 changes: 5 additions & 0 deletions arch/alpha/include/uapi/asm/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
17 changes: 17 additions & 0 deletions arch/alpha/include/uapi/asm/termbits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -147,6 +160,7 @@ struct ktermios {
#define B3000000 00034
#define B3500000 00035
#define B4000000 00036
#define BOTHER 00037

#define CSIZE 00001400
#define CS5 00000000
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions arch/mips/kernel/crash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions arch/mips/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/boot/crt0.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/mm/tlb_nohash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
26 changes: 22 additions & 4 deletions arch/sparc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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;
Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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))
Expand All @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down
7 changes: 7 additions & 0 deletions arch/x86/boot/tools/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 15 additions & 0 deletions arch/x86/kernel/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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')
Expand Down
7 changes: 5 additions & 2 deletions arch/xtensa/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion crypto/lrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
25 changes: 15 additions & 10 deletions drivers/block/ataflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down
13 changes: 11 additions & 2 deletions drivers/block/swim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
11 changes: 11 additions & 0 deletions drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,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]);
Expand Down

0 comments on commit 8165cf9

Please sign in to comment.