public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Michael J. Ruhl"
	<michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] RDMA/netlink: OOPs in rdma_nl_rcv_msg() from misinterpreted flag
Date: Tue, 24 Oct 2017 12:31:55 -0400	[thread overview]
Message-ID: <1508862715.3325.22.camel@redhat.com> (raw)
In-Reply-To: <20171024123957.32207.70888.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>

On Tue, 2017-10-24 at 08:41 -0400, Michael J. Ruhl wrote:
> From: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> rdma_nl_rcv_msg() checks to see if it should use the .dump() callback
> or the .doit() callback.  The check is done with this check:
> 
> if (flags & NLM_F_DUMP) ...
> 
> The NLM_F_DUMP flag is two bits (NLM_F_ROOT | NLM_F_MATCH).
> 
> When an RDMA_NL_LS message (response) is received, the bit used for
> indicating an error is the same bit as NLM_F_ROOT.
> 
> NLM_F_ROOT == (0x100) == RDMA_NL_LS_F_ERR.

What are the remaining flags in the failing error case?

Or to be more specific,

> 
>  	/* FIXME: Convert IWCM to properly handle doit callbacks */
>  	if ((nlh->nlmsg_flags & NLM_F_DUMP)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This test is technically faulty.  Since NLM_F_DUMP is a multi-bit flag,
it must be ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) to be
technically correct.  So, my question then becomes, if we correct this
test, will the RDMA_NL_LS_F_ERR return message still trigger this wrong
path?  I'd rather have a technically correct fix to this if statement
than a special case of the index value if possible.



-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-10-24 16:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 12:41 [PATCH] RDMA/netlink: OOPs in rdma_nl_rcv_msg() from misinterpreted flag Michael J. Ruhl
     [not found] ` <20171024123957.32207.70888.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-10-24 14:41   ` Leon Romanovsky
     [not found]     ` <20171024144152.GH16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-24 14:52       ` Ruhl, Michael J
     [not found]         ` <14063C7AD467DE4B82DEDB5C278E8663875E153D-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-24 15:19           ` Leon Romanovsky
     [not found]             ` <20171024151958.GI16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-24 15:42               ` Ruhl, Michael J
     [not found]                 ` <14063C7AD467DE4B82DEDB5C278E8663875E15AD-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-25 18:57                   ` Doug Ledford
     [not found]                     ` <1508957840.3325.54.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-25 19:06                       ` Leon Romanovsky
     [not found]                         ` <20171025190608.GX16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-25 19:17                           ` Doug Ledford
     [not found]                             ` <1508959048.3325.58.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-25 19:32                               ` Leon Romanovsky
2017-10-24 14:42   ` Shiraz Saleem
2017-10-24 16:31   ` Doug Ledford [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-19 21:40 Michael J. Ruhl
     [not found] ` <20171019213859.26124.37851.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-10-19 21:41   ` Michael J. Ruhl
2017-10-20  7:37   ` Leon Romanovsky
     [not found]     ` <20171020073724.GY2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-20 12:18       ` Wan, Kaike
     [not found]         ` <3F128C9216C9B84BB6ED23EF16290AFB6347E3BF-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-20 16:20           ` Leon Romanovsky
     [not found]             ` <20171020162017.GZ2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-20 19:04               ` Wan, Kaike
     [not found]                 ` <3F128C9216C9B84BB6ED23EF16290AFB6347E59B-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-23  5:54                   ` Leon Romanovsky
2017-10-20 17:20       ` Ruhl, Michael J
     [not found]         ` <14063C7AD467DE4B82DEDB5C278E8663875E0841-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-23  8:11           ` Leon Romanovsky
     [not found]             ` <20171023081117.GE2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-23 13:38               ` Ruhl, Michael J
2017-10-23 14:49               ` Doug Ledford
     [not found]                 ` <f03e51d6-4157-64b4-ec5d-9beac00ceb87-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-23 17:12                   ` Leon Romanovsky
     [not found]                     ` <20171023171211.GM2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-23 17:39                       ` Doug Ledford
     [not found]                         ` <1508780384.3325.13.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-23 18:03                           ` Leon Romanovsky
     [not found]                             ` <20171023180336.GQ2106-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-23 18:19                               ` Ruhl, Michael J
     [not found]                                 ` <14063C7AD467DE4B82DEDB5C278E8663875E0FE2-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-23 18:25                                   ` Leon Romanovsky
     [not found]                                     ` <20171023182504.GB16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-23 20:24                                       ` Ruhl, Michael J

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=1508862715.3325.22.camel@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@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