Skip to content

Commit

Permalink
Merge tag 'v4.9.28' into linux-4.9.x-unofficial_grsec
Browse files Browse the repository at this point in the history
This is the 4.9.28 stable release

Signed-off-by: Mathias Krause <[email protected]>

Conflicts:
	arch/x86/kernel/kprobes/core.c
  • Loading branch information
minipli committed May 14, 2017
2 parents fc6850f + 58cd97f commit ecb2bd5
Show file tree
Hide file tree
Showing 122 changed files with 932 additions and 513 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 = 27
SUBLEVEL = 28
EXTRAVERSION =
NAME = Roaring Lionus

Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm958522er.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
gpio-restart {
compatible = "gpio-restart";
gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
open-source;
priority = <200>;
};
};
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm958525er.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
gpio-restart {
compatible = "gpio-restart";
gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
open-source;
priority = <200>;
};
};
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm958525xmc.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
gpio-restart {
compatible = "gpio-restart";
gpios = <&gpioa 31 GPIO_ACTIVE_LOW>;
open-source;
priority = <200>;
};
};
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm958622hr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
gpio-restart {
compatible = "gpio-restart";
gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
open-source;
priority = <200>;
};
};
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm958623hr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
gpio-restart {
compatible = "gpio-restart";
gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
open-source;
priority = <200>;
};
};
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm958625hr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
gpio-restart {
compatible = "gpio-restart";
gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
open-source;
priority = <200>;
};
};
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/bcm988312hr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
gpio-restart {
compatible = "gpio-restart";
gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
open-source;
priority = <200>;
};
};
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/qcom-ipq8064.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
cxo_board {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <19200000>;
clock-frequency = <25000000>;
};

pxo_board {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <27000000>;
clock-frequency = <25000000>;
};

sleep_clk: sleep_clk {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
reg = <8>;
label = "cpu";
ethernet = <&gmac>;
phy-mode = "rgmii";
phy-mode = "rgmii-txid";
fixed-link {
speed = <1000>;
full-duplex;
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/omap-headsmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/assembler.h>

#include "omap44xx.h"

Expand Down Expand Up @@ -66,7 +67,7 @@ wait_2: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0
cmp r0, r4
bne wait_2
ldr r12, =API_HYP_ENTRY
adr r0, hyp_boot
badr r0, hyp_boot
smc #0
hyp_boot:
b omap_secondary_startup
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/renesas/r8a7795.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@
phy-mode = "rgmii-id";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};

can0: can@e6c30000 {
Expand Down
15 changes: 9 additions & 6 deletions arch/arm64/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
#define pte_young(pte) (!!(pte_val(pte) & PTE_AF))
#define pte_special(pte) (!!(pte_val(pte) & PTE_SPECIAL))
#define pte_write(pte) (!!(pte_val(pte) & PTE_WRITE))
#define pte_exec(pte) (!(pte_val(pte) & PTE_UXN))
#define pte_user_exec(pte) (!(pte_val(pte) & PTE_UXN))
#define pte_cont(pte) (!!(pte_val(pte) & PTE_CONT))
#define pte_ng(pte) (!!(pte_val(pte) & PTE_NG))

#ifdef CONFIG_ARM64_HW_AFDBM
#define pte_hw_dirty(pte) (pte_write(pte) && !(pte_val(pte) & PTE_RDONLY))
Expand All @@ -87,8 +86,12 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
#define pte_dirty(pte) (pte_sw_dirty(pte) || pte_hw_dirty(pte))

#define pte_valid(pte) (!!(pte_val(pte) & PTE_VALID))
#define pte_valid_global(pte) \
((pte_val(pte) & (PTE_VALID | PTE_NG)) == PTE_VALID)
/*
* Execute-only user mappings do not have the PTE_USER bit set. All valid
* kernel mappings have the PTE_UXN bit set.
*/
#define pte_valid_not_user(pte) \
((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_UXN)) == (PTE_VALID | PTE_UXN))
#define pte_valid_young(pte) \
((pte_val(pte) & (PTE_VALID | PTE_AF)) == (PTE_VALID | PTE_AF))

Expand Down Expand Up @@ -181,7 +184,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
* Only if the new pte is valid and kernel, otherwise TLB maintenance
* or update_mmu_cache() have the necessary barriers.
*/
if (pte_valid_global(pte)) {
if (pte_valid_not_user(pte)) {
dsb(ishst);
isb();
}
Expand Down Expand Up @@ -215,7 +218,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
pte_val(pte) &= ~PTE_RDONLY;
else
pte_val(pte) |= PTE_RDONLY;
if (pte_ng(pte) && pte_exec(pte) && !pte_special(pte))
if (pte_user_exec(pte) && !pte_special(pte))
__sync_icache_dcache(pte, addr);
}

Expand Down
8 changes: 4 additions & 4 deletions arch/arm64/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,14 +779,14 @@ static int build_body(struct jit_ctx *ctx)
int ret;

ret = build_insn(insn, ctx);

if (ctx->image == NULL)
ctx->offset[i] = ctx->idx;

if (ret > 0) {
i++;
if (ctx->image == NULL)
ctx->offset[i] = ctx->idx;
continue;
}
if (ctx->image == NULL)
ctx->offset[i] = ctx->idx;
if (ret)
return ret;
}
Expand Down
12 changes: 6 additions & 6 deletions arch/mips/kernel/mips-r2-to-r6-emul.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ static int multu_func(struct pt_regs *regs, u32 ir)
rs = regs->regs[MIPSInst_RS(ir)];
res = (u64)rt * (u64)rs;
rt = res;
regs->lo = (s64)rt;
regs->hi = (s64)(res >> 32);
regs->lo = (s64)(s32)rt;
regs->hi = (s64)(s32)(res >> 32);

