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]
Message-Id: <20090324.163630.226102764.davem@davemloft.net>
Date:	Tue, 24 Mar 2009 16:36:30 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	pazke@...pac.ru
Cc:	thierry.reding@...onic-design.de, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: Add support for the OpenCores 10/100 Mbps
 Ethernet MAC.

From: Andrey Panin <pazke@...pac.ru>
Date: Tue, 24 Mar 2009 14:13:59 +0300

> On 083, 03 24, 2009 at 11:18:43AM +0100, Thierry Reding wrote:
> > +static void ethoc_copy_to_io(void __iomem *dest, struct sk_buff *src)
> > +{
> > +	size_t size = (src->len & 0x3) ? (src->len & ~0x3) + 4 : src->len;
> > +	u8 buffer[ETHOC_BUFSIZ];
> 
> Using 1536 bytes of stack is not very nice.

Agreed, this stuff must be fixed.

You could use skb_copy_and_csum_dev() directly into your buffer, then
pad out the end of the buffer with a memset() call, if necessary.

Actually, no you can't...

You should not be using memcpy() to store things into I/O memory.
That's what memcpy_io() is for.

I think because of all of these special padding cases and the use
of I/O memory instead of DMA, there is no real gain by using
skb_copy_and_csum_dev() in this driver.  Just let the network
stack checksum the packet, and use memcpy_io() here which is
the currect interface for copying data into I/O memory.
--
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