summaryrefslogtreecommitdiffstats
path: root/net/sctp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller2020-07-261-9/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UDP reuseport conflict was a little bit tricky. The net-next code, via bpf-next, extracted the reuseport handling into a helper so that the BPF sk lookup code could invoke it. At the same time, the logic for reuseport handling of unconnected sockets changed via commit efc6b6f6c3113e8b203b9debfb72d81e0f3dcace which changed the logic to carry on the reuseport result into the rest of the lookup loop if we do not return immediately. This requires moving the reuseport_has_conns() logic into the callers. While we are here, get rid of inline directives as they do not belong in foo.c files. The other changes were cases of more straightforward overlapping modifications. Signed-off-by: David S. Miller <davem@davemloft.net>
| * sctp: shrink stream outq when fails to do addstream reconfXin Long2020-07-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding a stream with stream reconf, the new stream firstly is in CLOSED state but new out chunks can still be enqueued. Then once gets the confirmation from the peer, the state will change to OPEN. However, if the peer denies, it needs to roll back the stream. But when doing that, it only sets the stream outcnt back, and the chunks already in the new stream don't get purged. It caused these chunks can still be dequeued in sctp_outq_dequeue_data(). As its stream is still in CLOSE, the chunk will be enqueued to the head again by sctp_outq_head_data(). This chunk will never be sent out, and the chunks after it can never be dequeued. The assoc will be 'hung' in a dead loop of sending this chunk. To fix it, this patch is to purge these chunks already in the new stream by calling sctp_stream_shrink_out() when failing to do the addstream reconf. Fixes: 11ae76e67a17 ("sctp: implement receiver-side procedures for the Reconf Response Parameter") Reported-by: Ying Xu <yinxu@redhat.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * sctp: shrink stream outq only when new outcnt < old outcntXin Long2020-07-231-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | It's not necessary to go list_for_each for outq->out_chunk_list when new outcnt >= old outcnt, as no chunk with higher sid than new (outcnt - 1) exists in the outqueue. While at it, also move the list_for_each code in a new function sctp_stream_shrink_out(), which will be used in the next patch. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: remove redundant initialization of variable statusColin Ian King2020-07-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | The variable status is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Also put the variable declarations into reverse christmas tree order. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: fix slab-out-of-bounds in SCTP_DELAYED_SACK processingChristoph Hellwig2020-07-251-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This sockopt accepts two kinds of parameters, using struct sctp_sack_info and struct sctp_assoc_value. The mentioned commit didn't notice an implicit cast from the smaller (latter) struct to the bigger one (former) when copying the data from the user space, which now leads to an attempt to write beyond the buffer (because it assumes the storing buffer is bigger than the parameter itself). Fix it by allocating a sctp_sack_info on stack and filling it out based on the small struct for the compat case. Changelog stole from an earlier patch from Marcelo Ricardo Leitner. Fixes: ebb25defdc17 ("sctp: pass a kernel pointer to sctp_setsockopt_delayed_ack") Reported-by: syzbot+0e4699d000d8b874d8dc@syzkaller.appspotmail.com Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: pass a sockptr_t into ->setsockoptChristoph Hellwig2020-07-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | Rework the remaining setsockopt code to pass a sockptr_t instead of a plain user pointer. This removes the last remaining set_fs(KERNEL_DS) outside of architecture specific code. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org> [ieee802154] Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: remove the out_nounlock label in sctp_setsockoptChristoph Hellwig2020-07-201-4/+2
| | | | | | | | | | | | | | | | | | This is just used once, and a direct return for the redirect to the AF case is much easier to follow than jumping to the end of a very long function. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_pf_exposeChristoph Hellwig2020-07-201-14/+8
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_ecn_supportedChristoph Hellwig2020-07-201-12/+6
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_auth_supportedChristoph Hellwig2020-07-201-13/+7
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_eventChristoph Hellwig2020-07-201-12/+6
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_eventChristoph Hellwig2020-07-201-20/+15
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_reuse_portChristoph Hellwig2020-07-201-8/+3
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_interleaving_supportedChristoph Hellwig2020-07-201-24/+10
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_scheduler_valueChristoph Hellwig2020-07-201-16/+10
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_schedulerChristoph Hellwig2020-07-201-19/+14
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_add_streamsChristoph Hellwig2020-07-201-17/+7
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_reset_assocChristoph Hellwig2020-07-201-18/+7
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_reset_streamsChristoph Hellwig2020-07-201-15/+5
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_enable_strresetChristoph Hellwig2020-07-201-20/+14
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_reconfig_supportedChristoph Hellwig2020-07-201-12/+6
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_default_prinfoChristoph Hellwig2020-07-201-25/+20
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_pr_supportedChristoph Hellwig2020-07-201-10/+6
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_recvnxtinfoChristoph Hellwig2020-07-201-8/+3
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_recvrcvinfoChristoph Hellwig2020-07-201-8/+3
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_paddr_thresholdsChristoph Hellwig2020-07-201-29/+26
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_auto_asconfChristoph Hellwig2020-07-201-9/+6
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_deactivate_keyChristoph Hellwig2020-07-201-15/+13
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_del_keyChristoph Hellwig2020-07-201-15/+12
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_active_keyChristoph Hellwig2020-07-201-15/+12
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_auth_keyChristoph Hellwig2020-07-201-8/+2
| | | | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Adapt sctp_setsockopt to use a kzfree for this case. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: switch sctp_setsockopt_auth_key to use memzero_explicitChristoph Hellwig2020-07-201-1/+2
| | | | | | | | | | | | | | | | Switch from kzfree to sctp_setsockopt_auth_key + kfree to prepare for moving the kfree to common code. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_hmac_identChristoph Hellwig2020-07-201-16/+5
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_auth_chunkChristoph Hellwig2020-07-201-7/+4
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_maxburstChristoph Hellwig2020-07-201-19/+16
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_fragment_interleaveChristoph Hellwig2020-07-201-8/+3
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_contextChristoph Hellwig2020-07-201-15/+13
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_adaptation_layerChristoph Hellwig2020-07-201-7/+4
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_maxsegChristoph Hellwig2020-07-201-11/+11
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_mappedv4Christoph Hellwig2020-07-201-6/+4
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_associnfoChristoph Hellwig2020-07-201-16/+16
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_rtoinfoChristoph Hellwig2020-07-201-14/+12
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_nodelayChristoph Hellwig2020-07-201-8/+3
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_peer_primary_addrChristoph Hellwig2020-07-201-12/+9
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_primary_addrChristoph Hellwig2020-07-201-9/+5
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_default_sndinfoChristoph Hellwig2020-07-201-26/+23
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_default_send_paramChristoph Hellwig2020-07-201-30/+26
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_initmsgChristoph Hellwig2020-07-201-13/+11
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_partial_delivery_pointChristoph Hellwig2020-07-201-9/+4
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sctp: pass a kernel pointer to sctp_setsockopt_delayed_ackChristoph Hellwig2020-07-201-27/+22
| | | | | | | | | | | | | | | | Use the kernel pointer that sctp_setsockopt has available instead of directly handling the user pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>