MIPS_R2_STATS(muls);

Expand Down Expand Up @@ -670,9 +670,9 @@ static int maddu_func(struct pt_regs *regs, u32 ir)
res += ((((s64)rt) << 32) | (u32)rs);

rt = res;
regs->lo = (s64)rt;
regs->lo = (s64)(s32)rt;
rs = res >> 32;
regs->hi = (s64)rs;
regs->hi = (s64)(s32)rs;

MIPS_R2_STATS(dsps);

Expand Down Expand Up @@ -728,9 +728,9 @@ static int msubu_func(struct pt_regs *regs, u32 ir)
res = ((((s64)rt) << 32) | (u32)rs) - res;

rt = res;
regs->lo = (s64)rt;
regs->lo = (s64)(s32)rt;
rs = res >> 32;
regs->hi = (s64)rs;
regs->hi = (s64)(s32)rs;

MIPS_R2_STATS(dsps);

Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ config DISABLE_MPROFILE_KERNEL
be disabled also.

If you have a toolchain which supports mprofile-kernel, then you can
enable this. Otherwise leave it disabled. If you're not sure, say
"N".
disable this. Otherwise leave it enabled. If you're not sure, say
"Y".

config MPROFILE_KERNEL
depends on PPC64 && CPU_LITTLE_ENDIAN
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
#define LPCR_DPFD_SH 52
#define LPCR_DPFD (ASM_CONST(7) << LPCR_DPFD_SH)
#define LPCR_VRMASD_SH 47
#define LPCR_VRMASD (ASM_CONST(1) << LPCR_VRMASD_SH)
#define LPCR_VRMASD (ASM_CONST(0x1f) << LPCR_VRMASD_SH)
#define LPCR_VRMA_L ASM_CONST(0x0008000000000000)
#define LPCR_VRMA_LP0 ASM_CONST(0x0001000000000000)
#define LPCR_VRMA_LP1 ASM_CONST(0x0000800000000000)
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/powernv/opal-wrappers.S
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ opal_tracepoint_entry:
opal_tracepoint_return:
std r3,STK_REG(R31)(r1)
mr r4,r3
ld r0,STK_REG(R23)(r1)
ld r3,STK_REG(R23)(r1)
bl __trace_opal_exit
ld r3,STK_REG(R31)(r1)
addi r1,r1,STACKFRAMESIZE
Expand Down
6 changes: 6 additions & 0 deletions arch/sparc/kernel/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -935,3 +935,9 @@ ENTRY(__retl_o1)
retl
mov %o1, %o0
ENDPROC(__retl_o1)

ENTRY(__retl_o1_asi)
wr %o5, 0x0, %asi
retl
mov %o1, %o0
ENDPROC(__retl_o1_asi)
2 changes: 1 addition & 1 deletion arch/sparc/lib/GENbzero.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
98: x,y; \
.section __ex_table,"a";\
.align 4; \
.word 98b, __retl_o1; \
.word 98b, __retl_o1_asi;\
.text; \
.align 4;

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/lib/NGbzero.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
98: x,y; \
.section __ex_table,"a";\
.align 4; \
.word 98b, __retl_o1; \
.word 98b, __retl_o1_asi;\
.text; \
.align 4;

Expand Down
6 changes: 6 additions & 0 deletions arch/x86/events/intel/pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,24 @@ static struct attribute_group pt_cap_group = {
};

PMU_FORMAT_ATTR(cyc, "config:1" );
PMU_FORMAT_ATTR(pwr_evt, "config:4" );
PMU_FORMAT_ATTR(fup_on_ptw, "config:5" );
PMU_FORMAT_ATTR(mtc, "config:9" );
PMU_FORMAT_ATTR(tsc, "config:10" );
PMU_FORMAT_ATTR(noretcomp, "config:11" );
PMU_FORMAT_ATTR(ptw, "config:12" );
PMU_FORMAT_ATTR(mtc_period, "config:14-17" );
PMU_FORMAT_ATTR(cyc_thresh, "config:19-22" );
PMU_FORMAT_ATTR(psb_period, "config:24-27" );

