linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Paasch <cpaasch@apple.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>,
	Tyler Hicks <tyhicks@canonical.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 4.14 09/89] net: Prevent invalid access to skb->prev in __qdisc_drop_all
Date: Fri, 14 Dec 2018 07:54:35 -0800	[thread overview]
Message-ID: <20181214155435.GK41383@MacBook-Pro-19.local> (raw)
In-Reply-To: <20181214155226.GJ41383@MacBook-Pro-19.local>

On 14/12/18 - 07:52:26, Christoph Paasch wrote:
> Hello Greg,
> 
> On 14/12/18 - 12:59:22, Greg Kroah-Hartman wrote:
> > 4.14-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Christoph Paasch <cpaasch@apple.com>
> > 
> > [ Upstream commit 9410d386d0a829ace9558336263086c2fbbe8aed ]
> > 
> > __qdisc_drop_all() accesses skb->prev to get to the tail of the
> > segment-list.
> > 
> > With commit 68d2f84a1368 ("net: gro: properly remove skb from list")
> > the skb-list handling has been changed to set skb->next to NULL and set
> > the list-poison on skb->prev.
> > 
> > With that change, __qdisc_drop_all() will panic when it tries to
> > dereference skb->prev.
> > 
> > Since commit 992cba7e276d ("net: Add and use skb_list_del_init().")
> > __list_del_entry is used, leaving skb->prev unchanged (thus,
> > pointing to the list-head if it's the first skb of the list).
> > This will make __qdisc_drop_all modify the next-pointer of the list-head
> > and result in a panic later on:
> > 
> > [   34.501053] general protection fault: 0000 [#1] SMP KASAN PTI
> > [   34.501968] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.20.0-rc2.mptcp #108
> > [   34.502887] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.5.1 01/01/2011
> > [   34.504074] RIP: 0010:dev_gro_receive+0x343/0x1f90
> > [   34.504751] Code: e0 48 c1 e8 03 42 80 3c 30 00 0f 85 4a 1c 00 00 4d 8b 24 24 4c 39 65 d0 0f 84 0a 04 00 00 49 8d 7c 24 38 48 89 f8 48 c1 e8 03 <42> 0f b6 04 30 84 c0 74 08 3c 04
> > [   34.507060] RSP: 0018:ffff8883af507930 EFLAGS: 00010202
> > [   34.507761] RAX: 0000000000000007 RBX: ffff8883970b2c80 RCX: 1ffff11072e165a6
> > [   34.508640] RDX: 1ffff11075867008 RSI: ffff8883ac338040 RDI: 0000000000000038
> > [   34.509493] RBP: ffff8883af5079d0 R08: ffff8883970b2d40 R09: 0000000000000062
> > [   34.510346] R10: 0000000000000034 R11: 0000000000000000 R12: 0000000000000000
> > [   34.511215] R13: 0000000000000000 R14: dffffc0000000000 R15: ffff8883ac338008
> > [   34.512082] FS:  0000000000000000(0000) GS:ffff8883af500000(0000) knlGS:0000000000000000
> > [   34.513036] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [   34.513741] CR2: 000055ccc3e9d020 CR3: 00000003abf32000 CR4: 00000000000006e0
> > [   34.514593] Call Trace:
> > [   34.514893]  <IRQ>
> > [   34.515157]  napi_gro_receive+0x93/0x150
> > [   34.515632]  receive_buf+0x893/0x3700
> > [   34.516094]  ? __netif_receive_skb+0x1f/0x1a0
> > [   34.516629]  ? virtnet_probe+0x1b40/0x1b40
> > [   34.517153]  ? __stable_node_chain+0x4d0/0x850
> > [   34.517684]  ? kfree+0x9a/0x180
> > [   34.518067]  ? __kasan_slab_free+0x171/0x190
> > [   34.518582]  ? detach_buf+0x1df/0x650
> > [   34.519061]  ? lapic_next_event+0x5a/0x90
> > [   34.519539]  ? virtqueue_get_buf_ctx+0x280/0x7f0
> > [   34.520093]  virtnet_poll+0x2df/0xd60
> > [   34.520533]  ? receive_buf+0x3700/0x3700
> > [   34.521027]  ? qdisc_watchdog_schedule_ns+0xd5/0x140
> > [   34.521631]  ? htb_dequeue+0x1817/0x25f0
> > [   34.522107]  ? sch_direct_xmit+0x142/0xf30
> > [   34.522595]  ? virtqueue_napi_schedule+0x26/0x30
> > [   34.523155]  net_rx_action+0x2f6/0xc50
> > [   34.523601]  ? napi_complete_done+0x2f0/0x2f0
> > [   34.524126]  ? kasan_check_read+0x11/0x20
> > [   34.524608]  ? _raw_spin_lock+0x7d/0xd0
> > [   34.525070]  ? _raw_spin_lock_bh+0xd0/0xd0
> > [   34.525563]  ? kvm_guest_apic_eoi_write+0x6b/0x80
> > [   34.526130]  ? apic_ack_irq+0x9e/0xe0
> > [   34.526567]  __do_softirq+0x188/0x4b5
> > [   34.527015]  irq_exit+0x151/0x180
> > [   34.527417]  do_IRQ+0xdb/0x150
> > [   34.527783]  common_interrupt+0xf/0xf
> > [   34.528223]  </IRQ>
> > 
> > This patch makes sure that skb->prev is set to NULL when entering
> > netem_enqueue.
> > 
> > Cc: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> > Cc: Tyler Hicks <tyhicks@canonical.com>
> > Cc: Eric Dumazet <eric.dumazet@gmail.com>
> > Fixes: 68d2f84a1368 ("net: gro: properly remove skb from list")
> > Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> > Signed-off-by: Christoph Paasch <cpaasch@apple.com>
> > Reviewed-by: Eric Dumazet <edumazet@google.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> I don't think this patch needs to be backported. I haven't hit this panic on
> v4.14.x (although, I only have been using v4.14.79 for now - not yet the
> latest one). And the commits that seem to have introduced the issue haven't
> been backported either AFAICS. That being said, I don't think a backport
> would cause any side-effects.
> 
> Or have you seen reports of this panic in the stable branches?
> 
> (same for the other stable branches v4.4,... - cfr., the other mails
> regarding this patch here)

To clarify: Backport to v4.19.x is needed. The backport to v4.14 and older
should not be needed.


Christoph

> 
> 
> Cheers,
> Christoph
> 
> 
> 
> 
> > ---
> >  net/sched/sch_netem.c |    3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > --- a/net/sched/sch_netem.c
> > +++ b/net/sched/sch_netem.c
> > @@ -436,6 +436,9 @@ static int netem_enqueue(struct sk_buff
> >  	int count = 1;
> >  	int rc = NET_XMIT_SUCCESS;
> >  
> > +	/* Do not fool qdisc_drop_all() */
> > +	skb->prev = NULL;
> > +
> >  	/* Random duplication */
> >  	if (q->duplicate && q->duplicate >= get_crandom(&q->dup_cor))
> >  		++count;
> > 
> > 

  reply	other threads:[~2018-12-14 18:09 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 11:59 [PATCH 4.14 00/89] 4.14.89-stable review Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 01/89] ipv4: ipv6: netfilter: Adjust the frag mem limit when truesize changes Greg Kroah-Hartman
2018-12-15 19:50   ` jwiesner
2018-12-14 11:59 ` [PATCH 4.14 02/89] ipv6: Check available headroom in ip6_xmit() even without options Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 03/89] neighbour: Avoid writing before skb->head in neigh_hh_output() Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 04/89] ipv6: sr: properly initialize flowi6 prior passing to ip6_route_output Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 05/89] net: 8139cp: fix a BUG triggered by changing mtu with network traffic Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 06/89] net/mlx4_core: Correctly set PFC param if global pause is turned off Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 07/89] net/mlx4_en: Change min MTU size to ETH_MIN_MTU Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 08/89] net: phy: dont allow __set_phy_supported to add unsupported modes Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 09/89] net: Prevent invalid access to skb->prev in __qdisc_drop_all Greg Kroah-Hartman
2018-12-14 15:52   ` Christoph Paasch
2018-12-14 15:54     ` Christoph Paasch [this message]
2018-12-14 16:28       ` Eric Dumazet
2018-12-14 19:05     ` David Miller
2018-12-14 19:11       ` Christoph Paasch
2018-12-14 11:59 ` [PATCH 4.14 10/89] rtnetlink: ndo_dflt_fdb_dump() only work for ARPHRD_ETHER devices Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 11/89] sctp: kfree_rcu asoc Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 12/89] tcp: Do not underestimate rwnd_limited Greg Kroah-Hartman
2018-12-14 14:03   ` Sudip Mukherjee
2018-12-14 14:26     ` Greg Kroah-Hartman
     [not found]       ` <CANn89iKnuwQAybYEtXwvRFfQ8Rp8VihO16bVucAjDn1GRBtv9w@mail.gmail.com>
2018-12-14 14:36         ` Greg Kroah-Hartman
2018-12-14 19:03           ` David Miller
2018-12-14 19:07             ` Greg KH
2018-12-14 18:58       ` David Miller
2018-12-14 11:59 ` [PATCH 4.14 13/89] tcp: fix NULL ref in tail loss probe Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 14/89] tun: forbid iface creation with rtnl ops Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 15/89] virtio-net: keep vnet header zeroed after processing XDP Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 16/89] ARM: OMAP2+: prm44xx: Fix section annotation on omap44xx_prm_enable_io_wakeup Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 17/89] ASoC: rsnd: fixup clock start checker Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 18/89] staging: rtl8723bs: Fix the return value in case of error in rtw_wx_read32() Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 19/89] ARM: dts: logicpd-somlv: Fix interrupt on mmc3_dat1 Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 20/89] ARM: OMAP1: ams-delta: Fix possible use of uninitialized field Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 21/89] sysv: return err instead of 0 in __sysv_write_inode Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 22/89] selftests: add script to stress-test nft packet path vs. control plane Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 23/89] netfilter: nf_tables: fix use-after-free when deleting compat expressions Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 24/89] hwmon (ina2xx) Fix NULL id pointer in probe() Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 25/89] ASoC: wm_adsp: Fix dma-unsafe read of scratch registers Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 26/89] s390/cpum_cf: Reject request for sampling in event initialization Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 27/89] hwmon: (ina2xx) Fix current value calculation Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 28/89] ASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 29/89] ASoC: dapm: Recalculate audio map forcely when card instantiated Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 30/89] iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 31/89] netfilter: xt_hashlimit: fix a possible memory leak in htable_create() Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 32/89] hwmon: (w83795) temp4_type has writable permission Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 33/89] perf tools: Restore proper cwd on return from mnt namespace Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 34/89] PCI: imx6: Fix link training status detection in link up check Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 35/89] objtool: Fix double-free in .cold detection error path Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 36/89] objtool: Fix segfault in .cold detection with -ffunction-sections Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 37/89] ARM: dts: at91: sama5d2: use the divided clock for SMC Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 38/89] Btrfs: send, fix infinite loop due to directory rename dependencies Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 39/89] RDMA/mlx5: Fix fence type for IB_WR_LOCAL_INV WR Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 40/89] RDMA/rdmavt: Fix rvt_create_ah function signature Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 41/89] ASoC: omap-mcbsp: Fix latency value calculation for pm_qos Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 42/89] ASoC: omap-mcpdm: Add pm_qos handling to avoid under/overruns with CPU_IDLE Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 43/89] ASoC: omap-dmic: Add pm_qos handling to avoid overruns " Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 44/89] exportfs: do not read dentry after free Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 45/89] bpf: fix check of allowed specifiers in bpf_trace_printk Greg Kroah-Hartman
2018-12-14 11:59 ` [PATCH 4.14 46/89] ipvs: call ip_vs_dst_notifier earlier than ipv6_dev_notf Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 47/89] USB: omap_udc: use devm_request_irq() Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 48/89] USB: omap_udc: fix crashes on probe error and module removal Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 49/89] USB: omap_udc: fix omap_udc_start() on 15xx machines Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 50/89] USB: omap_udc: fix USB gadget functionality on Palm Tungsten E Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 51/89] USB: omap_udc: fix rejection of out transfers when DMA is used Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 52/89] drm/meson: add support for 1080p25 mode Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 53/89] netfilter: ipv6: Preserve link scope traffic original oif Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 54/89] IB/mlx5: Fix page fault handling for MW Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 55/89] KVM: x86: fix empty-body warnings Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 56/89] x86/kvm/vmx: fix old-style function declaration Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 57/89] net: thunderx: fix NULL pointer dereference in nic_remove Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 58/89] usb: gadget: u_ether: fix unsafe list iteration Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 59/89] netfilter: nf_tables: deactivate expressions in rule replecement routine Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 60/89] cachefiles: Fix page leak in cachefiles_read_backing_file while vmscan is active Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 61/89] igb: fix uninitialized variables Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 62/89] ixgbe: recognize 1000BaseLX SFP modules as 1Gbps Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 63/89] net: hisilicon: remove unexpected free_netdev Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 64/89] drm/amdgpu: Add delay after enable RLC ucode Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 65/89] drm/ast: fixed reading monitor EDID not stable issue Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 66/89] xen: xlate_mmu: add missing header to fix W=1 warning Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 67/89] Revert "xen/balloon: Mark unallocated host memory as UNUSABLE" Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 68/89] pstore/ram: Correctly calculate usable PRZ bytes Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 69/89] fscache: fix race between enablement and dropping of object Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 70/89] fscache, cachefiles: remove redundant variable cache Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 71/89] nvme: flush namespace scanning work just before removing namespaces Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 72/89] ACPI/IORT: Fix iort_get_platform_device_domain() uninitialized pointer value Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 73/89] ocfs2: fix deadlock caused by ocfs2_defrag_extent() Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 74/89] mm/page_alloc.c: fix calculation of pgdat->nr_zones Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 75/89] hfs: do not free node before using Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 76/89] hfsplus: " Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 77/89] debugobjects: avoid recursive calls with kmemleak Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 78/89] ocfs2: fix potential use after free Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 79/89] Revert "printk: Never set console_may_schedule in console_trylock()" Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 80/89] printk: Add console owner and waiter logic to load balance console writes Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 81/89] printk: Hide console waiter logic into helpers Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 82/89] printk: Never set console_may_schedule in console_trylock() Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 83/89] printk: Wake klogd when passing console_lock owner Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 84/89] lib/rbtree-test: lower default params Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 85/89] flexfiles: enforce per-mirror stateid only for v4 DSes Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 86/89] staging: speakup: Replace strncpy with memcpy Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 87/89] ALSA: fireface: fix reference to wrong register for clock configuration Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 88/89] ALSA: hda/realtek - Fixed headphone issue for ALC700 Greg Kroah-Hartman
2018-12-14 12:00 ` [PATCH 4.14 89/89] IB/hfi1: Fix an out-of-bounds access in get_hw_stats Greg Kroah-Hartman
2018-12-14 17:33 ` [PATCH 4.14 00/89] 4.14.89-stable review kernelci.org bot
2018-12-14 20:12 ` shuah
2018-12-15  2:07 ` Guenter Roeck
2018-12-15 16:52 ` Dan Rue

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=20181214155435.GK41383@MacBook-Pro-19.local \
    --to=cpaasch@apple.com \
    --cc=bhole_prashant_q7@lab.ntt.co.jp \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tyhicks@canonical.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).