public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Chien Tin Tung <chien.tin.tung-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	Dan Carpenter
	<dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
	Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Why don't we always check that attr->port_num is valid?
Date: Tue, 3 Oct 2017 19:50:25 +0300	[thread overview]
Message-ID: <20171003165025.GC25829@mtr-leonro.local> (raw)
In-Reply-To: <20171003155606.GA12560-TZeIlv3TuzOfrEmaQUPKxl95YUYmaKo1UNDiOz3kqAs@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 875 bytes --]

On Tue, Oct 03, 2017 at 10:56:06AM -0500, Chien Tin Tung wrote:
> On Tue, Oct 03, 2017 at 08:21:59AM +0300, Leon Romanovsky wrote:
> > On Mon, Oct 02, 2017 at 09:20:33AM -0600, Jason Gunthorpe wrote:
> > > On Mon, Oct 02, 2017 at 02:34:31PM +0300, Dan Carpenter wrote:
> > >
> > > > We deliberately allow invalid attr->port_nums if IB_QP_PORT is not set.
> > > > Why must we do that?  From a kernel hardening perspective it would be
> > > > better to ban invalid values all together...
> > >
> > > It is part of the user ABI, so it has to stay that way...
> >
> > Can we pre-process all invalid parameters at the kernel entry points to
> > ensure that drivers receive clean input?
>
> Which side?  I hope you meant the kernel side. I certainly wouldn't want
> kernel to trust user input...

Yes, Chien, kernel side ("kernel entry points"), it goes without saying.

>
> Chien

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-10-03 16:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 11:34 Why don't we always check that attr->port_num is valid? Dan Carpenter
2017-10-02 15:20 ` Jason Gunthorpe
     [not found]   ` <20171002152033.GB12331-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-10-03  5:21     ` Leon Romanovsky
     [not found]       ` <20171003052159.GB26055-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-03 15:56         ` Chien Tin Tung
     [not found]           ` <20171003155606.GA12560-TZeIlv3TuzOfrEmaQUPKxl95YUYmaKo1UNDiOz3kqAs@public.gmane.org>
2017-10-03 16:50             ` Leon Romanovsky [this message]
     [not found]               ` <20171003165025.GC25829-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-03 19:40                 ` Chien Tin Tung
2017-10-03 19:52         ` Hefty, Sean
     [not found]           ` <1828884A29C6694DAF28B7E6B8A82373AB19A8A5-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-04  3:13             ` Dan Carpenter

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=20171003165025.GC25829@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=chien.tin.tung-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    /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