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]
Date:   Wed, 28 Jun 2023 17:57:39 +0000
From:   "Keller, Jacob E" <jacob.e.keller@...el.com>
To:     Shannon Nelson <shannon.nelson@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>
CC:     "brett.creeley@....com" <brett.creeley@....com>,
        "drivers@...sando.io" <drivers@...sando.io>,
        "nitya.sunkad@....com" <nitya.sunkad@....com>
Subject: RE: [PATCH net] ionic: remove WARN_ON to prevent panic_on_warn



> -----Original Message-----
> From: Shannon Nelson <shannon.nelson@....com>
> Sent: Wednesday, June 28, 2023 10:01 AM
> To: netdev@...r.kernel.org; davem@...emloft.net; kuba@...nel.org
> Cc: brett.creeley@....com; drivers@...sando.io; nitya.sunkad@....com;
> Shannon Nelson <shannon.nelson@....com>
> Subject: [PATCH net] ionic: remove WARN_ON to prevent panic_on_warn
> 
> From: Nitya Sunkad <nitya.sunkad@....com>
> 
> Remove instances of WARN_ON to prevent problematic panic_on_warn use
> resulting in kernel panics.
> 

This message could potentially use a bit more explanation since it doesn't look like you removed all the WARN_ONs in the driver, and it might help to explain why this particular WARN_ON was problematic. I don't think that would be worth a re-roll on its own though.

> Fixes: 77ceb68e29cc ("ionic: Add notifyq support")
> Signed-off-by: Nitya Sunkad <nitya.sunkad@....com>
> Signed-off-by: Shannon Nelson <shannon.nelson@....com>
> ---
>  drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> index 7c20a44e549b..d401d86f1f7a 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> @@ -475,7 +475,9 @@ static void ionic_qcqs_free(struct ionic_lif *lif)
>  static void ionic_link_qcq_interrupts(struct ionic_qcq *src_qcq,
>  				      struct ionic_qcq *n_qcq)
>  {
> -	if (WARN_ON(n_qcq->flags & IONIC_QCQ_F_INTR)) {
> +	if (n_qcq->flags & IONIC_QCQ_F_INTR) {
> +		dev_warn(n_qcq->q.dev, "%s: n_qcq->flags and
> IONIC_QCQ_F_INTR set\n",
> +			 __func__);

What calls this function? It feels a bit weird that the only action this code takes was in a WARN_ON state. Definitely agree this shouldn't be WARN_ON.

WARN_ON is something which should be used for a highly unexpected state that we are unsure of how to recover from (even if you go on to further protect bad accesses in order to avoid completely hosing the system when not on a panic_on_warn system).

This change makes sense to me.

Reviewed-by: Jacob Keller <Jacob.e.keller@...el.com>

Thanks,
Jake

>  		ionic_intr_free(n_qcq->cq.lif->ionic, n_qcq->intr.index);
>  		n_qcq->flags &= ~IONIC_QCQ_F_INTR;
>  	}
> --
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