* [patch 1/4] E100: fix interaction with swiotlb on X86.
2009-09-11 0:31 ` [patch 0/4] 2.6.27.34-stable review Greg KH
@ 2009-09-11 0:29 ` Greg KH
2009-09-11 0:29 ` [patch 2/4] net: net_assign_generic() fix Greg KH
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-09-11 0:29 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Krzysztof HaÅasa,
David S. Miller
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: e100-fix-interaction-with-swiotlb-on-x86.patch --]
[-- Type: text/plain, Size: 1627 bytes --]
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Krzysztof Hałasa <khc@pm.waw.pl>
[ Upstream commit 6ff9c2e7fa8ca63a575792534b63c5092099c286 ]
E100 places it's RX packet descriptors inside skb->data and uses them
with bidirectional streaming DMA mapping. Data in descriptors is
accessed simultaneously by the chip (writing status and size when
a packet is received) and CPU (reading to check if the packet was
received). This isn't a valid usage of PCI DMA API, which requires use
of the coherent (consistent) memory for such purpose. Unfortunately e100
chips working in "simplified" RX mode have to store received data
directly after the descriptor. Fixing the driver to conform to the API
would require using unsupported "flexible" RX mode or receiving data
into a coherent memory and using CPU to copy it to network buffers.
This patch, while not yet making the driver conform to the PCI DMA API,
allows it to work correctly on X86 with swiotlb (while not breaking
other architectures).
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/e100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1842,7 +1842,7 @@ static int e100_rx_indicate(struct nic *
nic->ru_running = RU_SUSPENDED;
pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr,
sizeof(struct rfd),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_FROMDEVICE);
return -ENODATA;
}
^ permalink raw reply [flat|nested] 5+ messages in thread* [patch 2/4] net: net_assign_generic() fix
2009-09-11 0:31 ` [patch 0/4] 2.6.27.34-stable review Greg KH
2009-09-11 0:29 ` [patch 1/4] E100: fix interaction with swiotlb on X86 Greg KH
@ 2009-09-11 0:29 ` Greg KH
2009-09-11 0:29 ` [patch 3/4] JFFS2: add missing verify buffer allocation/deallocation Greg KH
2009-09-11 0:29 ` [patch 4/4] slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-09-11 0:29 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Eric Dumazet,
Pavel Emelyanov, David S. Miller
[-- Attachment #1: net-net_assign_generic-fix.patch --]
[-- Type: text/plain, Size: 951 bytes --]
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <eric.dumazet@gmail.com>
[ Upstream commit 144586301f6af5ae5943a002f030d8c626fa4fdd ]
memcpy() should take into account size of pointers,
not only number of pointers to copy.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/core/net_namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -446,7 +446,7 @@ int net_assign_generic(struct net *net,
ng->len = id;
INIT_RCU_HEAD(&ng->rcu);
- memcpy(&ng->ptr, &old_ng->ptr, old_ng->len);
+ memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*));
rcu_assign_pointer(net->gen, ng);
call_rcu(&old_ng->rcu, net_generic_release);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch 3/4] JFFS2: add missing verify buffer allocation/deallocation
2009-09-11 0:31 ` [patch 0/4] 2.6.27.34-stable review Greg KH
2009-09-11 0:29 ` [patch 1/4] E100: fix interaction with swiotlb on X86 Greg KH
2009-09-11 0:29 ` [patch 2/4] net: net_assign_generic() fix Greg KH
@ 2009-09-11 0:29 ` Greg KH
2009-09-11 0:29 ` [patch 4/4] slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-09-11 0:29 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Massimo Cirillo,
Artem Bityutskiy, David Woodhouse
[-- Attachment #1: jffs2-add-missing-verify-buffer-allocation-deallocation.patch --]
[-- Type: text/plain, Size: 1387 bytes --]
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Massimo Cirillo <maxcir@gmail.com>
commit bc8cec0dff072f1a45ce7f6b2c5234bb3411ac51 upstream.
The function jffs2_nor_wbuf_flash_setup() doesn't allocate the verify buffer
if CONFIG_JFFS2_FS_WBUF_VERIFY is defined, so causing a kernel panic when
that macro is enabled and the verify function is called. Similarly the
jffs2_nor_wbuf_flash_cleanup() must free the buffer if
CONFIG_JFFS2_FS_WBUF_VERIFY is enabled.
The following patch fixes the problem.
The following patch applies to 2.6.30 kernel.
Signed-off-by: Massimo Cirillo <maxcir@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/jffs2/wbuf.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -1271,10 +1271,20 @@ int jffs2_nor_wbuf_flash_setup(struct jf
if (!c->wbuf)
return -ENOMEM;
+#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
+ c->wbuf_verify = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
+ if (!c->wbuf_verify) {
+ kfree(c->wbuf);
+ return -ENOMEM;
+ }
+#endif
return 0;
}
void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c) {
+#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
+ kfree(c->wbuf_verify);
+#endif
kfree(c->wbuf);
}
^ permalink raw reply [flat|nested] 5+ messages in thread* [patch 4/4] slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU
2009-09-11 0:31 ` [patch 0/4] 2.6.27.34-stable review Greg KH
` (2 preceding siblings ...)
2009-09-11 0:29 ` [patch 3/4] JFFS2: add missing verify buffer allocation/deallocation Greg KH
@ 2009-09-11 0:29 ` Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-09-11 0:29 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Eric Dumazet,
Paul E. McKenney, Pekka Enberg
[-- Attachment #1: slub-fix-kmem_cache_destroy-with-slab_destroy_by_rcu.patch --]
[-- Type: text/plain, Size: 1375 bytes --]
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Eric Dumazet <eric.dumazet@gmail.com>
commit d76b1590e06a63a3d8697168cd0aabf1c4b3cb3a upstream.
kmem_cache_destroy() should call rcu_barrier() *after* kmem_cache_close() and
*before* sysfs_slab_remove() or risk rcu_free_slab() being called after
kmem_cache is deleted (kfreed).
rmmod nf_conntrack can crash the machine because it has to kmem_cache_destroy()
a SLAB_DESTROY_BY_RCU enabled cache.
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
mm/slub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2447,8 +2447,6 @@ static inline int kmem_cache_close(struc
*/
void kmem_cache_destroy(struct kmem_cache *s)
{
- if (s->flags & SLAB_DESTROY_BY_RCU)
- rcu_barrier();
down_write(&slub_lock);
s->refcount--;
if (!s->refcount) {
@@ -2459,6 +2457,8 @@ void kmem_cache_destroy(struct kmem_cach
"still has objects.\n", s->name, __func__);
dump_stack();
}
+ if (s->flags & SLAB_DESTROY_BY_RCU)
+ rcu_barrier();
sysfs_slab_remove(s);
} else
up_write(&slub_lock);
^ permalink raw reply [flat|nested] 5+ messages in thread