WSL2-Linux-Kernel/drivers
Guillaume Nault 090da7ced8 ppp: avoid loop in xmit recursion detection code
[ Upstream commit 6d066734e9 ]

We already detect situations where a PPP channel sends packets back to
its upper PPP device. While this is enough to avoid deadlocking on xmit
locks, this doesn't prevent packets from looping between the channel
and the unit.

The problem is that ppp_start_xmit() enqueues packets in ppp->file.xq
before checking for xmit recursion. Therefore, __ppp_xmit_process()
might dequeue a packet from ppp->file.xq and send it on the channel
which, in turn, loops it back on the unit. Then ppp_start_xmit()
queues the packet back to ppp->file.xq and __ppp_xmit_process() picks
it up and sends it again through the channel. Therefore, the packet
will loop between __ppp_xmit_process() and ppp_start_xmit() until some
other part of the xmit path drops it.

For L2TP, we rapidly fill the skb's headroom and pppol2tp_xmit() drops
the packet after a few iterations. But PPTP reallocates the headroom
if necessary, letting the loop run and exhaust the machine resources
(as reported in https://bugzilla.kernel.org/show_bug.cgi?id=199109).

Fix this by letting __ppp_xmit_process() enqueue the skb to
ppp->file.xq, so that we can check for recursion before adding it to
the queue. Now ppp_xmit_process() can drop the packet when recursion is
detected.

__ppp_channel_push() is a bit special. It calls __ppp_xmit_process()
without having any actual packet to send. This is used by
ppp_output_wakeup() to re-enable transmission on the parent unit (for
implementations like ppp_async.c, where the .start_xmit() function
might not consume the skb, leaving it in ppp->xmit_pending and
disabling transmission).
Therefore, __ppp_xmit_process() needs to handle the case where skb is
NULL, dequeuing as many packets as possible from ppp->file.xq.

Reported-by: xu heng <xuheng333@zoho.com>
Fixes: 55454a5658 ("ppp: avoid dealock on recursive xmit")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-31 18:10:40 +02:00
..
accessibility License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
acpi ACPI / watchdog: Fix off-by-one error at resource assignment 2018-03-28 18:24:41 +02:00
amba License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
android binder: replace "%p" with "%pK" 2018-02-25 11:07:52 +01:00
ata libata: Modify quirks for MX100 to limit NCQ_TRIM quirk to MU01 version 2018-03-28 18:24:37 +02:00
atm atm: horizon: Fix irq release error 2017-12-14 09:53:13 +01:00
auxdisplay auxdisplay: img-ascii-lcd: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE 2018-02-07 11:12:20 -08:00
base dma-buf/fence: Fix lock inversion within dma-fence-array 2018-03-19 08:42:47 +01:00
bcma License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
block loop: Fix lost writes caused by missing flag 2018-03-15 10:54:32 +01:00
bluetooth Bluetooth: btusb: Fix quirk for Atheros 1525/QCA6174 2018-03-28 18:24:35 +02:00
bus sunxi-rsb: Include OF based modalias in device uevent 2018-01-10 09:31:19 +01:00
cdrom License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
char /dev/mem: Add bounce buffer for copy-out 2018-03-24 11:01:24 +01:00
clk clk: sunxi-ng: a31: Fix CLK_OUT_* clock ops 2018-03-28 18:24:33 +02:00
clocksource clocksource/drivers/stm32: Fix kernel panic with multiple timers 2018-02-16 20:23:09 +01:00
connector
cpufreq cpufreq: longhaul: Revert transition_delay_us to 200 ms 2018-03-24 11:01:21 +01:00
cpuidle cpuidle: fix broadcast control when broadcast can not be entered 2017-12-25 14:26:30 +01:00
crypto crypto: artpec6 - set correct iv size for gcm(aes) 2018-03-24 11:01:28 +01:00
dax dev/dax: fix uninitialized variable build warning 2017-12-20 10:10:34 +01:00
dca
devfreq PM / devfreq: Propagate error from devfreq_add_device() 2018-02-22 15:42:16 +01:00
dio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma dmaengine: ti-dma-crossbar: Fix event mapping for TPCC_EVT_MUX_60_63 2018-03-24 11:01:28 +01:00
dma-buf dma-buf/fence: Fix lock inversion within dma-fence-array 2018-03-19 08:42:47 +01:00
edac EDAC, sb_edac: Fix out of bound writes during DIMM configuration on KNL 2018-03-08 22:41:20 -08:00
eisa License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
extcon extcon: int3496: process id-pin first so that we start with the right status 2018-02-28 10:19:39 +01:00
firewire License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
firmware firmware/psci: Expose SMCCC version through psci_ops 2018-02-16 20:22:56 +01:00
fmc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fpga fpga: region: release of_parse_phandle nodes after use 2018-02-07 11:12:26 -08:00
fsi
gpio gpio: davinci: Assign first bank regs for unbanked case 2018-02-25 11:07:56 +01:00
gpu drm/syncobj: Stop reusing the same struct file for all syncobj -> fd 2018-03-28 18:24:47 +02:00
hid HID: elo: clear BTN_LEFT mapping 2018-03-19 08:42:47 +01:00
hsi License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv Drivers: hv: vmbus: Fix ring buffer signaling 2018-03-28 18:24:34 +02:00
hwmon x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:42:24 +01:00
hwspinlock License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hwtracing coresight: Fix disabling of CoreSight TPIU 2018-03-24 11:01:26 +01:00
i2c i2c: bcm2835: Set up the rising/falling edge delays 2018-02-28 10:19:39 +01:00
ide ide: ide-atapi: fix compile error with defining macro DEBUG 2017-12-17 15:08:00 +01:00
idle Revert "x86/mm: Stop calling leave_mm() in idle code" 2017-11-04 15:01:50 +01:00
iio iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot() 2018-03-28 18:24:49 +02:00
infiniband RDMA/mlx5: Fix crash while accessing garbage pointer and freed memory 2018-03-28 18:24:33 +02:00
input Input: matrix_keypad - fix race when disabling interrupts 2018-03-15 10:54:32 +01:00
iommu iommu/vt-d: clean up pr_irq if request_threaded_irq fails 2018-03-24 11:01:26 +01:00
ipack
irqchip irqchip/gic-v3-its: Ensure nr_ites >= nr_lpis 2018-03-21 12:06:44 +01:00
isdn License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
leds leds: pm8058: Silence pointer to integer size warning 2018-03-19 08:42:50 +01:00
lightnvm lightnvm: pblk: protect line bitmap while submitting meta io 2017-12-20 10:10:38 +01:00
macintosh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mailbox mailbox: mailbox-test: don't rely on rx_buffer content to signal data ready 2017-12-14 09:53:12 +01:00
mcb License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
md dm raid: fix raid set size revalidation 2018-03-19 08:42:54 +01:00
media media: davinci: fix a debug printk 2018-03-24 11:01:26 +01:00
memory License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memstick License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
message License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mfd mfd: twl6040: Fix child-node lookup 2017-12-29 17:53:46 +01:00
misc mei: me: add cannon point device ids for 4th device 2018-02-25 11:08:04 +01:00
mmc mmc: dw_mmc: fix falling from idmac to PIO mode when dw_mci_reset occurs 2018-03-28 18:24:32 +02:00
mtd mtd: nand: fsl_ifc: Read ECCSTAT0 and ECCSTAT1 registers for IFC 2.0 2018-03-28 18:24:43 +02:00
mux mux: core: fix double get_device() 2018-01-17 09:45:27 +01:00
net ppp: avoid loop in xmit recursion detection code 2018-03-31 18:10:40 +02:00
nfc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ntb
nubus License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nvdimm libnvdimm, {btt, blk}: do integrity setup before add_disk() 2018-03-28 18:24:41 +02:00
nvme nvme-rdma: don't suppress send completions 2018-03-08 22:41:26 -08:00
nvmem License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
of of_mdio: avoid MDIO bus removal when a PHY is missing 2018-03-03 10:24:37 +01:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
parisc parisc: Hide Diva-built-in serial aux and graphics card 2017-12-29 17:53:47 +01:00
parport License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci PCI: Add function 1 DMA alias quirk for Highpoint RocketRAID 644L 2018-03-28 18:24:32 +02:00
pcmcia License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
phy phy: cpcap-usb: Fix platform_get_irq_byname's error checking. 2018-03-03 10:24:22 +01:00
pinctrl pinctrl: samsung: Validate alias coming from DT 2018-03-28 18:24:34 +02:00
platform platform/chrome: Use proper protocol transfer function 2018-03-24 11:01:23 +01:00
pnp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
power power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_registers()' 2018-03-19 08:42:50 +01:00
powercap
pps drivers/pps: use surrounding "if PPS" to remove numerous dependency checks 2017-09-08 18:26:51 -07:00
ps3
ptp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pwm pwm: stmpe: Fix wrong register offset for hwpwm=2 case 2018-03-19 08:42:51 +01:00
rapidio drivers/rapidio/devices/rio_mport_cdev.c: fix resource leak in error handling path in 'rio_dma_transfer()' 2017-12-14 09:53:08 +01:00
ras License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
regulator regulator: stm32-vrefbuf: fix check on ready flag 2018-03-15 10:54:28 +01:00
remoteproc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
reset License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rpmsg rpmsg: glink: Initialize the "intent_req_comp" completion variable 2017-12-20 10:10:29 +01:00
rtc rtc: ac100: Fix multiple race conditions 2018-03-24 11:01:24 +01:00
s390 s390/qeth: fix IPA command submission race 2018-03-08 22:41:20 -08:00
sbus License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
scsi scsi: mpt3sas: wait for and flush running commands on shutdown/unload 2018-03-24 11:01:28 +01:00
sfi
sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sn
soc soc: qcom: smsm: fix child-node lookup 2018-03-24 11:01:27 +01:00
spi spi: sh-msiof: Avoid writing to registers from spi_master.setup() 2018-03-24 11:01:22 +01:00
spmi
ssb License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
staging staging: lustre: ptlrpc: kfree used instead of kvfree 2018-03-28 18:24:49 +02:00
target iscsi-target: make sure to wake up sleeping login worker 2018-02-22 15:42:29 +01:00
tc
tee optee: fix invalid of_node_put() in optee_driver_init() 2017-12-25 14:26:24 +01:00
thermal thermal/drivers/hisi: Fix multiple alarm interrupts firing 2017-12-25 14:26:31 +01:00
thunderbolt thunderbolt: tb: fix use after free in tb_activate_pcie_devices 2017-12-20 10:10:24 +01:00
tty tty: vt: fix up tabstops properly 2018-03-28 18:24:45 +02:00
uio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
usb usb: xhci: Fix potential memory leak in xhci_disable_slot() 2018-03-28 18:24:50 +02:00
uwb License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vfio vfio: disable filesystem-dax page pinning 2018-03-08 22:41:06 -08:00
vhost vhost: use mutex_lock_nested() in vhost_dev_lock_vqs() 2018-02-25 11:07:45 +01:00
video omapdrm: panel: fix compatible vendor string for td028ttec1 2018-03-24 11:01:25 +01:00
virt
virtio virtio_ring: fix num_free handling in error case 2018-03-15 10:54:32 +01:00
vlynq
vme License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
w1 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
watchdog ACPI / watchdog: Fix off-by-one error at resource assignment 2018-03-28 18:24:41 +02:00
xen xen/gntdev: Fix partial gntdev_mmap() cleanup 2018-03-03 10:24:37 +01:00
zorro License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile usb: build drivers/usb/common/ when USB_SUPPORT is set 2018-02-25 11:07:53 +01:00