public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "Michael J. Ruhl"
	<michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Subject: Re: [PATCH 2/2] ibacm: Incorrect list used for subnet list causes a segfault.
Date: Mon, 16 Oct 2017 07:58:16 +0300	[thread overview]
Message-ID: <20171016045816.GB2106@mtr-leonro.local> (raw)
In-Reply-To: <20171013184352.28410.32200.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>

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

On Fri, Oct 13, 2017 at 02:43:52PM -0400, Michael J. Ruhl wrote:
> From: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> When using the ibacm from rdma-core commit bf03566e0aa976afc5df,

That commit is unrelated to ibacm. I think that we can remove this line.

> setting the provider keyword in the ibacm_opts.cfg file to something
> other than 'default' will cause ibacm to segfault on startup:
>
> ibacm[32739]: segfault at 302e40 ip 000000000040432d
> sp 00007ffe4039e1c0 error 4 in ibacm[400000+c000]
>
> To re-produce the segfault, change the provider keyword in
> ibacm_opts.cfg from:
>
> provider ibacmp default
>
> to:
>
> provider ibacmp 0xFE80000000000000
>
> When adding subnets to a provider subnet list, the incorrect list is
> used.  The list used is the provider_list (list of all providers)
> rather than the (specific) provider subnet list.
>
> This corrupts the provider_list, and causes ibacm to crash with the
> above segfault.
>
> Use the correct list when adding subnet information to a provider.
>
> Fixes: 26e05f8304a506 ("ibacm: use ccan/list.h")
> Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  ibacm/src/acm.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
> index 1ccef94..a67001d 100644
> --- a/ibacm/src/acm.c
> +++ b/ibacm/src/acm.c
> @@ -2587,8 +2587,8 @@ static void acm_load_prov_config(void)
>  					return;
>  				}
>  				subnet->subnet_prefix = htobe64(prefix);
> -				list_add_after(&provider_list, &prov->entry,
> -						&subnet->entry);
> +				list_add_tail(&prov->subnet_list,
> +					      &subnet->entry);
>  			}
>  		}
>  	}
>
> --
> 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

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

  parent reply	other threads:[~2017-10-16  4:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 18:43 [PATCH 1/2] ibacm: Incorrect usage of BE byte order of MLID attach/detach_mcast() Michael J. Ruhl
     [not found] ` <20171013184347.28410.87093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-10-13 18:43   ` [PATCH 2/2] ibacm: Incorrect list used for subnet list causes a segfault Michael J. Ruhl
     [not found]     ` <20171013184352.28410.32200.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-10-16  4:58       ` Leon Romanovsky [this message]
2017-10-13 19:37   ` [PATCH 1/2] ibacm: Incorrect usage of BE byte order of MLID attach/detach_mcast() Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A82373AB19E97E-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-13 20:34       ` Ruhl, Michael J
2017-10-16  4:56   ` Leon Romanovsky
  -- strict thread matches above, loose matches on Subject: below --
2017-10-16 14:19 Michael J. Ruhl
     [not found] ` <20171016141945.11276.1068.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-10-16 14:19   ` [PATCH 2/2] ibacm: Incorrect list used for subnet list causes a segfault Michael J. Ruhl
     [not found]     ` <20171016141950.11276.59779.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-10-16 14:22       ` 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=20171016045816.GB2106@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=sean.hefty-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