linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Leon Romanovsky <leon@kernel.org>, David Ahern <dsahern@gmail.com>
Cc: Mark Zhang <markz@mellanox.com>, netdev <netdev@vger.kernel.org>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Leon Romanovsky <leonro@mellanox.com>
Subject: Re: [PATCH iproute2-next] rdma: Check comm string before print in print_comm()
Date: Sun, 15 Sep 2019 11:47:19 -0600	[thread overview]
Message-ID: <241c3bdf-53bf-a828-c57a-034b16f4839a@gmail.com> (raw)
In-Reply-To: <20190911081243.28917-1-leon@kernel.org>

On 9/11/19 2:12 AM, Leon Romanovsky wrote:
> From: Mark Zhang <markz@mellanox.com>
> 
> Broken kernels (not-upstream) can provide wrong empty "comm" field.
> It causes to segfault while printing in JSON format.
> 
> Fixes: 8ecac46a60ff ("rdma: Add QP resource tracking information")

that commit is from 2018, so this should go to master; re-assigned in
patchwork.

> Signed-off-by: Mark Zhang <markz@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  rdma/res.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/rdma/res.c b/rdma/res.c
> index 97a7b964..6003006e 100644
> --- a/rdma/res.c
> +++ b/rdma/res.c
> @@ -161,6 +161,9 @@ void print_comm(struct rd *rd, const char *str, struct nlattr **nla_line)
>  {
>  	char tmp[18];
>  
> +	if (!str)
> +		return;
> +
>  	if (rd->json_output) {
>  		/* Don't beatify output in JSON format */
>  		jsonw_string_field(rd->jw, "comm", str);
> 


  reply	other threads:[~2019-09-15 17:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11  8:12 [PATCH iproute2-next] rdma: Check comm string before print in print_comm() Leon Romanovsky
2019-09-15 17:47 ` David Ahern [this message]
2019-09-16  5:25   ` Leon Romanovsky

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=241c3bdf-53bf-a828-c57a-034b16f4839a@gmail.com \
    --to=dsahern@gmail.com \
    --cc=leon@kernel.org \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=markz@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).