No description
Find a file
Xin Long a5d0034533 sctp: avoid running the sctp state machine recursively
[ Upstream commit fbd019737d ]

Ying triggered a call trace when doing an asconf testing:

  BUG: scheduling while atomic: swapper/12/0/0x10000100
  Call Trace:
   <IRQ>  [<ffffffffa4375904>] dump_stack+0x19/0x1b
   [<ffffffffa436fcaf>] __schedule_bug+0x64/0x72
   [<ffffffffa437b93a>] __schedule+0x9ba/0xa00
   [<ffffffffa3cd5326>] __cond_resched+0x26/0x30
   [<ffffffffa437bc4a>] _cond_resched+0x3a/0x50
   [<ffffffffa3e22be8>] kmem_cache_alloc_node+0x38/0x200
   [<ffffffffa423512d>] __alloc_skb+0x5d/0x2d0
   [<ffffffffc0995320>] sctp_packet_transmit+0x610/0xa20 [sctp]
   [<ffffffffc098510e>] sctp_outq_flush+0x2ce/0xc00 [sctp]
   [<ffffffffc098646c>] sctp_outq_uncork+0x1c/0x20 [sctp]
   [<ffffffffc0977338>] sctp_cmd_interpreter.isra.22+0xc8/0x1460 [sctp]
   [<ffffffffc0976ad1>] sctp_do_sm+0xe1/0x350 [sctp]
   [<ffffffffc099443d>] sctp_primitive_ASCONF+0x3d/0x50 [sctp]
   [<ffffffffc0977384>] sctp_cmd_interpreter.isra.22+0x114/0x1460 [sctp]
   [<ffffffffc0976ad1>] sctp_do_sm+0xe1/0x350 [sctp]
   [<ffffffffc097b3a4>] sctp_assoc_bh_rcv+0xf4/0x1b0 [sctp]
   [<ffffffffc09840f1>] sctp_inq_push+0x51/0x70 [sctp]
   [<ffffffffc099732b>] sctp_rcv+0xa8b/0xbd0 [sctp]

As it shows, the first sctp_do_sm() running under atomic context (NET_RX
softirq) invoked sctp_primitive_ASCONF() that uses GFP_KERNEL flag later,
and this flag is supposed to be used in non-atomic context only. Besides,
sctp_do_sm() was called recursively, which is not expected.

Vlad tried to fix this recursive call in Commit c078669340 ("sctp: Fix
oops when sending queued ASCONF chunks") by introducing a new command
SCTP_CMD_SEND_NEXT_ASCONF. But it didn't work as this command is still
used in the first sctp_do_sm() call, and sctp_primitive_ASCONF() will
be called in this command again.

To avoid calling sctp_do_sm() recursively, we send the next queued ASCONF
not by sctp_primitive_ASCONF(), but by sctp_sf_do_prm_asconf() in the 1st
sctp_do_sm() directly.

Reported-by: Ying Xu <yinxu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-08 07:20:44 +02:00
arch ARM: dts: imx6qdl: Fix typo in imx6qdl-icore-rqs.dtsi 2019-05-04 09:15:20 +02:00
block
certs
crypto
Documentation Documentation: Add nospectre_v1 parameter 2019-05-02 09:40:34 +02:00
drivers leds: pca9532: fix a potential NULL pointer dereference 2019-05-04 09:15:22 +02:00
firmware
fs ceph: fix use-after-free on symlink traversal 2019-05-04 09:15:22 +02:00
include sctp: avoid running the sctp state machine recursively 2019-05-08 07:20:44 +02:00
init
ipc
kernel ptrace: take into account saved_sigmask in PTRACE{GET,SET}SIGMASK 2019-05-04 09:15:22 +02:00
lib lib/Kconfig.debug: fix build error without CONFIG_BLOCK 2019-05-02 09:40:28 +02:00
mm mm: prevent get_user_pages() from overflowing page refcount 2019-05-04 09:15:17 +02:00
net sctp: avoid running the sctp state machine recursively 2019-05-08 07:20:44 +02:00
samples
scripts kconfig/[mn]conf: handle backspace (^H) key 2019-05-04 09:15:22 +02:00
security selinux: use kernel linux/socket.h for genheaders and mdp 2019-05-04 09:15:17 +02:00
sound ALSA: line6: use dynamic buffers 2019-05-08 07:20:43 +02:00
tools tools include: Adopt linux/bits.h 2019-04-27 09:35:41 +02:00
usr
virt KVM: arm/arm64: vgic-its: Take the srcu lock when parsing the memslots 2019-05-04 09:15:19 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 4.14.116 2019-05-04 09:15:23 +02:00
README

Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.