lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190228131723.GB13343@localhost.localdomain>
Date:   Thu, 28 Feb 2019 10:17:23 -0300
From:   Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To:     Neil Horman <nhorman@...driver.com>
Cc:     David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        lucien.xin@...il.com
Subject: Re: [PATCH RFC v3 4/5] sctp: Make sctp_enqueue_event tak an skb list.

On Thu, Feb 28, 2019 at 07:23:56AM -0500, Neil Horman wrote:
> 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 stub to place into .enqueue_event for sctp_stream_interleave_1.
> > > 
> > > Signed-off-by: David S. Miller <davem@...emloft.net>
> > > ---
> > >  net/sctp/stream_interleave.c | 44 +++++++++++++++++++++++++++---------
> > >  1 file changed, 33 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c
> > > index b6b251b8b3cf..0bc3d9329d9a 100644
> > > --- a/net/sctp/stream_interleave.c
> > > +++ b/net/sctp/stream_interleave.c
> > ...
> > > @@ -866,11 +867,15 @@ static int sctp_ulpevent_idata(struct sctp_ulpq *ulpq,
> > 
> > More context:
> >         if (!(event->msg_flags & SCTP_DATA_UNORDERED)) {
> >                 event = sctp_intl_reasm(ulpq, event);       [1]
> >                 if (event && event->msg_flags & MSG_EOR) {  [2]
> >                         skb_queue_head_init(&temp);
> >                         __skb_queue_tail(&temp, sctp_event2skb(event));
> > 
> >                         event = sctp_intl_order(ulpq, event);
> > >  		}
> > >  	} else {
> > >  		event = sctp_intl_reasm_uo(ulpq, event);
> > > +		if (event) {
> > > +			skb_queue_head_init(&temp);
> > > +			__skb_queue_tail(&temp, sctp_event2skb(event));
> > > +		}
> > >  	}
> > >  
> > >  	if (event) {
> > >  		event_eor = (event->msg_flags & MSG_EOR) ? 1 : 0;
> > > -		sctp_enqueue_event(ulpq, event);
> > > +		sctp_enqueue_event(ulpq, &temp);
> > 
> > [1] can return an event without MSG_EOR (a partial delivery), which
> > would skip the condition on [2] and cause temp to not be initialized
> > by here.  Same applies to sctp_ulpq_tail_data().
> > 
> I agree, it seems we canjust drop the msg_flags check and just key off of event
> being non-null, no?

Yes. Like:

        if (!(event->msg_flags & SCTP_DATA_UNORDERED)) {
                event = sctp_intl_reasm(ulpq, event);
                if (event) {
                        skb_queue_head_init(&temp);
                        __skb_queue_tail(&temp, sctp_event2skb(event));

                	if (event->msg_flags & MSG_EOR)
                        	event = sctp_intl_order(ulpq, event);
		}

Or some other clever way to handle it and reduce amount of the 'if
(event)' checks that we have in there. Maybe 'if (!event) goto out;'
helps.

  Marcelo

> 
> Neil
> 
> > It's the only thing I noticed on the series. Will test it tomorrow.
> > 
> > >  	}
> > >  
> > >  	return event_eor;
> > ...
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