patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dkozlyuk@oss.nvidia.com>
To: David Marchand <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>,
	Matan Azrad <matan@oss.nvidia.com>,
	"Slava Ovsiienko" <viacheslavo@oss.nvidia.com>,
	"Xueming(Steven) Li" <xuemingl@oss.nvidia.com>,
	Jack Min <jackmin@oss.nvidia.com>
Subject: Re: [dpdk-stable] [PATCH] net/mlx5: do not close stdin on error
Date: Tue, 19 Oct 2021 20:57:30 +0000	[thread overview]
Message-ID: <CH0PR12MB5091EABC7557EDC710BD5D95B9BD9@CH0PR12MB5091.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20211014113718.12487-1-david.marchand@redhat.com>

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: 14 октября 2021 г. 14:37
> To: dev@dpdk.org
> Cc: Dmitry Kozlyuk <dkozlyuk@nvidia.com>; stable@dpdk.org; Matan Azrad
> <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>;
> Xueming(Steven) Li <xuemingl@nvidia.com>; Jack Min <jackmin@nvidia.com>
> Subject: [PATCH] net/mlx5: do not close stdin on error
> 
> External email: Use caution opening links or attachments
> 
> 
> If for any reason, a socket could not be opened, mlx5_pmd_socket_init()
> could close the 0 fd (which is valid, and has a fair chance to be stdin),
> since server_socket == 0 from the variable being in .bss.
> 
> Fixes: e6cdc54cc0ef ("net/mlx5: add socket server for external tools")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Thanks for taking care of this.
Reviewed-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>

> ---

Depends-on: patch-101572 ("net/mlx5: close tools socket with the last device")

[...]
>         if (mlx5_pmd_interrupt_handler_install()) {
>                 DRV_LOG(WARNING, "cannot register interrupt handler for
> mlx5 socket: %s",
>                         strerror(errno));

Another bug, `errno` doesn't hold the error code here.
I'll fix it in the follow-up.

> -               goto close;
> +               goto remove;
>         }
>         return 0;
> -close:
> +remove:
>         remove(sun.sun_path);
> -error:
> +close:
>         claim_zero(close(server_socket));
> -       server_socket = 0;
> +       server_socket = -1;
> +error:
>         DRV_LOG(ERR, "Cannot initialize socket: %s", strerror(errno));
>         return -errno;
>  }


  reply	other threads:[~2021-10-19 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 11:37 David Marchand
2021-10-19 20:57 ` Dmitry Kozlyuk [this message]
2021-11-01  8:55 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh

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=CH0PR12MB5091EABC7557EDC710BD5D95B9BD9@CH0PR12MB5091.namprd12.prod.outlook.com \
    --to=dkozlyuk@oss.nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jackmin@oss.nvidia.com \
    --cc=matan@oss.nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@oss.nvidia.com \
    --cc=xuemingl@oss.nvidia.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).