Thread (27 messages) 27 messages, 6 authors, 2014-10-25

Re: [PATCH v2 net] tcp: md5: do not use alloc_percpu()

From: David Miller <davem@davemloft.net>
Date: 2014-10-25 20:11:14

From: Eric Dumazet <redacted>
Date: Thu, 23 Oct 2014 12:58:58 -0700
From: Eric Dumazet <edumazet@google.com>

percpu tcp_md5sig_pool contains memory blobs that ultimately
go through sg_set_buf().

-> sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));

This requires that whole area is in a physically contiguous portion
of memory. And that @buf is not backed by vmalloc().

Given that alloc_percpu() can use vmalloc() areas, this does not
fit the requirements.

Replace alloc_percpu() by a static DEFINE_PER_CPU() as tcp_md5sig_pool
is small anyway, there is no gain to dynamically allocate it.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: 765cf9976e93 ("tcp: md5: remove one indirection level in tcp_md5sig_pool")
Reported-by: Crestez Dan Leonard <redacted>
Applied and queued up for -stable, thanks Eric.

Longer term we should do a proper shash/ahash conversion of the tcp md5
code, using the rules provided by Herbert Xu.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help