mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] scatterlist: introduce sg_nents_for_len
@ 2015-06-01 16:15 Tom Lendacky
  2015-06-01 16:15 ` [PATCH v1 1/2] " Tom Lendacky
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tom Lendacky @ 2015-06-01 16:15 UTC (permalink / raw)
  To: linux-crypto; +Cc: David Miller, linux-kernel, Herbert Xu

This series introduces and makes use of a new scatterlist function named
sg_nents_for_len. The purpose of this function is determine the number
of scatterlist entries required to satisify a specified length. The
resulting count can be used as input to the dma_map_sg function to map
only the entries needed.

This function is needed for cases where a supplied scatterlist has not
marked the last filled sg entry as the end of the scatterlist. In these
cases, the sg_nents function count includes sg entries that may not have
been filled in. When using this value in a dma_map_sg call it can result
in errors/bugs being generated.

The following patches are included in this series:
- Introduce the sg_nents_for_len function
- Update the ccp driver to use the sg_nents_for_len function

This patch series is based on cryptodev-2.6.

---

Tom Lendacky (2):
      scatterlist: introduce sg_nents_for_len
      crypto: ccp - Protect against poorly marked end of sg list


 drivers/crypto/ccp/ccp-ops.c |    7 +++++--
 include/linux/scatterlist.h  |    1 +
 lib/scatterlist.c            |   32 ++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 2 deletions(-)

-- 
Tom Lendacky

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-03  5:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 16:15 [PATCH v1 0/2] scatterlist: introduce sg_nents_for_len Tom Lendacky
2015-06-01 16:15 ` [PATCH v1 1/2] " Tom Lendacky
2015-06-01 16:15 ` [PATCH v1 2/2] crypto: ccp - Protect against poorly marked end of sg list Tom Lendacky
2015-06-03  5:09 ` [PATCH v1 0/2] scatterlist: introduce sg_nents_for_len Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®