lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250917021550.47243-1-dyl_wlc@163.com>
Date: Wed, 17 Sep 2025 10:15:50 +0800
From: YanLong Dai <dyl_wlc@....com>
To: leon@...nel.org
Cc: daiyanlong@...inos.cn,
	dyl_wlc@....com,
	jgg@...pe.ca,
	kalesh-anakkur.purayil@...adcom.com,
	linux-kernel@...r.kernel.org,
	linux-rdma@...r.kernel.org,
	selvin.xavier@...adcom.com
Subject: Re: [PATCH] drivers: fix the exception was not returned

On Tue, Sep 16, 2025 at 04:49:15PM +0300, Leon Romanovsky wrote:
> On Tue, Sep 16, 2025 at 05:11:54PM +0800, YanLong Dai wrote:
> > From: daiyanlong <daiyanlong@...inos.cn>
> > 
> > The return value rc of bnxt_qplib_destroy_qp is abnormal and no return
> 
> And what is wrong with that? This is expected behavior - do not fail if
> destroy fails.

Thank you for the feedback! I understand your perspective that destroy operations should ideally complete cleanup whenever possible.

However, while reviewing the related code, I noticed a consistency detail:
In the bnxt_re_destroy_gsi_sqp() function within the same file (drivers/infiniband/hw/bnxt_re/ib_verbs.c), the error handling for bnxt_qplib_destroy_qp() is different:

static void bnxt_re_destroy_gsi_sqp(struct bnxt_re_qp *qp)
{
    ...
    rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp);
    if (rc) {
        ibdev_err(...);  // <- logs a warning here
        goto fail;       // <- returns immediately without further cleanup
    }
    bnxt_qplib_free_qp_res(&rdev->qplib_res, &qp->qplib_qp); // <- cleans up resources
	
fail:
	return rc;
}

Whereas in the function addressed by the current patch:

static int bnxt_re_destroy_qp(...)
{
    ...
    rc = bnxt_qplib_destroy_qp(&qp->qplib_qp);
	if (rc)
		ibdev_err(&rdev->ibdev, "Failed to destroy HW QP");

    // no check of rc, proceeds directly to cleanup
    bnxt_qplib_free_qp_res(&qp->qplib_qp);
}

My consideration is:
If bnxt_qplib_free_qp_res() is called after bnxt_qplib_destroy_qp() fails, could this potentially lead to 

This might be a minor robustness concern in the code. Of course, you as the maintainer have the best understanding of the code context. If this is an intentional design decision, please feel free to disregard my suggestion.

Thank you for your time!
YanLong


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