[lkml]   [2003]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectcryptoapi incorrect struct page usage
It seems that cryptoapi usage wrt mm is not safe. At least both ipsec 
and cryptoloop practise these kinds of things :

example from net/xfrm/xfrm_algo.c

skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset,
int len)
int start = skb_headlen(skb);
int i, copy = start - offset;
int elt = 0;

if (copy > 0) {
if (copy > len)
copy = len;
sg[elt].page = virt_to_page(skb->data + offset);
sg[elt].offset = (unsigned long)(skb->data + offset) % PAGE_SIZE;
sg[elt].length = copy;

so unpinned pages are passed to cryptoapi. Nothing prevents these pages
from being swapped out. Something like get_user_pages() is needed to pin
these pages for the duration of crypto operations. Comments?


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:47    [W:0.031 / U:3.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site