static struct attribute *pt_formats_attr[] = {
&format_attr_cyc.attr,
&format_attr_pwr_evt.attr,
&format_attr_fup_on_ptw.attr,
&format_attr_mtc.attr,
&format_attr_tsc.attr,
&format_attr_noretcomp.attr,
&format_attr_ptw.attr,
&format_attr_mtc_period.attr,
&format_attr_cyc_thresh.attr,
&format_attr_psb_period.attr,
Expand Down
11 changes: 11 additions & 0 deletions arch/x86/include/asm/xen/events.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@ static inline int xen_irqs_disabled(struct pt_regs *regs)
/* No need for a barrier -- XCHG is a barrier on x86. */
#define xchg_xen_ulong(ptr, val) xchg((ptr), (val))

extern int xen_have_vector_callback;

/*
* Events delivered via platform PCI interrupts are always
* routed to vcpu 0 and hence cannot be rebound.
*/
static inline bool xen_support_evtchn_rebind(void)
{
return (!xen_hvm_domain() || xen_have_vector_callback);
}

#endif /* _ASM_X86_XEN_EVENTS_H */
2 changes: 2 additions & 0 deletions arch/x86/kernel/apic/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,7 @@ static struct irq_chip ioapic_chip = {
.irq_ack = irq_chip_ack_parent,
.irq_eoi = ioapic_ack_level,
.irq_set_affinity = ioapic_set_affinity,
.irq_retrigger = irq_chip_retrigger_hierarchy,
.flags = IRQCHIP_SKIP_SET_WAKE,
};

Expand All @@ -1887,6 +1888,7 @@ static struct irq_chip ioapic_ir_chip = {
.irq_ack = irq_chip_ack_parent,
.irq_eoi = ioapic_ir_ack_level,
.irq_set_affinity = ioapic_set_affinity,
.irq_retrigger = irq_chip_retrigger_hierarchy,
.flags = IRQCHIP_SKIP_SET_WAKE,
};

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/kprobes/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#endif

/* Ensure if the instruction can be boostable */
extern int can_boost(kprobe_opcode_t *instruction);
extern int can_boost(kprobe_opcode_t *instruction, void *addr);
/* Recover instruction if given address is probed */
extern unsigned long recover_probed_instruction(kprobe_opcode_t *buf,
unsigned long addr);
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/kernel/kprobes/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ NOKPROBE_SYMBOL(skip_prefixes);
* Returns non-zero if opcode is boostable.
* RIP relative instructions are adjusted at copying time in 64 bits mode
*/
int can_boost(kprobe_opcode_t *opcodes)
int can_boost(kprobe_opcode_t *opcodes, void *addr)
{
kprobe_opcode_t opcode;
kprobe_opcode_t *orig_opcodes = opcodes;

if (search_exception_tables(ktva_ktla((unsigned long)opcodes)))
if (search_exception_tables(ktva_ktla((unsigned long)addr)))
return 0; /* Page fault may occur on this address. */

retry:
Expand Down Expand Up @@ -423,7 +423,7 @@ static int arch_copy_kprobe(struct kprobe *p)
* __copy_instruction can modify the displacement of the instruction,
* but it doesn't affect boostable check.
*/
if (can_boost(p->ainsn.insn))
if (can_boost(p->ainsn.insn, p->addr))
p->ainsn.boostable = 0;
else
p->ainsn.boostable = -1;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/kprobes/opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static int copy_optimized_instructions(u8 *dest, u8 *src)

while (len < RELATIVEJUMP_SIZE) {
ret = __copy_instruction(dest + len, src + len);
if (!ret || !can_boost(dest + len))
if (!ret || !can_boost(dest + len, src + len))
return -EINVAL;
len += ret;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/pci-calgary_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,

/* were we called with bad_dma_address? */
badend = DMA_ERROR_CODE + (EMERGENCY_PAGES * PAGE_SIZE);
if (unlikely((dma_addr >= DMA_ERROR_CODE) && (dma_addr < badend))) {
if (unlikely(dma_addr < badend)) {
WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA "
"address 0x%Lx\n", dma_addr);
return;
Expand Down
6 changes: 0 additions & 6 deletions arch/x86/kvm/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,12 +846,6 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
if (!best)
best = check_cpuid_limit(vcpu, function, index);

/*
* Perfmon not yet supported for L2 guest.
*/
if (is_guest_mode(vcpu) && function == 0xa)
best = NULL;

if (best) {
*eax = best->eax;
*ebx = best->ebx;
Expand Down
Loading

0 comments on commit ecb2bd5

Please sign in to comment.