Skip to content

Commit

Permalink
Merge 4.9.138 into android-4.9-p
Browse files Browse the repository at this point in the history
Changes in 4.9.138
	powerpc/eeh: Fix possible null deref in eeh_dump_dev_log()
	tty: check name length in tty_find_polling_driver()
	ARM: imx_v6_v7_defconfig: Select CONFIG_TMPFS_POSIX_ACL
	powerpc/nohash: fix undefined behaviour when testing page size support
	drm/omap: fix memory barrier bug in DMM driver
	media: pci: cx23885: handle adding to list failure
	MIPS: kexec: Mark CPU offline before disabling local IRQ
	powerpc/boot: Ensure _zimage_start is a weak symbol
	MIPS/PCI: Call pcie_bus_configure_settings() to set MPS/MRRS
	sc16is7xx: Fix for multi-channel stall
	media: tvp5150: fix width alignment during set_selection()
	powerpc/selftests: Wait all threads to join
	9p locks: fix glock.client_id leak in do_lock
	9p: clear dangling pointers in p9stat_free
	cdrom: fix improper type cast, which can leat to information leak.
	scsi: qla2xxx: Fix incorrect port speed being set for FC adapters
	scsi: qla2xxx: shutdown chip if reset fail
	fuse: Fix use-after-free in fuse_dev_do_read()
	fuse: Fix use-after-free in fuse_dev_do_write()
	fuse: fix blocked_waitq wakeup
	fuse: set FR_SENT while locked
	mm: do not bug_on on incorrect length in __mm_populate()
	e1000: avoid null pointer dereference on invalid stat type
	e1000: fix race condition between e1000_down() and e1000_watchdog
	bna: ethtool: Avoid reading past end of buffer
	parisc: Align os_hpmc_size on word boundary
	parisc: Fix HPMC handler by increasing size to multiple of 16 bytes
	parisc: Fix exported address of os_hpmc handler
	MIPS: Loongson-3: Fix CPU UART irq delivery problem
	MIPS: Loongson-3: Fix BRIDGE irq delivery problem
	xtensa: add NOTES section to the linker script
	xtensa: make sure bFLT stack is 16 byte aligned
	xtensa: fix boot parameters address translation
	clk: s2mps11: Fix matching when built as module and DT node contains compatible
	clk: at91: Fix division by zero in PLL recalc_rate()
	clk: rockchip: Fix static checker warning in rockchip_ddrclk_get_parent call
	libceph: bump CEPH_MSG_MAX_DATA_LEN
	Revert "ceph: fix dentry leak in splice_dentry()"
	mach64: fix display corruption on big endian machines
	mach64: fix image corruption due to reading accelerator registers
	reset: hisilicon: fix potential NULL pointer dereference
	vhost/scsi: truncate T10 PI iov_iter to prot_bytes
	ocfs2: fix a misuse a of brelse after failing ocfs2_check_dir_entry
	mm: thp: relax __GFP_THISNODE for MADV_HUGEPAGE mappings
	netfilter: conntrack: fix calculation of next bucket number in early_drop
	mtd: docg3: don't set conflicting BCH_CONST_PARAMS option
	of, numa: Validate some distance map rules
	termios, tty/tty_baudrate.c: fix buffer overrun
	arch/alpha, termios: implement BOTHER, IBSHIFT and termios2
	Btrfs: fix cur_offset in the error case for nocow
	Btrfs: fix data corruption due to cloning of eof block
	clockevents/drivers/i8253: Add support for PIT shutdown quirk
	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: avoid possible double brelse() in add_new_gdb() on error path
	ext4: fix possible leak of sbi->s_group_desc_leak in error path
	ext4: fix possible leak of s_journal_flag_rwsem in error path
	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
	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
	sunrpc: correct the computation for page_ptr when truncating
	nfsd: COPY and CLONE operations require the saved filehandle to be set
	rtc: hctosys: Add missing range error reporting
	fuse: fix use-after-free in fuse_direct_IO()
	fuse: fix leaked notify reply
	configfs: replace strncpy with memcpy
	lib/ubsan.c: don't mark __ubsan_handle_builtin_unreachable as noreturn
	hugetlbfs: fix kernel BUG at fs/hugetlbfs/inode.c:444!
	mm: migration: fix migration of huge PMD shared pages
	drm/rockchip: Allow driver to be shutdown on reboot/kexec
	drm/dp_mst: Check if primary mstb is null
	drm/i915/hdmi: Add HDMI 2.0 audio clock recovery N values
	drm/i915/execlists: Force write serialisation into context image vs execution
	KVM: arm64: Fix caching of host MDCR_EL2 value
	Linux 4.9.138

Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Nov 23, 2018
2 parents 08c5249 + 7a4dc3f commit 4468906
Show file tree
Hide file tree
Showing 73 changed files with 579 additions and 209 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 137
SUBLEVEL = 138
EXTRAVERSION =
NAME = Roaring Lionus

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
1 change: 1 addition & 0 deletions arch/arm/configs/imx_v6_v7_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_JFFS2_FS=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/kvm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,6 @@ static void cpu_init_hyp_mode(void *dummy)

