Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d508daee authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge 4.9.70 into android-4.9-o



Changes in 4.9.70
	net: qmi_wwan: add Quectel BG96 2c7c:0296
	s390/qeth: fix early exit from error path
	tipc: fix memory leak in tipc_accept_from_sock()
	rds: Fix NULL pointer dereference in __rds_rdma_map
	sit: update frag_off info
	packet: fix crash in fanout_demux_rollover()
	net/packet: fix a race in packet_bind() and packet_notifier()
	usbnet: fix alignment for frames with no ethernet header
	net: remove hlist_nulls_add_tail_rcu()
	stmmac: reset last TSO segment size after device open
	tcp/dccp: block bh before arming time_wait timer
	s390/qeth: build max size GSO skbs on L2 devices
	s390/qeth: fix GSO throughput regression
	s390/qeth: fix thinko in IPv4 multicast address tracking
	tipc: call tipc_rcv() only if bearer is up in tipc_udp_recv()
	Fix handling of verdicts after NF_QUEUE
	ipmi: Stop timers before cleaning up the module
	s390: always save and restore all registers on context switch
	usb: gadget: ffs: Forbid usb_ep_alloc_request from sleeping
	fix kcm_clone()
	KVM: arm/arm64: vgic-its: Preserve the revious read from the pending table
	powerpc/64: Fix checksum folding in csum_tcpudp_nofold and ip_fast_csum_nofold
	kbuild: do not call cc-option before KBUILD_CFLAGS initialization
	ipvlan: fix ipv6 outbound device
	audit: ensure that 'audit=1' actually enables audit for PID 1
	md: free unused memory after bitmap resize
	RDMA/cxgb4: Annotate r2 and stag as __be32
	Linux 4.9.70

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parents 2fffe2ee ee52d08d
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 69
SUBLEVEL = 70
EXTRAVERSION =
NAME = Roaring Lionus

@@ -370,9 +370,6 @@ LDFLAGS_MODULE =
CFLAGS_KERNEL	=
AFLAGS_KERNEL	=
LDFLAGS_vmlinux =
CFLAGS_GCOV	:= -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
CFLAGS_KCOV	:= $(call cc-option,-fsanitize-coverage=trace-pc,)


# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE    := \
@@ -393,21 +390,19 @@ LINUXINCLUDE := \

LINUXINCLUDE	+= $(filter-out $(LINUXINCLUDE),$(USERINCLUDE))

KBUILD_CPPFLAGS := -D__KERNEL__

KBUILD_AFLAGS   := -D__ASSEMBLY__
KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
		   -fno-strict-aliasing -fno-common \
		   -Werror-implicit-function-declaration \
		   -Wno-format-security \
		   -std=gnu89 $(call cc-option,-fno-PIE)


		   -std=gnu89
KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS   := -D__ASSEMBLY__ $(call cc-option,-fno-PIE)
KBUILD_AFLAGS_MODULE  := -DMODULE
KBUILD_CFLAGS_MODULE  := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
GCC_PLUGINS_CFLAGS :=

# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
@@ -420,7 +415,7 @@ export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS

export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV CFLAGS_KCOV CFLAGS_KASAN CFLAGS_UBSAN
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_KASAN CFLAGS_UBSAN
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
@@ -620,6 +615,12 @@ endif
# Defaults to vmlinux, but the arch makefile usually adds further targets
all: vmlinux

KBUILD_CFLAGS	+= $(call cc-option,-fno-PIE)
KBUILD_AFLAGS	+= $(call cc-option,-fno-PIE)
CFLAGS_GCOV	:= -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
CFLAGS_KCOV	:= $(call cc-option,-fsanitize-coverage=trace-pc,)
export CFLAGS_GCOV CFLAGS_KCOV

# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
# values of the respective KBUILD_* variables
ARCH_CPPFLAGS :=
+12 −5
Original line number Diff line number Diff line
@@ -53,17 +53,25 @@ static inline __sum16 csum_fold(__wsum sum)
	return (__force __sum16)(~((__force u32)sum + tmp) >> 16);
}

static inline u32 from64to32(u64 x)
{
	/* add up 32-bit and 32-bit for 32+c bit */
	x = (x & 0xffffffff) + (x >> 32);
	/* add up carry.. */
	x = (x & 0xffffffff) + (x >> 32);
	return (u32)x;
}

