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:	Mon, 30 Jan 2012 11:49:11 -0500
From:	Viral Mehta <viral.vkm@...il.com>
To:	Wei Liu <wei.liu2@...rix.com>
Cc:	netdev@...r.kernel.org, xen-devel@...ts.xensource.com,
	ian.campbell@...rix.com, konrad.wilk@...cle.com
Subject: Re: [RFC PATCH V3 04/16] netback: switch to per-cpu scratch space.

Hi,

On Mon, Jan 30, 2012 at 9:45 AM, Wei Liu <wei.liu2@...rix.com> wrote:
>
>        skb_queue_head_init(&rxq);
> @@ -534,13 +527,16 @@ void xen_netbk_rx_action(struct xen_netbk *netbk)
>                        break;
>        }
>
> -       BUG_ON(npo.meta_prod > ARRAY_SIZE(netbk->meta));
> +       BUG_ON(npo.meta_prod > MAX_PENDING_REQS);

While you are already here,
how about having WARN_ON() ?

>
> -       if (!npo.copy_prod)
> +       if (!npo.copy_prod) {
> +               put_cpu_ptr(gco);
> +               put_cpu_ptr(m);
>                return;
> +       }
>
> -       BUG_ON(npo.copy_prod > ARRAY_SIZE(netbk->grant_copy_op));
> -       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, &netbk->grant_copy_op,
> +       BUG_ON(npo.copy_prod > (2 * XEN_NETIF_RX_RING_SIZE));

And may be here, too...

If there is serious bug, may be system will crash at a later point
But, IMHO, WARN_ON() is the correct function for drivers at least.

> +       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, gco,
>                                        npo.copy_prod);
>        BUG_ON(ret != 0);
>
-- 
Thanks,
Viral Mehta
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