Re: [PATCH] net: Get rid of consume_skb when tracing is off

2020-08-24 Thread Neil Horman
On Sat, Aug 22, 2020 at 12:49:02PM -0700, David Miller wrote: > > From: Neil Horman > > Neil, you might want to fix this so people can reply to you :-) Crap, thanks, new computer. Neil >

Re: [PATCH] net: Get rid of consume_skb when tracing is off

2020-08-22 Thread Neil Horman
On Sat, Aug 22, 2020 at 08:23:29AM +1000, Herbert Xu wrote: > The function consume_skb is only meaningful when tracing is enabled. > This patch makes it conditional on CONFIG_TRACEPOINTS. > > Signed-off-by: Herbert Xu > > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h > index 46881

Re: [PATCHv2 net-next] dropwatch: Support monitoring of dropped frames

2020-08-05 Thread Neil Horman
On Tue, Aug 04, 2020 at 04:14:14PM -0700, David Miller wrote: > From: izabela.bakoll...@gmail.com > Date: Tue, 4 Aug 2020 18:09:08 +0200 > > > @@ -1315,6 +1334,53 @@ static int net_dm_cmd_trace(struct sk_buff *skb, > > return -EOPNOTSUPP; > > } > > > > +static int net_dm_interface_start(st

Re: [Linux-kernel-mentees] [PATCHv2 net-next] dropwatch: Support monitoring of dropped frames

2020-08-04 Thread Neil Horman
On Tue, Aug 04, 2020 at 02:28:28PM -0700, Cong Wang wrote: > On Tue, Aug 4, 2020 at 9:14 AM wrote: > > > > From: Izabela Bakollari > > > > Dropwatch is a utility that monitors dropped frames by having userspace > > record them over the dropwatch protocol over a file. This augument > > allows live

Re: [PATCH] sctp: Fix sk_buff leak when receiving a datagram

2020-06-13 Thread Neil Horman
On Sat, Jun 13, 2020 at 08:39:25PM +0800, Xiyu Yang wrote: > In sctp_skb_recv_datagram(), the function fetch a sk_buff object from > the receiving queue to "skb" by calling skb_peek() or __skb_dequeue() > and return its reference to the caller. > > However, when calling __skb_dequeue() successfull

Re: ABI breakage in sctp_event_subscribe (was [PATCH net-next 0/4] sctp: add some missing events from rfc5061)

2020-06-01 Thread Neil Horman
On Sun, Apr 19, 2020 at 12:25:36PM +0200, Harald Welte wrote: > Dear Linux SCTP developers, > > this patchset (merged back in Q4/2019) has broken ABI compatibility, more > or less exactly as it was discussed/predicted in Message-Id > <20190206201430.18830-1-jul...@arista.com> > "[PATCH net] sctp:

[PATCH] sctp: Don't add the shutdown timer if its already been added

2020-05-19 Thread Neil Horman
e has only occured in production environments where test kernels are enjoined from being installed. It appears to be a sane fix to me though. Also, recentely, Jere found a reproducer posted on list to confirm that this resolves the issues Signed-off-by: Neil Horman CC: Vlad Yasevich CC: "

Re: [PATCH 07/15] drop_monitor: work around gcc-10 stringop-overflow warning

2020-05-01 Thread Neil Horman
gt; *location) >*/ > __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point)); > nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point)); > - memcpy(msg->points[msg->entries].pc, &location, sizeof(void *)); > - msg->points[msg->entries].count = 1; > + memcpy(point->pc, &location, sizeof(void *)); > + point->count = 1; > msg->entries++; > > if (!timer_pending(&data->send_timer)) { Acked-by: Neil Horman

Re: [PATCHv3 net-next 0/5] sctp: update from rfc7829

2019-10-14 Thread Neil Horman
tl.c | 19 ++ > 9 files changed, 226 insertions(+), 34 deletions(-) > > -- > 2.1.0 > > Series Acked-by: Neil Horman

Re: [PATCHv2 net-next 3/5] sctp: add SCTP_EXPOSE_POTENTIALLY_FAILED_STATE sockopt

2019-10-14 Thread Neil Horman
On Mon, Oct 14, 2019 at 04:36:34PM +0800, Xin Long wrote: > On Thu, Oct 10, 2019 at 12:18 AM Neil Horman wrote: > > > > On Tue, Oct 08, 2019 at 11:28:32PM +0800, Xin Long wrote: > > > On Tue, Oct 8, 2019 at 9:02 PM David Laight > > > wrote: > > > &

Re: [PATCHv2 net-next 3/5] sctp: add SCTP_EXPOSE_POTENTIALLY_FAILED_STATE sockopt

2019-10-11 Thread Neil Horman
On Sat, Oct 12, 2019 at 12:25:27AM +0800, Xin Long wrote: > On Fri, Oct 11, 2019 at 11:57 PM Xin Long wrote: > > > > On Thu, Oct 10, 2019 at 8:40 PM Neil Horman wrote: > > > > > > On Thu, Oct 10, 2019 at 05:28:34PM +0800, Xin Long wrote: > > > >

Re: [PATCHv2 net-next 3/5] sctp: add SCTP_EXPOSE_POTENTIALLY_FAILED_STATE sockopt

2019-10-10 Thread Neil Horman
On Thu, Oct 10, 2019 at 05:28:34PM +0800, Xin Long wrote: > On Thu, Oct 10, 2019 at 12:18 AM Neil Horman wrote: > > > > On Tue, Oct 08, 2019 at 11:28:32PM +0800, Xin Long wrote: > > > On Tue, Oct 8, 2019 at 9:02 PM David Laight > > > wrote: > > > &

Re: [PATCH net-next 0/4] sctp: add some missing events from rfc5061

2019-10-09 Thread Neil Horman
| 22 +++-- > net/sctp/chunk.c| 40 +++ > net/sctp/ulpevent.c | 57 > - > 5 files changed, 108 insertions(+), 43 deletions(-) > > -- > 2.1.0 > > Series Acked-by: Neil Horman

Re: [PATCHv2 net-next 3/5] sctp: add SCTP_EXPOSE_POTENTIALLY_FAILED_STATE sockopt

2019-10-09 Thread Neil Horman
On Tue, Oct 08, 2019 at 11:28:32PM +0800, Xin Long wrote: > On Tue, Oct 8, 2019 at 9:02 PM David Laight wrote: > > > > From: Xin Long > > > Sent: 08 October 2019 12:25 > > > > > > This is a sockopt defined in section 7.3 of rfc7829: "Exposing > > > the Potentially Failed Path State", by which user

Re: [PATCH net] sctp: add chunks to sk_backlog when the newsk sk_socket is not set

2019-10-09 Thread Neil Horman
backloged) > return 0; > } else { > - sctp_inq_push(inqueue, chunk); > + if (!sctp_newsk_ready(sk)) { > + if (!sk_add_backlog(sk, skb, sk->sk_rcvbuf)) > + return 0; > + sctp_chunk_free(chunk); > + } else { > + sctp_inq_push(inqueue, chunk); > + } > } > > done: > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net] sctp: set newsk sk_socket before processing listening sk backlog

