[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] 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 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 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

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: > > > > >

[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 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-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: 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: [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: [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: [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: [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-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 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 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 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] 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: 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: 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: [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 >

[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 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

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 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 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 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

[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

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

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 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-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-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-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: >

[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 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

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 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

[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 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

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 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 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

[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 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

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 net-next 03/13] sctp: remove an if() that is always true

2018-04-27 Thread Neil Horman
On Thu, Apr 26, 2018 at 04:58:52PM -0300, Marcelo Ricardo Leitner wrote: > As noticed by Xin Long, the if() here is always true as PMTU can never > be 0. > > Reported-by: Xin Long > Signed-off-by: Marcelo Ricardo Leitner > --- > net/sctp/associola.c | 6 ++ > 1 file changed, 2 insertions(+)

Re: [PATCH net-next 03/13] sctp: remove an if() that is always true

2018-04-27 Thread Neil Horman
On Fri, Apr 27, 2018 at 03:13:49PM -0300, Marcelo Ricardo Leitner wrote: > On Fri, Apr 27, 2018 at 06:50:50AM -0400, Neil Horman wrote: > > On Thu, Apr 26, 2018 at 04:58:52PM -0300, Marcelo Ricardo Leitner wrote: > > > As noticed by Xin Long, the if() here is always true as PMTU

Re: [PATCH net] MAINTAINERS: add myself as SCTP co-maintainer

2018-04-29 Thread Neil Horman
33a17d69e71bfd01760fa8f2..5bac32b545607933ea41fe9a56cc96d57ee7a094 > 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -12507,6 +12507,7 @@ F:drivers/scsi/st_*.h > SCTP PROTOCOL > M: Vlad Yasevich > M: Neil Horman > +M: Marcelo Ricardo Leitner > L: linux-s...@vger.ke

Re: [PATCH net] sctp: init active key for the new asoc in dupcook_a and dupcook_b

2018-05-02 Thread Neil Horman
ctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc)); > sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Acked-by: Neil Horman

Re: [PATCH net] sctp: use the old asoc when making the cookie-ack chunk in dupcook_d

2018-05-02 Thread Neil Horman
> goto nomem; > > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Acked-by: Neil Horman

Re: [PATCH net] sctp: fix the issue that the cookie-ack with auth can't get processed

2018-05-02 Thread Neil Horman
chunk->singleton = 0; > } else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) { > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Acked-by: Neil Horman

Re: [PATCH] sctp: fix a potential missing-check bug

2018-05-03 Thread Neil Horman
On Wed, May 02, 2018 at 08:07:17PM -0500, Wenwen Wang wrote: > Hi Marcelo, > > I guess I worked on an old version of the kernel. I will re-submit the > patch. Sorry :( > You don't have to resubmit the patch, this isn't broken. As marcelo points out, a value of zero in this socket option is speci

Re: [PATCHv2 net] sctp: delay the authentication for the duplicated cookie-echo chunk

2018-05-07 Thread Neil Horman
t struct sctp_association *asoc, > - const union sctp_subtype type, > struct sctp_chunk *chunk) > { > struct sctp_shared_key *sh_key = NULL; > @@ -4275,7 +4281,7 @@ enum sctp_disposition sctp_sf_eat_auth(struct net *net, > commands); > > auth_hdr = (struct sctp_authhdr *)chunk->skb->data; > - error = sctp_sf_authenticate(net, ep, asoc, type, chunk); > + error = sctp_sf_authenticate(asoc, chunk); > switch (error) { > case SCTP_IERROR_AUTH_BAD_HMAC: > /* Generate the ERROR chunk and discard the rest > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Acked-by: Neil Horman

Re: [PATCH] sctp: fix spelling mistake: "max_retans" -> "max_retrans"

2018-05-09 Thread Neil Horman
ns > count"; > size_t payload_len = sizeof(error) + sizeof(struct sctp_errhdr); > struct sctp_chunk *retval; > > -- > 2.17.0 > > Acked-by: Neil Horman

Re: [PATCH net] sctp: remove sctp_chunk_put from fail_mark err path in sctp_ulpevent_make_rcvmsg

2018-05-10 Thread Neil Horman
100644 > --- a/net/sctp/ulpevent.c > +++ b/net/sctp/ulpevent.c > @@ -715,7 +715,6 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct > sctp_association *asoc, > return event; > > fail_mark: > - sctp_chunk_put(chunk); > kfree_skb(skb); > fail: > return NULL; > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net-next] sctp: fix const parameter violation in sctp_make_sack

2018-04-25 Thread Neil Horman
er.sack_generation == 0) { > + if (++asoc->peer.sack_generation == 0) { > list_for_each_entry(trans, &asoc->peer.transport_addr_list, > transports) > trans->sack_generation = 0; > - aptr->peer.sack_generation = 1; > + asoc->peer.sack_generation = 1; > } > nodata: > return retval; > -- > 2.14.3 > > Acked-by: Neil Horman

Re: [PATCH net-next] sctp: fix identification of new acks for SFR-CACC

2018-04-25 Thread Neil Horman
sack->num_gap_ack_blocks && > - q->asoc->peer.primary_path->cacc. > - changeover_active) > - transport->cacc.cacc_saw_newack > - = 1; > - } > - > list_add_tail(&tchunk->transmitted_list, > &q->sacked); > } else { > -- > 2.14.3 > > Acked-by: Neil Horman

Re: [PATCH net-next] sctp: remove the unused sctp_assoc_is_match function

2018-04-25 Thread Neil Horman
- transport = NULL; > - > -out: > - return transport; > -} > - > /* Do delayed input processing. This is scheduled by sctp_rcv(). */ > static void sctp_assoc_bh_rcv(struct work_struct *work) > { > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net] sctp: handle two v4 addrs comparison in sctp_inet6_cmp_addr

2018-04-26 Thread Neil Horman
; *addr1, > if (sctp_is_any(sk, addr1) || sctp_is_any(sk, addr2)) > return 1; > > + if (addr1->sa.sa_family == AF_INET && addr2->sa.sa_family == AF_INET) > + return addr1->v4.sin_addr.s_addr == addr2->v4.sin_addr.s_addr; > + > return __sctp_v6_cmp_addr(addr1, addr2); > } > > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net] sctp: clear the new asoc's stream outcnt in sctp_stream_update

2018-04-26 Thread Neil Horman
x f799043..f1f1d1b 100644 > --- a/net/sctp/stream.c > +++ b/net/sctp/stream.c > @@ -240,6 +240,8 @@ void sctp_stream_update(struct sctp_stream *stream, > struct sctp_stream *new) > > new->out = NULL; > new->in = NULL; > + new->outcnt = 0; > + new->incnt = 0; > } > > static int sctp_send_reconf(struct sctp_association *asoc, > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net] sctp: remove unnecessary asoc in sctp_has_association

2018-03-26 Thread Neil Horman
return true; > } > > - return 0; > + return false; > } > > /* > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Acked-by: Neil Horman

Re: [PATCH] [net-next] sctp: fix unused lable warning

2018-03-28 Thread Neil Horman
> > +#ifdef CONFIG_PROC_FS > err_init_proc: > cleanup_sctp_mibs(net); > +#endif > err_init_mibs: > sctp_sysctl_net_unregister(net); > err_sysctl_register: > -- > 2.9.0 > > Acked-by: Neil Horman

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

[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-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 >

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 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-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-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] 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-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 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] 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] 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: 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-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-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 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: 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: 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 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: [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 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 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 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] 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 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: [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 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: [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: 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 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-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-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][next] sctp: make array sctp_sched_ops static

2017-10-11 Thread Neil Horman
t; +static struct sctp_sched_ops *sctp_sched_ops[] = { > &sctp_sched_fcfs, > &sctp_sched_prio, > &sctp_sched_rr, > -- > 2.14.1 > > Acked-by: Neil Horman

Re: Kernel Performance Tuning for High Volume SCTP traffic

2017-10-16 Thread Neil Horman
On Sat, Oct 14, 2017 at 10:29:53PM +0800, Traiano Welcome wrote: > I've upped the value of the following sctp and udp related parameters, > in the hope that this would help: > > sysctl -w net.core.rmem_max=9 > sysctl -w net.core.wmem_max=9 > > sysctl -w net.sctp.sctp_mem="2100

Re: [PATCH net] sctp: do not peel off an assoc from one netns to another one

2017-10-17 Thread Neil Horman
c) > return -EINVAL; > > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Acked-by: Neil Horman

Re: [PATCH net] sctp: add the missing sock_owned_by_user check in sctp_icmp_redirect

2017-10-18 Thread Neil Horman
e7 100644 > --- a/net/sctp/input.c > +++ b/net/sctp/input.c > @@ -421,7 +421,7 @@ void sctp_icmp_redirect(struct sock *sk, struct > sctp_transport *t, > { > struct dst_entry *dst; > > - if (!t) > + if (sock_owned_by_user(sk) || !t) > return; > dst = sctp_transport_dst_check(t); > if (dst) > -- > 2.1.0 > > Acked-by: Neil Horman

Re: [PATCH net] sctp: fix erroneous inc of snmp SctpFragUsrMsgs

2018-06-20 Thread Neil Horman
SCTP_INC_STATS(sock_net(asoc->base.sk), > +SCTP_MIB_FRAGUSRMSGS); > } else { > /* Which may be the only one... */ > first_len = msg_len; > -- > 2.14.4 > > Acked-by: Neil Horman

  1   2   3   4   5   6   >