static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, __u32 len,
					__u8 proto, __wsum sum)
{
#ifdef __powerpc64__
	unsigned long s = (__force u32)sum;
	u64 s = (__force u32)sum;

	s += (__force u32)saddr;
	s += (__force u32)daddr;
	s += proto + len;
	s += (s >> 32);
	return (__force __wsum) s;
	return (__force __wsum) from64to32(s);
#else
    __asm__("\n\
	addc %0,%0,%1 \n\
@@ -123,8 +131,7 @@ static inline __wsum ip_fast_csum_nofold(const void *iph, unsigned int ihl)

	for (i = 0; i < ihl - 1; i++, ptr++)
		s += *ptr;
	s += (s >> 32);
	return (__force __wsum)s;
	return (__force __wsum)from64to32(s);
#else
	__wsum sum, tmp;

+9 −10
Original line number Diff line number Diff line
@@ -29,17 +29,16 @@ static inline void restore_access_regs(unsigned int *acrs)
}

#define switch_to(prev,next,last) do {					\
	if (prev->mm) {							\
	/* save_fpu_regs() sets the CIF_FPU flag, which enforces	\
	 * a restore of the floating point / vector registers as	\
	 * soon as the next task returns to user space			\
	 */								\
	save_fpu_regs();						\
	save_access_regs(&prev->thread.acrs[0]);			\
	save_ri_cb(prev->thread.ri_cb);					\
	}								\
	update_cr_regs(next);						\
	if (next->mm) {							\
		set_cpu_flag(CIF_FPU);					\
	restore_access_regs(&next->thread.acrs[0]);			\
	restore_ri_cb(next->thread.ri_cb, prev->thread.ri_cb);		\
	}								\
	prev = __switch_to(prev,next);					\
} while (0)