2019-10-02 Thread Neil Horman
On Wed, Oct 02, 2019 at 04:23:52PM +0800, Xin Long wrote: > On Wed, Oct 2, 2019 at 9:04 AM Marcelo Ricardo Leitner > wrote: > > > > On Mon, Sep 30, 2019 at 09:10:18PM +0800, Xin Long wrote: > > > This patch is to fix a NULL-ptr deref crash in selinux_sctp_bind_connect: > > > > > > [...] kasan: G

Re: [PATCH net] sctp: fix the missing put_user when dumping transport thresholds

2019-09-10 Thread Neil Horman
if (put_user(len, optlen) || copy_to_user(optval, &val, len)) > return -EFAULT; > > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net] sctp: use transport pf_retrans in sctp_do_8_2_transport_strike

2019-09-03 Thread Neil Horman
transport->pathmaxrxt) && > -(transport->error_count > asoc->pf_retrans)) { > +(transport->error_count > transport->pf_retrans)) { > > sctp_assoc_control_transport(asoc, transport, >SCTP_TRANSPORT_PF, > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net-next 0/3] sctp: add SCTP_ECN_SUPPORTED sockopt

2019-08-26 Thread Neil Horman
3 ++ > net/sctp/sm_make_chunk.c | 16 +++--- > net/sctp/socket.c | 73 > ++ > net/sctp/sysctl.c | 7 + > 8 files changed, 102 insertions(+), 5 deletions(-) > > -- > 2.1.0 > > Series Acked-by: Neil Horman

Re: [PATCH net-next] drop_monitor: Make timestamps y2038 safe

2019-08-23 Thread Neil Horman
e; > } > > - if (ktime_to_timespec_cond(skb->tstamp, &ts) && > - nla_put(msg, NET_DM_ATTR_TIMESTAMP, sizeof(ts), &ts)) > + if (nla_put_u64_64bit(msg, NET_DM_ATTR_TIMESTAMP, > + ktime_to_ns(skb->tstamp), NET_DM_ATTR_PAD)) > goto nla_put_failure; > > if (nla_put_u32(msg, NET_DM_ATTR_ORIG_LEN, skb->len)) > -- > 2.21.0 > > Acked-by: Neil Horman

Re: [PATCH] sctp: fix memleak in sctp_send_reset_streams

2019-08-13 Thread Neil Horman
association *asoc, > nstr_list[i] = htons(str_list[i]); > > if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) { > + kfree(nstr_list); > retval = -EAGAIN; > goto out; > } > -- > 2.7.4 > > Acked-by: Neil Horman

Re: [PATCH] net: sctp: Rename fallthrough label to unhandled

2019-07-31 Thread Neil Horman
On Wed, Jul 31, 2019 at 04:32:43AM -0700, Joe Perches wrote: > On Wed, 2019-07-31 at 07:19 -0400, Neil Horman wrote: > > On Tue, Jul 30, 2019 at 10:04:37PM -0700, Joe Perches wrote: > > > fallthrough may become a pseudo reserved keyword so this only use of > > > fallt

Re: [PATCH net] drop_monitor: Add missing uAPI file to MAINTAINERS file

2019-07-31 Thread Neil Horman
> +F: include/uapi/linux/net_dropmon.h > > NETWORKING DRIVERS > M: "David S. Miller" > -- > 2.21.0 > > Acked-by: Neil Horman

Re: [PATCH net-next 1/4] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-24 Thread Neil Horman
On Wed, Jul 24, 2019 at 04:12:43PM -0300, Marcelo Ricardo Leitner wrote: > On Wed, Jul 24, 2019 at 04:05:43PM -0300, Marcelo Ricardo Leitner wrote: > > On Wed, Jul 24, 2019 at 02:44:56PM -0400, Neil Horman wrote: > > > On Wed, Jul 24, 2019 at 09:49:07AM -0300, Marcelo Ric

