All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Remi Denis-Courmont <courmisch@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.14 41/59] phonet: properly unshare skbs in phonet_rcv()
Date: Wed, 27 Jan 2016 10:15:29 -0800	[thread overview]
Message-ID: <20160127180738.326987009@linuxfoundation.org> (raw)
In-Reply-To: <20160127180730.588995883@linuxfoundation.org>

3.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 7aaed57c5c2890634cfadf725173c7c68ea4cb4f ]

Ivaylo Dimitrov reported a regression caused by commit 7866a621043f
("dev: add per net_device packet type chains").

skb->dev becomes NULL and we crash in __netif_receive_skb_core().

Before above commit, different kind of bugs or corruptions could happen
without major crash.

But the root cause is that phonet_rcv() can queue skb without checking
if skb is shared or not.

Many thanks to Ivaylo Dimitrov for his help, diagnosis and tests.

Reported-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Tested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Remi Denis-Courmont <courmisch@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/phonet/af_phonet.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -377,6 +377,10 @@ static int phonet_rcv(struct sk_buff *sk
 	struct sockaddr_pn sa;
 	u16 len;
 
+	skb = skb_share_check(skb, GFP_ATOMIC);
+	if (!skb)
+		return NET_RX_DROP;
+
 	/* check we have at least a full Phonet header */
 	if (!pskb_pull(skb, sizeof(struct phonethdr)))
 		goto out;

  parent reply	other threads:[~2016-01-27 19:22 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 18:14 [PATCH 3.14 00/59] 3.14.60-stable review Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 01/59] x86/signal: Fix restart_syscall number for x32 tasks Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 02/59] xen/gntdev: Grant maps should not be subject to NUMA balancing Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 03/59] x86/xen: dont reset vcpu_info on a cancelled suspend Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 04/59] KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 05/59] x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[] Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 06/59] x86/boot: Double BOOT_HEAP_SIZE to 64KB Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 07/59] ipmi: move timer init to before irq is setup Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 08/59] ALSA: hda - Add Intel Lewisburg device IDs Audio Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 09/59] ALSA: hda - Apply pin fixup for HP ProBook 6550b Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 10/59] ALSA: rme96: Fix unexpected volume reset after rate changes Greg Kroah-Hartman
2016-01-27 18:14 ` [PATCH 3.14 11/59] ALSA: hda - Add inverted dmic for Packard Bell DOTS Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 12/59] ALSA: hda - Set SKL+ hda controller power at freeze() and thaw() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 13/59] ALSA: hda/realtek - Fix silent headphone output on MacPro 4,1 (v2) Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 14/59] ALSA: seq: Fix missing NULL check at remove_events ioctl Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 15/59] ALSA: seq: Fix race at timer setup and close Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 16/59] ALSA: timer: Harden slave timer list handling Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 17/59] ALSA: timer: Fix race among timer ioctls Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 18/59] ALSA: timer: Fix double unlink of active_list Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 19/59] ALSA: seq: Fix snd_seq_call_port_info_ioctl in compat mode Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 20/59] ALSA: pcm: Fix snd_pcm_hw_params struct copy " Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 21/59] ALSA: hrtimer: Fix stall by hrtimer_cancel() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 22/59] ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0 Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 23/59] ASoC: wm8962: correct addresses for HPF_C_0/1 Greg Kroah-Hartman
2016-01-27 18:15   ` Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 24/59] ASoC: wm8974: set cache type for regmap Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 25/59] ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 26/59] ASoC: compress: Fix compress device direction check Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 27/59] usb: xhci: fix config fail of FS hub behind a HS hub with MTT Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 28/59] USB: ipaq.c: fix a timeout loop Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 29/59] USB: cp210x: add ID for ELV Marble Sound Board 1 Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 30/59] xhci: refuse loading if nousb is used Greg Kroah-Hartman
2016-01-28 17:57   ` Luis Henriques
2016-01-28 17:57     ` Luis Henriques
2016-01-31 19:10     ` Greg Kroah-Hartman
2016-01-31 19:10       ` Greg Kroah-Hartman
2016-02-02 17:34       ` Luis Henriques
2016-02-02 17:34         ` Luis Henriques
2016-01-27 18:15 ` [PATCH 3.14 32/59] ipv6/addrlabel: fix ip6addrlbl_get() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 33/59] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 34/59] connector: bump skb->users before callback invocation Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 35/59] unix: properly account for FDs passed over unix sockets Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 36/59] bridge: Only call /sbin/bridge-stp for the initial network namespace Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 37/59] net: possible use after free in dst_release Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 38/59] net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 39/59] tcp_yeah: dont set ssthresh below 2 Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 40/59] bonding: Prevent IPv6 link local address on enslaved devices Greg Kroah-Hartman
2016-01-27 18:15 ` Greg Kroah-Hartman [this message]
2016-01-27 18:15 ` [PATCH 3.14 42/59] ipv6: update skb->csum when CE mark is propagated Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 43/59] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 45/59] team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 46/59] powerpc/tm: Block signal return setting invalid MSR state Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 47/59] powerpc/tm: Check for already reclaimed tasks Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 48/59] powerpc: Make value-returning atomics fully ordered Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 49/59] powerpc: Make {cmp}xchg* and their atomic_ versions " Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 50/59] scripts/recordmcount.pl: support data in text section on powerpc Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 51/59] arm64: KVM: Fix AArch32 to AArch64 register mapping Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 52/59] arm64: fix building without CONFIG_UID16 Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 53/59] arm64: Clear out any singlestep state on a ptrace detach operation Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 54/59] arm64: mm: ensure that the zero page is visible to the page table walker Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 55/59] parisc iommu: fix panic due to trying to allocate too large region Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 56/59] HID: core: Avoid uninitialized buffer access Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 57/59] openrisc: fix CONFIG_UID16 setting Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 58/59] mn10300: Select CONFIG_HAVE_UID16 to fix build failure Greg Kroah-Hartman
2016-01-27 18:15 ` [PATCH 3.14 59/59] arm64: restore bogomips information in /proc/cpuinfo Greg Kroah-Hartman
2016-01-27 23:29 ` [PATCH 3.14 00/59] 3.14.60-stable review Shuah Khan
2016-01-28  2:01 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160127180738.326987009@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=courmisch@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.