+23 −21
Original line number Diff line number Diff line
@@ -241,6 +241,9 @@ struct smi_info {
	/* The timer for this si. */
	struct timer_list   si_timer;

	/* This flag is set, if the timer can be set */
	bool		    timer_can_start;

	/* This flag is set, if the timer is running (timer_pending() isn't enough) */
	bool		    timer_running;

@@ -416,6 +419,8 @@ static enum si_sm_result start_next_msg(struct smi_info *smi_info)

static void smi_mod_timer(struct smi_info *smi_info, unsigned long new_val)
{
	if (!smi_info->timer_can_start)
		return;
	smi_info->last_timeout_jiffies = jiffies;
	mod_timer(&smi_info->si_timer, new_val);
	smi_info->timer_running = true;
@@ -435,21 +440,18 @@ static void start_new_msg(struct smi_info *smi_info, unsigned char *msg,
	smi_info->handlers->start_transaction(smi_info->si_sm, msg, size);
}

static void start_check_enables(struct smi_info *smi_info, bool start_timer)
static void start_check_enables(struct smi_info *smi_info)
{
	unsigned char msg[2];

	msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
	msg[1] = IPMI_GET_BMC_GLOBAL_ENABLES_CMD;

	if (start_timer)
	start_new_msg(smi_info, msg, 2);
	else
		smi_info->handlers->start_transaction(smi_info->si_sm, msg, 2);
	smi_info->si_state = SI_CHECKING_ENABLES;
}

static void start_clear_flags(struct smi_info *smi_info, bool start_timer)
static void start_clear_flags(struct smi_info *smi_info)
{
	unsigned char msg[3];

@@ -458,10 +460,7 @@ static void start_clear_flags(struct smi_info *smi_info, bool start_timer)
	msg[1] = IPMI_CLEAR_MSG_FLAGS_CMD;
	msg[2] = WDT_PRE_TIMEOUT_INT;

	if (start_timer)
	start_new_msg(smi_info, msg, 3);
	else
		smi_info->handlers->start_transaction(smi_info->si_sm, msg, 3);
	smi_info->si_state = SI_CLEARING_FLAGS;
}

@@ -496,11 +495,11 @@ static void start_getting_events(struct smi_info *smi_info)
 * Note that we cannot just use disable_irq(), since the interrupt may
 * be shared.
 */
static inline bool disable_si_irq(struct smi_info *smi_info, bool start_timer)
static inline bool disable_si_irq(struct smi_info *smi_info)
{
	if ((smi_info->irq) && (!smi_info->interrupt_disabled)) {
		smi_info->interrupt_disabled = true;
		start_check_enables(smi_info, start_timer);
		start_check_enables(smi_info);
		return true;
	}
	return false;
@@ -510,7 +509,7 @@ static inline bool enable_si_irq(struct smi_info *smi_info)
{
	if ((smi_info->irq) && (smi_info->interrupt_disabled)) {
		smi_info->interrupt_disabled = false;
		start_check_enables(smi_info, true);
		start_check_enables(smi_info);
		return true;
	}
	return false;
@@ -528,7 +527,7 @@ static struct ipmi_smi_msg *alloc_msg_handle_irq(struct smi_info *smi_info)

	msg = ipmi_alloc_smi_msg();
	if (!msg) {
		if (!disable_si_irq(smi_info, true))
		if (!disable_si_irq(smi_info))
			smi_info->si_state = SI_NORMAL;
	} else if (enable_si_irq(smi_info)) {
		ipmi_free_smi_msg(msg);
@@ -544,7 +543,7 @@ static void handle_flags(struct smi_info *smi_info)
		/* Watchdog pre-timeout */
		smi_inc_stat(smi_info, watchdog_pretimeouts);

		start_clear_flags(smi_info, true);
		start_clear_flags(smi_info);
		smi_info->msg_flags &= ~WDT_PRE_TIMEOUT_INT;
		if (smi_info->intf)
			ipmi_smi_watchdog_pretimeout(smi_info->intf);
@@ -927,7 +926,7 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
		 * disable and messages disabled.
		 */
		if (smi_info->supports_event_msg_buff || smi_info->irq) {
			start_check_enables(smi_info, true);
			start_check_enables(smi_info);
		} else {
			smi_info->curr_msg = alloc_msg_handle_irq(smi_info);
			if (!smi_info->curr_msg)
@@ -1234,6 +1233,7 @@ static int smi_start_processing(void *send_info,

	/* Set up the timer that drives the interface. */
	setup_timer(&new_smi->si_timer, smi_timeout, (long)new_smi);
	new_smi->timer_can_start = true;
	smi_mod_timer(new_smi, jiffies + SI_TIMEOUT_JIFFIES);

	/* Try to claim any interrupts. */
@@ -3448,10 +3448,12 @@ static void check_for_broken_irqs(struct smi_info *smi_info)
	check_set_rcv_irq(smi_info);
}

static inline void wait_for_timer_and_thread(struct smi_info *smi_info)
static inline void stop_timer_and_thread(struct smi_info *smi_info)
{
	if (smi_info->thread != NULL)
		kthread_stop(smi_info->thread);

	smi_info->timer_can_start = false;
	if (smi_info->timer_running)
		del_timer_sync(&smi_info->si_timer);
}
@@ -3593,7 +3595,7 @@ static int try_smi_init(struct smi_info *new_smi)
	 * Start clearing the flags before we enable interrupts or the
	 * timer to avoid racing with the timer.
	 */
	start_clear_flags(new_smi, false);
	start_clear_flags(new_smi);

	/*
	 * IRQ is defined to be set when non-zero.  req_events will
@@ -3671,7 +3673,7 @@ static int try_smi_init(struct smi_info *new_smi)
	return 0;

out_err_stop_timer:
	wait_for_timer_and_thread(new_smi);
	stop_timer_and_thread(new_smi);

out_err:
	new_smi->interrupt_disabled = true;
@@ -3865,7 +3867,7 @@ static void cleanup_one_si(struct smi_info *to_clean)
	 */
	if (to_clean->irq_cleanup)
		to_clean->irq_cleanup(to_clean);
	wait_for_timer_and_thread(to_clean);
	stop_timer_and_thread(to_clean);

	/*
	 * Timeouts are stopped, now make sure the interrupts are off
@@ -3876,7 +3878,7 @@ static void cleanup_one_si(struct smi_info *to_clean)
		poll(to_clean);
		schedule_timeout_uninterruptible(1);
	}
	disable_si_irq(to_clean, false);
	disable_si_irq(to_clean);
	while (to_clean->curr_msg || (to_clean->si_state != SI_NORMAL)) {
		poll(to_clean);
		schedule_timeout_uninterruptible(1);
+2 −2
Original line number Diff line number Diff line
@@ -675,8 +675,8 @@ struct fw_ri_fr_nsmr_tpte_wr {
	__u16  wrid;
	__u8   r1[3];
	__u8   len16;
	__u32  r2;
	__u32  stag;
	__be32  r2;
	__be32  stag;
	struct fw_ri_tpte tpte;
	__u64  pbl[2];
};
Loading