Re: [PATCH net-next 1/4] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-24 Thread Neil Horman
On Wed, Jul 24, 2019 at 04:05:43PM -0300, Marcelo Ricardo Leitner wrote: > On Wed, Jul 24, 2019 at 02:44:56PM -0400, Neil Horman wrote: > > On Wed, Jul 24, 2019 at 09:49:07AM -0300, Marcelo Ricardo Leitner wrote: > > > On Wed, Jul 24, 2019 at 09:36:50AM -0300, Marcelo Ric

Re: [PATCH net-next 0/4] sctp: clean up __sctp_connect function

2019-07-24 Thread Neil Horman
On Wed, Jul 24, 2019 at 11:25:12AM -0300, Marcelo Ricardo Leitner wrote: > On Tue, Jul 23, 2019 at 01:37:56AM +0800, Xin Long wrote: > > This patchset is to factor out some common code for > > sctp_sendmsg_new_asoc() and __sctp_connect() into 2 > > new functioins. > > > > Xin Long (4): > > sctp:

Re: [PATCH net-next 1/4] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-24 Thread Neil Horman
On Wed, Jul 24, 2019 at 09:49:07AM -0300, Marcelo Ricardo Leitner wrote: > On Wed, Jul 24, 2019 at 09:36:50AM -0300, Marcelo Ricardo Leitner wrote: > > On Wed, Jul 24, 2019 at 07:22:35AM -0400, Neil Horman wrote: > > > On Wed, Jul 24, 2019 at 03:21:12PM +0800, Xin Long wrote: &

Re: [PATCH net-next 1/4] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-24 Thread Neil Horman
On Wed, Jul 24, 2019 at 03:21:12PM +0800, Xin Long wrote: > On Tue, Jul 23, 2019 at 11:25 PM Neil Horman wrote: > > > > On Tue, Jul 23, 2019 at 01:37:57AM +0800, Xin Long wrote: > > > Now __sctp_connect() is called by __sctp_setsockopt_connectx() and > > > sctp_in

Re: [PATCH net-next 1/4] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-23 Thread Neil Horman
On Tue, Jul 23, 2019 at 01:37:57AM +0800, Xin Long wrote: > Now __sctp_connect() is called by __sctp_setsockopt_connectx() and > sctp_inet_connect(), the latter has done addr_size check with size > of sa_family_t. > > In the next patch to clean up __sctp_connect(), we will remove > addr_size check

Re: [RFC PATCH net-next 10/12] drop_monitor: Add packet alert mode

2019-07-23 Thread Neil Horman
On Tue, Jul 23, 2019 at 05:16:25PM +0300, Ido Schimmel wrote: > On Tue, Jul 23, 2019 at 08:43:40AM -0400, Neil Horman wrote: > > On Mon, Jul 22, 2019 at 09:31:32PM +0300, Ido Schimmel wrote: > > > +static void net_dm_packet_work(struct work_struct *work) > > > +{ >

Re: [RFC PATCH net-next 10/12] drop_monitor: Add packet alert mode

2019-07-23 Thread Neil Horman
On Mon, Jul 22, 2019 at 09:31:32PM +0300, Ido Schimmel wrote: > From: Ido Schimmel > > So far drop monitor supported only one alert mode in which a summary of > locations in which packets were recently dropped was sent to user space. > > This alert mode is sufficient in order to understand that

Re: OOM triggered by SCTP

2019-07-16 Thread Neil Horman
On Tue, Jul 16, 2019 at 11:47:40PM +0200, Marek Majkowski wrote: > Morning, > > My poor man's fuzzer found something interesting in SCTP. It seems > like creating large number of SCTP sockets + some magic dance, upsets > a memory subsystem related to SCTP. The sequence: > > - create SCTP socket

Re: [PATCH net-next 00/11] Add drop monitor for offloaded data paths

2019-07-14 Thread Neil Horman
On Fri, Jul 12, 2019 at 04:52:30PM +0300, Ido Schimmel wrote: > On Thu, Jul 11, 2019 at 07:53:54PM -0400, Neil Horman wrote: > > A few things here: > > IIRC we don't announce individual hardware drops, drivers record them in > > internal structures, and they are retri

Re: [PATCH net-next 00/11] Add drop monitor for offloaded data paths

2019-07-12 Thread Neil Horman
On Fri, Jul 12, 2019 at 02:33:29PM +0200, Toke Høiland-Jørgensen wrote: > Neil Horman writes: > > > On Fri, Jul 12, 2019 at 11:27:55AM +0200, Toke Høiland-Jørgensen wrote: > >> Neil Horman writes: > >> > >> > On Thu, Jul 11, 2019 at 03:39:09PM +0300,

Re: [PATCH net-next 00/11] Add drop monitor for offloaded data paths

2019-07-12 Thread Neil Horman
On Fri, Jul 12, 2019 at 11:27:55AM +0200, Toke Høiland-Jørgensen wrote: > Neil Horman writes: > > > On Thu, Jul 11, 2019 at 03:39:09PM +0300, Ido Schimmel wrote: > >> On Sun, Jul 07, 2019 at 12:45:41PM -0700, David Miller wrote: > >> > From: Ido Schimmel >

Re: [PATCH net-next 00/11] Add drop monitor for offloaded data paths

2019-07-12 Thread Neil Horman
On Thu, Jul 11, 2019 at 08:40:34PM -0700, Florian Fainelli wrote: > > > On 7/11/2019 4:53 PM, Neil Horman wrote: > >> I would like to emphasize that the configuration of whether these > >> dropped packets are even sent to the CPU from the device still needs to > &

Re: [PATCH net-next 00/11] Add drop monitor for offloaded data paths

2019-07-11 Thread Neil Horman
On Thu, Jul 11, 2019 at 03:39:09PM +0300, Ido Schimmel wrote: > On Sun, Jul 07, 2019 at 12:45:41PM -0700, David Miller wrote: > > From: Ido Schimmel > > Date: Sun, 7 Jul 2019 10:58:17 +0300 > > > > > Users have several ways to debug the kernel and understand why a packet > > > was dropped. For e

Re: [PATCH net] sctp: count data bundling sack chunk for outctrlchunks

2019-07-03 Thread Neil Horman
(sock_net(asoc->base.sk), > +SCTP_MIB_OUTCTRLCHUNKS); > + asoc->stats.octrlchunks++; > asoc->peer.sack_needed = 0; > if (del_timer(timer)) > sctp_association_put(asoc); > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net-next] af_packet: convert pending frame counter to atomic_t