__cpu_init_hyp_mode(pgd_ptr, hyp_stack_ptr, vector_ptr);
__cpu_init_stage2();

kvm_arm_init_debug();
}

static void cpu_hyp_reinit(void)
Expand All @@ -1108,6 +1106,8 @@ static void cpu_hyp_reinit(void)
if (__hyp_get_vectors() == hyp_default_vectors)
cpu_init_hyp_mode(NULL);
}

kvm_arm_init_debug();
}

static void cpu_hyp_reset(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/include/asm/mach-loongson64/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define MIPS_CPU_IRQ_BASE 56

#define LOONGSON_UART_IRQ (MIPS_CPU_IRQ_BASE + 2) /* UART */
#define LOONGSON_HT1_IRQ (MIPS_CPU_IRQ_BASE + 3) /* HT1 */
#define LOONGSON_BRIDGE_IRQ (MIPS_CPU_IRQ_BASE + 3) /* CASCADE */
#define LOONGSON_TIMER_IRQ (MIPS_CPU_IRQ_BASE + 7) /* CPU Timer */

#define LOONGSON_HT1_CFG_BASE loongson_sysconf.ht_control_base
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 (!cpumask_test_cpu(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 @@ -96,6 +96,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
56 changes: 6 additions & 50 deletions arch/mips/loongson64/loongson-3/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,51 +44,8 @@ void mach_irq_dispatch(unsigned int pending)
}
}

static struct irqaction cascade_irqaction = {
.handler = no_action,
.flags = IRQF_NO_SUSPEND,
.name = "cascade",
};

static inline void mask_loongson_irq(struct irq_data *d)
{
clear_c0_status(0x100 << (d->irq - MIPS_CPU_IRQ_BASE));
irq_disable_hazard();

/* Workaround: UART IRQ may deliver to any core */
if (d->irq == LOONGSON_UART_IRQ) {
int cpu = smp_processor_id();
int node_id = cpu_logical_map(cpu) / loongson_sysconf.cores_per_node;
int core_id = cpu_logical_map(cpu) % loongson_sysconf.cores_per_node;
u64 intenclr_addr = smp_group[node_id] |
(u64)(&LOONGSON_INT_ROUTER_INTENCLR);
u64 introuter_lpc_addr = smp_group[node_id] |
(u64)(&LOONGSON_INT_ROUTER_LPC);

*(volatile u32 *)intenclr_addr = 1 << 10;
*(volatile u8 *)introuter_lpc_addr = 0x10 + (1<<core_id);
}
}

static inline void unmask_loongson_irq(struct irq_data *d)
{
/* Workaround: UART IRQ may deliver to any core */
if (d->irq == LOONGSON_UART_IRQ) {
int cpu = smp_processor_id();
int node_id = cpu_logical_map(cpu) / loongson_sysconf.cores_per_node;
int core_id = cpu_logical_map(cpu) % loongson_sysconf.cores_per_node;
u64 intenset_addr = smp_group[node_id] |
(u64)(&LOONGSON_INT_ROUTER_INTENSET);
u64 introuter_lpc_addr = smp_group[node_id] |
(u64)(&LOONGSON_INT_ROUTER_LPC);

*(volatile u32 *)intenset_addr = 1 << 10;
*(volatile u8 *)introuter_lpc_addr = 0x10 + (1<<core_id);
}

set_c0_status(0x100 << (d->irq - MIPS_CPU_IRQ_BASE));
irq_enable_hazard();
}
static inline void mask_loongson_irq(struct irq_data *d) { }
static inline void unmask_loongson_irq(struct irq_data *d) { }

/* For MIPS IRQs which shared by all cores */
static struct irq_chip loongson_irq_chip = {
Expand Down Expand Up @@ -126,12 +83,11 @@ void __init mach_init_irq(void)
mips_cpu_irq_init();
init_i8259_irqs();
irq_set_chip_and_handler(LOONGSON_UART_IRQ,
&loongson_irq_chip, handle_level_irq);

/* setup HT1 irq */
setup_irq(LOONGSON_HT1_IRQ, &cascade_irqaction);
&loongson_irq_chip, handle_percpu_irq);
irq_set_chip_and_handler(LOONGSON_BRIDGE_IRQ,
&loongson_irq_chip, handle_percpu_irq);

set_c0_status(STATUSF_IP2 | STATUSF_IP6);
set_c0_status(STATUSF_IP2 | STATUSF_IP3 | STATUSF_IP6);
}

