Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • crypto
  • crypto_user.c
Find file BlameHistoryPermalink
  • Eric Biggers's avatar
    crypto: user - support incremental algorithm dumps · e43fa247
    Eric Biggers authored Dec 06, 2018
    BugLink: https://bugs.launchpad.net/bugs/1855313
    
    [ Upstream commit 0ac6b8fb ]
    
    CRYPTO_MSG_GETALG in NLM_F_DUMP mode sometimes doesn't return all
    registered crypto algorithms, because it doesn't support incremental
    dumps.  crypto_dump_report() only permits itself to be called once, yet
    the netlink subsystem allocates at most ~64 KiB for the skb being dumped
    to.  Thus only the first recvmsg() returns data, and it may only include
    a subset of the crypto algorithms even if the user buffer passed to
    recvmsg() is large enough to hold all of them.
    
    Fix this by using one of the arguments in the netlink_callback structure
    to keep track of the current position in the algorithm list.  Then
    userspace can do multiple recvmsg() on the socket after sending the dump
    request.  This is the way netlink dumps work elsewhere in the kernel;
    it's unclear why this was different (probably just an oversight).
    
    Also fix an integer overflow when calculating the dump buffer size hint.
    
    Fixes: a38f7907
    
     ("crypto: Add userspace configuration API")
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
    Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
    e43fa247
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7