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:   Sun, 6 Jun 2021 07:48:17 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Xianting Tian <xianting_tian@....com>
Cc:     mst@...hat.com, jasowang@...hat.com, davem@...emloft.net,
        kuba@...nel.org, linux-kernel@...r.kernel.org,
        virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
        Xianting Tian <xianting.tian@...ux.alibaba.com>
Subject: Re: [PATCH] [v2] virtio_net: Remove BUG() to avoid machine dead

On Sat, Jun 05, 2021 at 11:31:00AM -0400, Xianting Tian wrote:
> From: Xianting Tian <xianting.tian@...ux.alibaba.com>
> 
> We should not directly BUG() when there is hdr error, it is
> better to output a print when such error happens. Currently,
> the caller of xmit_skb() already did it.
> 
> Signed-off-by: Xianting Tian <xianting.tian@...ux.alibaba.com>
> ---
>  drivers/net/virtio_net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 9b6a4a8..7f11ea4 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1623,7 +1623,7 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb)
>  	if (virtio_net_hdr_from_skb(skb, &hdr->hdr,
>  				    virtio_is_little_endian(vi->vdev), false,
>  				    0))
> -		BUG();
> +		return -EPROTO;

Yeah, as we discussed, BUG*() macros in non-core code that checks
in-kernel API better to be deleted.

Thanks,
Reviewed-by: Leon Romanovsky <leonro@...dia.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