From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Petr Malat <oss@malat.biz>
Cc: linux-sctp@vger.kernel.org, vyasevich@gmail.com,
nhorman@tuxdriver.com, davem@davemloft.net, kuba@kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH] sctp: Honour SCTP_PARTIAL_DELIVERY_POINT even under memory pressure
Date: Thu, 03 Sep 2020 17:18:47 +0000 [thread overview]
Message-ID: <20200903171847.GD2444@localhost.localdomain> (raw)
In-Reply-To: <20200903112147.GA17627@bordel.klfree.net>
Hi!
On Thu, Sep 03, 2020 at 01:21:48PM +0200, Petr Malat wrote:
> Hi!
> On Wed, Sep 02, 2020 at 11:58:35AM -0300, Marcelo Ricardo Leitner wrote:
> > On Tue, Sep 01, 2020 at 11:00:07AM +0200, Petr Malat wrote:
> > > Command SCTP_CMD_PART_DELIVER issued under memory pressure calls
> > > sctp_ulpq_partial_delivery(), which tries to fetch and partially deliver
> > > the first message it finds without checking if the message is longer than
> > > SCTP_PARTIAL_DELIVERY_POINT. According to the RFC 6458 paragraph 8.1.21.
> > > such a behavior is invalid. Fix it by returning the first message only if
> > > its part currently available is longer than SCTP_PARTIAL_DELIVERY_POINT.
> >
> > Okay but AFAICT this patch then violates the basic idea behind partial
> > delivery. It will cause such small message to just not be delivered
> > anymore, and keep using the receive buffer which it is trying to free
> > some bits at this moment.
> By default the pd_point is set to 0, so there will not be a change in the
> behavior, but if the user changes it to some other value, it should be
> respected by the stack - for example when the largest message the user
> exchanges is 1kB and the user sets it to 1kB, his application is not
> prepared to handle fragmented messages at all and it's not a good idea to
> pass such a message to the app.
Then, if it doesn't support fragmented messages at all, the app just
shouldn't be setting pd_point at all. :-) Anyhow, I see how the patch
works now.
The fix is also needed on sctp_intl_retrieve_first() and
sctp_intl_retrieve_first_uo(). Same issue is in there, but for stream
interleaving.
Thanks.
WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Petr Malat <oss@malat.biz>
Cc: linux-sctp@vger.kernel.org, vyasevich@gmail.com,
nhorman@tuxdriver.com, davem@davemloft.net, kuba@kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH] sctp: Honour SCTP_PARTIAL_DELIVERY_POINT even under memory pressure
Date: Thu, 3 Sep 2020 14:18:47 -0300 [thread overview]
Message-ID: <20200903171847.GD2444@localhost.localdomain> (raw)
In-Reply-To: <20200903112147.GA17627@bordel.klfree.net>
Hi!
On Thu, Sep 03, 2020 at 01:21:48PM +0200, Petr Malat wrote:
> Hi!
> On Wed, Sep 02, 2020 at 11:58:35AM -0300, Marcelo Ricardo Leitner wrote:
> > On Tue, Sep 01, 2020 at 11:00:07AM +0200, Petr Malat wrote:
> > > Command SCTP_CMD_PART_DELIVER issued under memory pressure calls
> > > sctp_ulpq_partial_delivery(), which tries to fetch and partially deliver
> > > the first message it finds without checking if the message is longer than
> > > SCTP_PARTIAL_DELIVERY_POINT. According to the RFC 6458 paragraph 8.1.21.
> > > such a behavior is invalid. Fix it by returning the first message only if
> > > its part currently available is longer than SCTP_PARTIAL_DELIVERY_POINT.
> >
> > Okay but AFAICT this patch then violates the basic idea behind partial
> > delivery. It will cause such small message to just not be delivered
> > anymore, and keep using the receive buffer which it is trying to free
> > some bits at this moment.
> By default the pd_point is set to 0, so there will not be a change in the
> behavior, but if the user changes it to some other value, it should be
> respected by the stack - for example when the largest message the user
> exchanges is 1kB and the user sets it to 1kB, his application is not
> prepared to handle fragmented messages at all and it's not a good idea to
> pass such a message to the app.
Then, if it doesn't support fragmented messages at all, the app just
shouldn't be setting pd_point at all. :-) Anyhow, I see how the patch
works now.
The fix is also needed on sctp_intl_retrieve_first() and
sctp_intl_retrieve_first_uo(). Same issue is in there, but for stream
interleaving.
Thanks.
next prev parent reply other threads:[~2020-09-03 17:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 9:00 [PATCH] sctp: Honour SCTP_PARTIAL_DELIVERY_POINT even under memory pressure Petr Malat
2020-09-01 9:00 ` Petr Malat
2020-09-02 14:58 ` Marcelo Ricardo Leitner
2020-09-02 14:58 ` Marcelo Ricardo Leitner
2020-09-03 11:21 ` Petr Malat
2020-09-03 11:21 ` Petr Malat
2020-09-03 17:18 ` Marcelo Ricardo Leitner [this message]
2020-09-03 17:18 ` Marcelo Ricardo Leitner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200903171847.GD2444@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=oss@malat.biz \
--cc=vyasevich@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.