#ifdef CONFIG_HOTPLUG_CPU
Expand Down
4 changes: 4 additions & 0 deletions arch/mips/pci/pci-legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ static void pcibios_scanbus(struct pci_controller *hose)
if (pci_has_flag(PCI_PROBE_ONLY)) {
pci_bus_claim_resources(bus);
} else {
struct pci_bus *child;

pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
list_for_each_entry(child, &bus->children, node)
pcie_bus_configure_settings(child);
}
pci_bus_add_devices(bus);
}
Expand Down
10 changes: 7 additions & 3 deletions arch/parisc/kernel/hpmc.S
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ END(hpmc_pim_data)
.text

.import intr_save, code
ENTRY_CFI(os_hpmc)
.align 16
ENTRY(os_hpmc)
.os_hpmc:

/*
Expand Down Expand Up @@ -299,11 +300,14 @@ os_hpmc_6:

b .
nop
ENDPROC_CFI(os_hpmc)
.align 16 /* make function length multiple of 16 bytes */
.os_hpmc_end:


__INITRODATA
.export os_hpmc_size
.globl os_hpmc_size
.align 4
.type os_hpmc_size, @object
.size os_hpmc_size, 4
os_hpmc_size:
.word .os_hpmc_end-.os_hpmc
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
5 changes: 5 additions & 0 deletions arch/powerpc/kernel/eeh.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ static size_t eeh_dump_dev_log(struct eeh_dev *edev, char *buf, size_t len)
int n = 0, l = 0;
char buffer[128];

if (!pdn) {
pr_warn("EEH: Note: No error log for absent device.\n");
return 0;
}

n += scnprintf(buf+n, len-n, "%04x:%02x:%02x.%01x\n",
edev->phb->global_number, pdn->busno,
PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));
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 @@ -481,6 +481,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
2 changes: 1 addition & 1 deletion arch/xtensa/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
$(addprefix $(obj)/,$(host-progs))
$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)

OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
OBJCOPYFLAGS = --strip-all -R .comment -R .notes -O binary

vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)
Expand Down
6 changes: 5 additions & 1 deletion arch/xtensa/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
# error Linux requires the Xtensa Windowed Registers Option.
#endif

#define ARCH_SLAB_MINALIGN XCHAL_DATA_WIDTH
/* Xtensa ABI requires stack alignment to be at least 16 */

#define STACK_ALIGN (XCHAL_DATA_WIDTH > 16 ? XCHAL_DATA_WIDTH : 16)

#define ARCH_SLAB_MINALIGN STACK_ALIGN

/*
* User space process size: 1 GB.
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
1 change: 1 addition & 0 deletions arch/xtensa/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ SECTIONS
.fixup : { *(.fixup) }

EXCEPTION_TABLE(16)
NOTES
/* Data section */

_sdata = .;
Expand Down
2 changes: 1 addition & 1 deletion drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,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
3 changes: 3 additions & 0 deletions drivers/clk/at91/clk-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hw,
{
struct clk_pll *pll = to_clk_pll(hw);

if (!pll->div || !pll->mul)
return 0;

return (parent_rate / pll->div) * (pll->mul + 1);
}

Expand Down
30 changes: 30 additions & 0 deletions drivers/clk/clk-s2mps11.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,36 @@ static const struct platform_device_id s2mps11_clk_id[] = {
};
MODULE_DEVICE_TABLE(platform, s2mps11_clk_id);

#ifdef CONFIG_OF
/*
* Device is instantiated through parent MFD device and device matching is done
* through platform_device_id.
*
* However if device's DT node contains proper clock compatible and driver is
* built as a module, then the *module* matching will be done trough DT aliases.
* This requires of_device_id table. In the same time this will not change the
* actual *device* matching so do not add .of_match_table.
*/
static const struct of_device_id s2mps11_dt_match[] = {
{
.compatible = "samsung,s2mps11-clk",
.data = (void *)S2MPS11X,
}, {
.compatible = "samsung,s2mps13-clk",
.data = (void *)S2MPS13X,
}, {
.compatible = "samsung,s2mps14-clk",
.data = (void *)S2MPS14X,
}, {
.compatible = "samsung,s5m8767-clk",
.data = (void *)S5M8767X,
}, {
/* Sentinel */
},
};
MODULE_DEVICE_TABLE(of, s2mps11_dt_match);
#endif

static struct platform_driver s2mps11_clk_driver = {
.driver = {
.name = "s2mps11-clk",
Expand Down
5 changes: 2 additions & 3 deletions drivers/clk/hisilicon/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ struct hisi_reset_controller *hisi_reset_init(struct platform_device *pdev)
return NULL;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
rstc->membase = devm_ioremap(&pdev->dev,
res->start, resource_size(res));
if (!rstc->membase)
rstc->membase = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(rstc->membase))
return NULL;

spin_lock_init(&rstc->lock);
Expand Down
Loading

0 comments on commit 4468906

Please sign in to comment.