summaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-06-06 15:08:51 +0200
committerPaolo Abeni <pabeni@redhat.com>2023-06-08 13:42:34 +0200
commitf9e7a5fa51fbb6fcb9c1c7e2c89dd7df9e7fe253 (patch)
tree6d2a6e60bbd02b449b4e2fa68e028e1d1f25a57a /include/crypto
parentMove netfs_extract_iter_to_sg() to lib/scatterlist.c (diff)
downloadlinux-f9e7a5fa51fbb6fcb9c1c7e2c89dd7df9e7fe253.tar.xz
linux-f9e7a5fa51fbb6fcb9c1c7e2c89dd7df9e7fe253.zip
crypto: af_alg: Pin pages rather than ref'ing if appropriate
Convert AF_ALG to use iov_iter_extract_pages() instead of iov_iter_get_pages(). This will pin pages or leave them unaltered rather than getting a ref on them as appropriate to the iterator. The pages need to be pinned for DIO-read rather than having refs taken on them to prevent VM copy-on-write from malfunctioning during a concurrent fork() (the result of the I/O would otherwise end up only visible to the child process and not the parent). Signed-off-by: David Howells <dhowells@redhat.com> cc: Herbert Xu <herbert@gondor.apana.org.au> cc: "David S. Miller" <davem@davemloft.net> cc: Eric Dumazet <edumazet@google.com> cc: Jakub Kicinski <kuba@kernel.org> cc: Paolo Abeni <pabeni@redhat.com> cc: Jens Axboe <axboe@kernel.dk> cc: Matthew Wilcox <willy@infradead.org> cc: linux-crypto@vger.kernel.org cc: netdev@vger.kernel.org Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/if_alg.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index 7e76623f9ec3..46494b33f5bc 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -59,6 +59,7 @@ struct af_alg_sgl {
struct scatterlist sg[ALG_MAX_PAGES + 1];
struct page *pages[ALG_MAX_PAGES];
unsigned int npages;
+ bool need_unpin;
};
/* TX SGL entry */