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] [day] [month] [year] [list]
Date:	Sun, 22 Jul 2007 23:46:12 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Adrian Bunk <bunk@...sta.de>
CC:	Jeremy Fitzhardinge <jeremy@...source.com>,
	Chris Wright <chrisw@...s-sol.org>,
	Jeff Garzik <jeff@...zik.org>, xen-devel@...ts.xensource.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: drivers/net/xen-netfront.c: bogus code

Adrian Bunk wrote:
> The Coverity checker spotted the following bogus code
> in drivers/net/xen-netfront.c:
>
> <--  snip  -->
>
> ...
> static void xennet_alloc_rx_buffers(struct net_device *dev)
> {
> ...
>         for (nr_flips = i = 0; ; i++) {
>                 skb = __skb_dequeue(&np->rx_batch);
>                 if (skb == NULL)
>                         break;
>
>                 skb->dev = dev;
>
>                 id = xennet_rxidx(req_prod + i);
>
>                 BUG_ON(np->rx_skbs[id]);
>                 np->rx_skbs[id] = skb;
>
>                 ref = gnttab_claim_grant_reference(&np->gref_rx_head);
>                 BUG_ON((signed short)ref < 0);
>                 np->grant_rx_ref[id] = ref;
>
>                 pfn = page_to_pfn(skb_shinfo(skb)->frags[0].page);
>                 vaddr = page_address(skb_shinfo(skb)->frags[0].page);
>
>                 req = RING_GET_REQUEST(&np->rx, req_prod + i);
>                 gnttab_grant_foreign_access_ref(ref,
>                                                 np->xbdev->otherend_id,
>                                                 pfn_to_mfn(pfn),
>                                                 0);
>
>                 req->id = id;
>                 req->gref = ref;
>         }
>
>         if (nr_flips != 0) {
> ...
>
> <--  snip  -->
>
> Note that "nr_flips" is always 0 in the last line.
>   

Thanks.  That's probably a residual from me removing the page-flipping
code.  I'll give it another pass.

    J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