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-next>] [day] [month] [year] [list]
Message-ID: <1389774152-1526-1-git-send-email-mst@redhat.com>
Date:	Wed, 15 Jan 2014 10:26:08 +0200
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	netdev@...r.kernel.org, Guenter Roeck <linux@...ck-us.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	David Miller <davem@...emloft.net>,
	Rusty Russell <rusty@...tcorp.com.au>,
	virtualization@...ts.linux-foundation.org
Subject: [PATCH stable-only] virtio-net: fix build on m68k and sparc64

As a result of backporting a bugfix, virtio_net started passing void *
to page_address, assuming that it will get silently converted to struct
page *. But this does not happen on architectures where page_address is
a macro, the result is build failure as the macro tries to dereference
void*.

Fix by reordering code slightly, so we always pass
struct page * to page_address.

Reported-by: Guenter Roeck <linux@...ck-us.net>
Tested-by: Guenter Roeck <linux@...ck-us.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: David Miller <davem@...emloft.net>
Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
---

David, Greg asked that this be put in stable ASAP to avoid
next release being broken.
I still didn't Cc stable directly as I know you prefer to do this
yourself.
Sorry about creating this mess, could you help fast-path it there please?

Thanks!

 drivers/net/virtio_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b8665588..c8d5ee1 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -330,9 +330,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
 					 void *buf,
 					 unsigned int len)
 {
-	struct skb_vnet_hdr *hdr = page_address(buf);
-	int num_buf = hdr->mhdr.num_buffers;
 	struct page *page = buf;
+	struct skb_vnet_hdr *hdr = page_address(page);
+	int num_buf = hdr->mhdr.num_buffers;
 	struct sk_buff *skb = page_to_skb(rq, page, len);
 	int i;
 
-- 
MST
--
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