netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org,
	vyasevich@gmail.com, nhorman@tuxdriver.com, lucien.xin@gmail.com
Subject: Re: [PATCH net-next 0/2] sctp: unify sctp_make_op_error_fixed and sctp_make_op_error_space
Date: Tue, 1 May 2018 20:28:23 -0300	[thread overview]
Message-ID: <20180501232822.GB5105@localhost.localdomain> (raw)
In-Reply-To: <20180501.121353.1918662858023133319.davem@davemloft.net>

On Tue, May 01, 2018 at 12:13:53PM -0400, David Miller wrote:
> From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> Date: Sun, 29 Apr 2018 12:56:30 -0300
>
> > These two variants are very close to each other and can be merged
> > to avoid code duplication. That's what this patchset does.
> >
> > First, we allow sctp_init_cause to return errors, which then allow us to
> > add sctp_make_op_error_limited that handles both situations.
>
> Series applied.

Thanks.

>
> But generally, there are a lot of smtp_init_cause() call sites with non-zero
> payload length that should start checking the return value now.

They are safe as is, because they follow the pattern:
- sctp_make_abort(...., somesize)
- sctp_init_cause(size)
where size is considered in somesize, so sctp_init_cause cannot fail
in there.

This new usage in sctp_make_op_error_limited is the only one where it
allocates a buffer without knowing how much data will actually be
pushed into it.

  Marcelo

      reply	other threads:[~2018-05-01 23:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-29 15:56 [PATCH net-next 0/2] sctp: unify sctp_make_op_error_fixed and sctp_make_op_error_space Marcelo Ricardo Leitner
2018-04-29 15:56 ` [PATCH net-next 1/2] sctp: allow sctp_init_cause to return errors Marcelo Ricardo Leitner
2018-04-29 15:56 ` [PATCH net-next 2/2] sctp: add sctp_make_op_error_limited and reuse inner functions Marcelo Ricardo Leitner
2018-04-30  2:14   ` kbuild test robot
2018-04-30  2:14   ` kbuild test robot
2018-04-30  2:34     ` Marcelo Ricardo Leitner
2018-05-14  7:40       ` [kbuild-all] " Ye Xiaolong
2018-05-14 11:01         ` Marcelo Ricardo Leitner
2018-05-14 11:47           ` Ye Xiaolong
2018-05-14 12:16             ` Marcelo Ricardo Leitner
2018-05-15  1:23               ` Ye Xiaolong
2018-05-23 22:34                 ` Marcelo Ricardo Leitner
2018-05-01 16:13 ` [PATCH net-next 0/2] sctp: unify sctp_make_op_error_fixed and sctp_make_op_error_space David Miller
2018-05-01 23:28   ` Marcelo Ricardo Leitner [this message]

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=20180501232822.GB5105@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).