2019-06-28 Thread Neil Horman
On Fri, Jun 28, 2019 at 11:15:09AM -0400, Willem de Bruijn wrote: > On Fri, Jun 28, 2019 at 10:53 AM Neil Horman wrote: > > > > The AF_PACKET protocol, when running as a memory mapped socket uses a > > pending frame counter to track the number of skbs in flight during >

[PATCH net-next] af_packet: convert pending frame counter to atomic_t

2019-06-28 Thread Neil Horman
the run time of packet_read_pending, as we only need to read a single variable, instead of having to loop over every available cpu variable instance. Tested by myself by running a small program which sends frames via AF_PACKET on multiple cpus in parallel, with good results. Signed-off-by: Neil

Re: [PATCH net] sctp: fix error handling on stream scheduler initialization

2019-06-28 Thread Neil Horman
ret = sctp_sched_init_sid(stream, sid, GFP_KERNEL); > + if (ret) { > + kfree(SCTP_SO(stream, sid)->ext); > + SCTP_SO(stream, sid)->ext = NULL; > + } > + > + return ret; > } > > void sctp_stream_free(struct sctp_stream *stream) > -- > 2.21.0 > > Acked-by: Neil Horman

Re: [PATCH v4 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-26 Thread Neil Horman
On Wed, Jun 26, 2019 at 11:05:39AM -0400, Willem de Bruijn wrote: > On Wed, Jun 26, 2019 at 6:54 AM Neil Horman wrote: > > > > On Tue, Jun 25, 2019 at 06:30:08PM -0400, Willem de Bruijn wrote: > > > > diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c

Re: [PATCH v4 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-26 Thread Neil Horman
On Tue, Jun 25, 2019 at 06:30:08PM -0400, Willem de Bruijn wrote: > > diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c > > index a29d66da7394..a7ca6a003ebe 100644 > > --- a/net/packet/af_packet.c > > +++ b/net/packet/af_packet.c > > @@ -2401,6 +2401,9 @@ static void tpacket_destruct_skb

[PATCH v4 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-25 Thread Neil Horman
. Tested by myself and the reporter, with good results Appies to the net tree Signed-off-by: Neil Horman Reported-by: Matteo Croce CC: "David S. Miller" CC: Willem de Bruijn Change Notes: V1->V2: Enhance the sleep logic to support being interruptible and allowing fo

Re: [PATCH v3 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-25 Thread Neil Horman
On Tue, Jun 25, 2019 at 09:37:17AM -0400, Willem de Bruijn wrote: > On Tue, Jun 25, 2019 at 7:03 AM Neil Horman wrote: > > > > On Mon, Jun 24, 2019 at 06:15:29PM -0400, Willem de Bruijn wrote: > > > > > > + if (need_wait && !packet

Re: [PATCH net] sctp: change to hold sk after auth shkey is created successfully

2019-06-25 Thread Neil Horman
rsctp_enable; > ep->reconf_enable = net->sctp.reconf_enable; > > + /* Remember who we are attached to. */ > + ep->base.sk = sk; > + sock_hold(ep->base.sk); > + > return ep; > > nomem_shkey: > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH v3 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-25 Thread Neil Horman
On Mon, Jun 24, 2019 at 06:15:29PM -0400, Willem de Bruijn wrote: > > > > + if (need_wait && !packet_next_frame(po, &po->tx_ring, > > > > TP_STATUS_SEND_REQUEST)) { > > > > + po->wait_on_complete = 1; > > > > + timeo = sock_sndtimeo(&po->sk

Re: [PATCH v3 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-24 Thread Neil Horman
On Mon, Jun 24, 2019 at 02:08:43PM -0400, Willem de Bruijn wrote: > On Sun, Jun 23, 2019 at 8:46 PM Neil Horman wrote: > > > > When an application is run that: > > a) Sets its scheduler to be SCHED_FIFO > > and > > b) Opens a memory mapped AF_PACKET

[PATCH v3 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-23 Thread Neil Horman
. Tested by myself and the reporter, with good results Appies to the net tree Signed-off-by: Neil Horman Reported-by: Matteo Croce CC: "David S. Miller" CC: Willem de Bruijn Change Notes: V1->V2: Enhance the sleep logic to support being interruptible and allowing fo

Re: [PATCH v2 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-23 Thread Neil Horman
On Sun, Jun 23, 2019 at 10:39:12AM -0400, Willem de Bruijn wrote: > On Sun, Jun 23, 2019 at 7:40 AM Neil Horman wrote: > > > > On Sat, Jun 22, 2019 at 10:21:31PM -0400, Willem de Bruijn wrote: > > > > > -static void __packet_set_status(struct packet_sock *po, void

Re: [PATCH v2 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-23 Thread Neil Horman
On Sat, Jun 22, 2019 at 10:21:31PM -0400, Willem de Bruijn wrote: > > > -static void __packet_set_status(struct packet_sock *po, void *frame, int > > > status) > > > +static void __packet_set_status(struct packet_sock *po, void *frame, int > > > status, > > > + bool

Re: [PATCH v2 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-23 Thread Neil Horman
On Sat, Jun 22, 2019 at 10:12:46PM -0400, Willem de Bruijn wrote: > On Sat, Jun 22, 2019 at 1:42 PM Neil Horman wrote: > > > > When an application is run that: > > a) Sets its scheduler to be SCHED_FIFO > > and > > b) Opens a memory mapped AF_PACKET

[PATCH v2 net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-22 Thread Neil Horman
. Tested by myself and the reporter, with good results Appies to the net tree Signed-off-by: Neil Horman Reported-by: Matteo Croce CC: "David S. Miller" CC: Willem de Bruijn Change Notes: V1->V2: Enhance the sleep logic to support being interruptible and allowing fo

Re: [PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-22 Thread Neil Horman
On Fri, Jun 21, 2019 at 04:06:09PM -0400, Willem de Bruijn wrote: > On Fri, Jun 21, 2019 at 3:18 PM Neil Horman wrote: > > > > On Fri, Jun 21, 2019 at 02:31:17PM -0400, Willem de Bruijn wrote: > > > On Fri, Jun 21, 2019 at 12:42 PM Neil Horman > > > wrote: >

Re: [PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-21 Thread Neil Horman
On Fri, Jun 21, 2019 at 02:31:17PM -0400, Willem de Bruijn wrote: > On Fri, Jun 21, 2019 at 12:42 PM Neil Horman wrote: > > > > On Thu, Jun 20, 2019 at 11:16:13AM -0400, Willem de Bruijn wrote: > > > On Thu, Jun 20, 2019 at 10:24 AM Neil Horman > > > wrote: >

Re: [PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-21 Thread Neil Horman
On Thu, Jun 20, 2019 at 11:16:13AM -0400, Willem de Bruijn wrote: > On Thu, Jun 20, 2019 at 10:24 AM Neil Horman wrote: > > > > On Thu, Jun 20, 2019 at 09:41:30AM -0400, Willem de Bruijn wrote: > > > On Wed, Jun 19, 2019 at 4:26 PM Neil Horman wrote: > > > >

Re: [PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-20 Thread Neil Horman
On Thu, Jun 20, 2019 at 12:18:41PM -0400, Willem de Bruijn wrote: > On Thu, Jun 20, 2019 at 12:14 PM Neil Horman wrote: > > > > On Thu, Jun 20, 2019 at 11:16:13AM -0400, Willem de Bruijn wrote: > > > On Thu, Jun 20, 2019 at 10:24 AM Neil Horman > > > wrote: >

Re: [PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-20 Thread Neil Horman
On Thu, Jun 20, 2019 at 11:16:13AM -0400, Willem de Bruijn wrote: > On Thu, Jun 20, 2019 at 10:24 AM Neil Horman wrote: > > > > On Thu, Jun 20, 2019 at 09:41:30AM -0400, Willem de Bruijn wrote: > > > On Wed, Jun 19, 2019 at 4:26 PM Neil Horman wrote: > > > >

Re: [PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-20 Thread Neil Horman
On Thu, Jun 20, 2019 at 09:41:30AM -0400, Willem de Bruijn wrote: > On Wed, Jun 19, 2019 at 4:26 PM Neil Horman wrote: > > > > When an application is run that: > > a) Sets its scheduler to be SCHED_FIFO > > and > > b) Opens a memory mapped AF_PACKET

[PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-19 Thread Neil Horman
. Tested by myself and the reporter, with good results Appies to the net tree Signed-off-by: Neil Horman Reported-by: Matteo Croce CC: "David S. Miller" --- net/packet/af_packet.c | 42 +++--- net/packet/internal.h | 2 ++ 2 files changed, 33

[PATCH v5 net] sctp: Free cookie before we memdup a new one

2019-06-13 Thread Neil Horman
es v1->v2 update subsystem tag in subject (davem) repeat kfree check for peer_random and peer_hmacs (xin) v2->v3 net->sctp also free peer_chunks v3->v4 fix subject tags v4->v5 remove cut line Signed-off-by: Neil Horman Reported-by: syzbot+f7e9153b037eac9b1...@syzkaller.appspot

Re: [PATCH v4 net] sctp: Free cookie before we memdup a new one

2019-06-12 Thread Neil Horman
On Wed, Jun 12, 2019 at 03:07:15PM -0300, Marcelo Ricardo Leitner wrote: > On Tue, Jun 11, 2019 at 08:38:14PM -0400, Neil Horman wrote: > > Based on comments from Xin, even after fixes for our recent syzbot > > report of cookie memory leaks, its possible to get a resend of an INIT

[PATCH v4 net] sctp: Free cookie before we memdup a new one

2019-06-11 Thread Neil Horman
notes v1->v2 update subsystem tag in subject (davem) repeat kfree check for peer_random and peer_hmacs (xin) v2->v3 net->sctp also free peer_chunks v3->v4 fix subject tags Signed-off-by: Neil Horman Reported-by: syzbot+f7e9153b037eac9b1...@syzkaller.appspotmail.com CC: Marcelo Ricardo

Re: [PATCH v3] [sctp] Free cookie before we memdup a new one

2019-06-11 Thread Neil Horman
On Tue, Jun 11, 2019 at 01:08:56PM -0700, David Miller wrote: > From: Neil Horman > Date: Tue, 11 Jun 2019 15:22:45 -0400 > > > v2->v3 > > net->sctp > > also free peer_chunks > > Neil this isn't the first time you're submitting sctp patches ri

[PATCH v3] [sctp] Free cookie before we memdup a new one

2019-06-11 Thread Neil Horman
notes v1->v2 update subsystem tag in subject (davem) repeat kfree check for peer_random and peer_hmacs (xin) v2->v3 net->sctp also free peer_chunks Signed-off-by: Neil Horman Reported-by: syzbot+f7e9153b037eac9b1...@syzkaller.appspotmail.com CC: Marcelo Ricardo Leitner CC: Xin Long

[PATCH v2] [net] Free cookie before we memdup a new one

2019-06-11 Thread Neil Horman
notes v1->v2 update subsystem tag in subject (davem) repeat kfree check for peer_random and peer_hmacs (xin) Signed-off-by: Neil Horman CC: Marcelo Ricardo Leitner CC: Xin Long CC: "David S. Miller" CC: netdev@vger.kernel.org --- net/sctp/sm_make_chunk.c | 6 ++ 1 file cha

[PATCH] Free cookie before we memdup a new one

2019-06-10 Thread Neil Horman
ff-by: Neil Horman CC: Marcelo Ricardo Leitner CC: Xin Long CC: "David S. Miller" CC: netdev@vger.kernel.org --- net/sctp/sm_make_chunk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index f17908f5c4f3..21f7faf032e5 100644

Re: [PATCH V2] Fix memory leak in sctp_process_init

2019-06-07 Thread Neil Horman
On Thu, Jun 06, 2019 at 12:47:55PM -0300, Marcelo Ricardo Leitner wrote: > On Wed, Jun 05, 2019 at 07:20:10AM -0400, Neil Horman wrote: > > On Wed, Jun 05, 2019 at 04:16:24AM +0800, Xin Long wrote: > > > On Tue, Jun 4, 2019 at 4:34 AM Neil Horman wrote: > > > > >

Re: [PATCH V2] Fix memory leak in sctp_process_init

2019-06-05 Thread Neil Horman
On Wed, Jun 05, 2019 at 04:16:24AM +0800, Xin Long wrote: > On Tue, Jun 4, 2019 at 4:34 AM Neil Horman wrote: > > > > syzbot found the following leak in sctp_process_init > > BUG: memory leak > > unreferenced object 0x88810ef68400 (size 1024): > > comm &qu

[PATCH V2] Fix memory leak in sctp_process_init

2019-06-03 Thread Neil Horman
ough this function, at which point it is overwritten with a heap allocated value, but in certain cases, where a COOKIE_ECHO chunk is included in the packet, a second pass through sctp_process_init is made, where the cookie value is re-allocated, leaking the first allocation. Fix is to always allocate the co

Re: [PATCH] Fix memory leak in sctp_process_init

2019-06-03 Thread Neil Horman
On Mon, Jun 03, 2019 at 11:31:13AM -0300, Marcelo Ricardo Leitner wrote: > On Mon, Jun 03, 2019 at 10:21:12AM -0400, Neil Horman wrote: > > syzbot found the following leak in sctp_process_init > > BUG: memory leak > > unreferenced object 0x88810ef68400 (size 1024): > &

[PATCH] Fix memory leak in sctp_process_init

2019-06-03 Thread Neil Horman
ough this function, at which point it is overwritten with a heap allocated value, but in certain cases, where a COOKIE_ECHO chunk is included in the packet, a second pass through sctp_process_init is made, where the cookie value is re-allocated, leaking the first allocation. Fix is to always allocate the co

Re: [PATCH net-next] sctp: remove unused cmd SCTP_CMD_GEN_INIT_ACK

2019-05-15 Thread Neil Horman
On Sun, May 12, 2019 at 01:52:48PM +0800, Xin Long wrote: > On Fri, May 10, 2019 at 7:27 PM Neil Horman wrote: > > > > On Thu, May 09, 2019 at 09:39:13AM -0700, David Miller wrote: > > > From: Neil Horman > > > Date: Thu, 9 May 2019 07:32:35 -0400 > > >

Re: [PATCH net-next] sctp: remove unused cmd SCTP_CMD_GEN_INIT_ACK

2019-05-10 Thread Neil Horman
On Thu, May 09, 2019 at 09:39:13AM -0700, David Miller wrote: > From: Neil Horman > Date: Thu, 9 May 2019 07:32:35 -0400 > > > This is definately a valid cleanup, but I wonder if it wouldn't be better > > to, > > instead of removing it, to use it. We ha

Re: [PATCH net-next] sctp: remove unused cmd SCTP_CMD_GEN_INIT_ACK

2019-05-09 Thread Neil Horman
On Thu, May 09, 2019 at 02:28:00PM +0800, Xin Long wrote: > SCTP_CMD_GEN_INIT_ACK was introduced since very beginning, but never > got used. So remove it. > > Signed-off-by: Xin Long > --- > include/net/sctp/command.h | 1 - > net/sctp/sm_sideeffect.c | 11 --- > 2 files changed, 12 d

Re: [PATCH net] sctp: avoid running the sctp state machine recursively

2019-04-29 Thread Neil Horman
sconf() in the 1st > sctp_do_sm() directly. > > Reported-by: Ying Xu > Signed-off-by: Xin Long > --- > include/net/sctp/command.h | 1 - > net/sctp/sm_sideeffect.c | 29 - > net/sctp/sm_statefuns.c| 35 +++ > 3 files changed, 27 insertions(+), 38 deletions(-) > Acked-by: Neil Horman

Re: [PATCH 3/9] sctp: Check address length before reading srx_service field

2019-04-12 Thread Neil Horman
On Fri, Apr 12, 2019 at 08:21:26PM +0900, Tetsuo Handa wrote: > On 2019/04/12 20:12, Neil Horman wrote: > > On Fri, Apr 12, 2019 at 07:53:10PM +0900, Tetsuo Handa wrote: > >> KMSAN will complain if valid address length passed to connect() is shorter > >> than sizeof(&

Re: [PATCH 3/9] sctp: Check address length before reading srx_service field

2019-04-12 Thread Neil Horman
On Fri, Apr 12, 2019 at 07:53:10PM +0900, Tetsuo Handa wrote: > KMSAN will complain if valid address length passed to connect() is shorter > than sizeof("struct sockaddr"->sa_family) bytes. > > Signed-off-by: Tetsuo Handa > --- > net/sctp/socket.c | 3 ++- > 1 file changed, 2 insertions(+), 1 de

Re: [PATCH v5 0/5] SCTP: Event skb list overhaul.

2019-04-12 Thread Neil Horman
ass a non-empty skb list around instead of an > event skb object which may or may not be on a list. > > I'd like to thank Marcelo Leitner, Xin Long, and Neil Horman for > reviewing previous versions of this series. > > Testing would be very much appreciated, in addition to th

Re: [PATCH net-next 0/2] sctp: fully support memory accounting

2019-04-02 Thread Neil Horman
On Tue, Apr 02, 2019 at 12:36:10AM -0300, Marcelo Ricardo Leitner wrote: > On Mon, Apr 01, 2019 at 07:31:10AM -0400, Neil Horman wrote: > > On Sun, Mar 31, 2019 at 04:53:45PM +0800, Xin Long wrote: > > > sctp memory accounting is added in this patchset by using > > > the

Re: [PATCH net] sctp: initialize _pad of sockaddr_in before copying to user memory

2019-04-01 Thread Neil Horman
*sp, union sctp_addr *addr) > { > /* No address mapping for V4 sockets */ > + memset(addr->v4.sin_zero, 0, sizeof(addr->v4.sin_zero)); > return sizeof(struct sockaddr_in); > } > > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net-next 0/2] sctp: fully support memory accounting

2019-04-01 Thread Neil Horman
On Sun, Mar 31, 2019 at 04:53:45PM +0800, Xin Long wrote: > sctp memory accounting is added in this patchset by using > these kernel APIs on send side: > > - sk_mem_charge() > - sk_mem_uncharge() > - sk_wmem_schedule() > - sk_under_memory_pressure() > - sk_mem_reclaim() > > and these on

Re: [PATCH net] sctp: use memdup_user instead of vmemdup_user

2019-03-20 Thread Neil Horman
vmemdup_user(addrs, addrs_size); > + kaddrs = memdup_user(addrs, addrs_size); > if (unlikely(IS_ERR(kaddrs))) > return PTR_ERR(kaddrs); > > @@ -1349,7 +1349,7 @@ static int __sctp_setsockopt_connectx(struct sock *sk, > err = __sctp_connect(sk, kaddrs, addrs_size, flags, assoc_id); > > out_free: > - kvfree(kaddrs); > + kfree(kaddrs); > > return err; > } > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net] sctp: not copy sctp_sock pd_lobby in sctp_copy_descendant

2019-03-19 Thread Neil Horman
n new pd_lobby. >* 3) Peeling off non-partial delivery; move pd_lobby to receive_queue. >*/ > - skb_queue_head_init(&newsp->pd_lobby); > atomic_set(&sctp_sk(newsk)->pd_mode, assoc->ulpq.pd_mode); > > if (atomic_read(&sctp_sk(oldsk)->pd_mode)) { > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCHv2 net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-03-19 Thread Neil Horman
struct sctphdr *sh = (struct sctphdr *)(skb->data + offset); > const struct skb_checksum_ops ops = { > .update = sctp_csum_update, > .combine = sctp_csum_combine, > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH RFC v4 0/5] SCTP: Event skb list overhaul.

2019-03-13 Thread Neil Horman
ich may or may not be on a list. > > I'd like to thank Marcelo Leitner, Xin Long, and Neil Horman for > reviewing previous versions of this series. > > Testing would be very much appreciated, in addition to the review of > course. > > v3 --> v4:

Re: [PATCH net] sctp: remove sched init from sctp_stream_init

2019-03-08 Thread Neil Horman
/net/sctp/stream.c > @@ -230,8 +230,6 @@ int sctp_stream_init(struct sctp_stream *stream, __u16 > outcnt, __u16 incnt, > for (i = 0; i < stream->outcnt; i++) > SCTP_SO(stream, i)->state = SCTP_STREAM_OPEN; > > - sched->init(stream); > - > in: > sctp_stream_interleave_init(stream); > if (!incnt) > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net 0/3] sctp: process the error returned from sctp_sock_migrate()

2019-03-07 Thread Neil Horman
p/auth.c| 6 -- > net/sctp/endpointola.c | 18 ++ > net/sctp/socket.c | 44 ++-- > 3 files changed, 44 insertions(+), 24 deletions(-) > > -- > 2.1.0 > > Series Acked-by: Neil Horman

Re: [PATCH net 1/3] sctp: sctp_sock_migrate() returns error if sctp_bind_addr_dup() fails

2019-03-07 Thread Neil Horman
On Thu, Mar 07, 2019 at 06:06:21PM +0800, Xin Long wrote: > On Thu, Mar 7, 2019 at 2:21 AM Neil Horman wrote: > > > > On Sun, Mar 03, 2019 at 05:54:53PM +0800, Xin Long wrote: > > > It should fail to create the new sk if sctp_bind_addr_dup() fails > > > when ac

Re: [PATCH net 3/3] sctp: call sctp_auth_init_hmacs() in sctp_sock_migrate()

2019-03-06 Thread Neil Horman
err = sctp_auth_init_hmacs(newsp->ep, GFP_KERNEL); > + if (err) > + return err; > + } > + > /* Move any messages in the old socket's receive queue that are for the >* peeled off association to the new socket's receive queue. >*/ > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net 2/3] sctp: move up sctp_auth_init_hmacs() in sctp_endpoint_init()

2019-03-06 Thread Neil Horman
uct > sctp_endpoint *ep, > > return ep; > > -nomem_hmacs: > - sctp_auth_destroy_keys(&ep->endpoint_shared_keys); > +nomem_shkey: > + sctp_auth_destroy_hmacs(ep->auth_hmacs); > nomem: > /* Free all allocations */ > kfree(auth_hmacs); > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net 1/3] sctp: sctp_sock_migrate() returns error if sctp_bind_addr_dup() fails

2019-03-06 Thread Neil Horman
On Sun, Mar 03, 2019 at 05:54:53PM +0800, Xin Long wrote: > It should fail to create the new sk if sctp_bind_addr_dup() fails > when accepting or peeloff an association. > > Signed-off-by: Xin Long > --- > net/sctp/socket.c | 34 -- > 1 file changed, 24 insertions

Re: general protection fault in sctp_sched_rr_dequeue

2019-03-06 Thread Neil Horman
On Wed, Mar 06, 2019 at 06:43:48PM +0800, Xin Long wrote: > On Wed, Mar 6, 2019 at 9:42 AM syzbot > wrote: > > > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:63bdf4284c38 Merge branch 'linus' of git://git.kernel.org/.. > > git tree: upstream > > console outpu

Re: [PATCH net] sctp: call iov_iter_revert() after sending ABORT

2019-03-04 Thread Neil Horman
> > pr_debug("%s: aborting association:%p\n", __func__, asoc); > sctp_primitive_ABORT(net, asoc, chunk); > + iov_iter_revert(&msg->msg_iter, msg_len); > > return 0; > } > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH RFC v3 4/5] sctp: Make sctp_enqueue_event tak an skb list.

2019-02-28 Thread Neil Horman
On Wed, Feb 27, 2019 at 11:19:58PM -0300, Marcelo Ricardo Leitner wrote: > On Wed, Feb 27, 2019 at 05:00:24PM -0800, David Miller wrote: > > > > Pass this, instead of an event. Then everything trickles down and we > > always have events a non-empty list. > > > > Then we needs a list creating stu

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-27 Thread Neil Horman
On Wed, Feb 27, 2019 at 08:53:26PM +0800, Xin Long wrote: > On Tue, Feb 26, 2019 at 8:29 PM Neil Horman wrote: > > > > On Tue, Feb 26, 2019 at 12:15:54AM +0800, Xin Long wrote: > > > On Mon, Feb 25, 2019 at 10:08 PM Neil Horman > > > wrote: > > > &g

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-26 Thread Neil Horman
On Tue, Feb 26, 2019 at 12:15:54AM +0800, Xin Long wrote: > On Mon, Feb 25, 2019 at 10:08 PM Neil Horman wrote: > > > > On Mon, Feb 25, 2019 at 09:20:44PM +0800, Xin Long wrote: > > > On Mon, Feb 25, 2019 at 8:47 PM Neil Horman wrote: > > > > > > > &g

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-25 Thread Neil Horman
On Mon, Feb 25, 2019 at 09:20:44PM +0800, Xin Long wrote: > On Mon, Feb 25, 2019 at 8:47 PM Neil Horman wrote: > > > > On Mon, Feb 25, 2019 at 07:25:37PM +0800, Xin Long wrote: > > > sctp_hdr(skb) only works when skb->transport_header is set properly. >

Re: [PATCH net] sctp: get sctphdr by offset in sctp_compute_cksum

2019-02-25 Thread Neil Horman
On Mon, Feb 25, 2019 at 07:25:37PM +0800, Xin Long wrote: > sctp_hdr(skb) only works when skb->transport_header is set properly. > > But in the path of nf_conntrack_in: sctp_packet() -> sctp_error() > > skb->transport_header is not guaranteed to be right value for sctp. > It will cause to fail to

Re: [PATCH net] sctp: set stream ext to NULL after freeing it in sctp_stream_outq_migrate

2019-02-12 Thread Neil Horman
*stream, > } > } > > - for (i = outcnt; i < stream->outcnt; i++) > + for (i = outcnt; i < stream->outcnt; i++) { > kfree(SCTP_SO(stream, i)->ext); > + SCTP_SO(stream, i)->ext = NULL; > + } > } > > static int sctp_stream_alloc_out(struct sctp_stream *stream, __u16 outcnt, > -- > 2.1.0 > > Acked-by: Neil Horman

  1   2   3   4   5   6   >