{"id":"CVE-2022-50731","aliases":["CVE-2022-50731"],"related":[],"kind":"vulnerability","state":"published","title":"crypto: akcipher - default implementation for setting a private key","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: akcipher - default implementation for setting a private key\n\nChanges from v1:\n  * removed the default implementation from set_pub_key: it is assumed that\n    an implementation must always have this callback defined as there are\n    no use case for an algorithm, which doesn't need a public key\n\nMany akcipher implementations (like ECDSA) support only signature\nverifications, so they don't have all callbacks defined.\n\nCommit 78a0324f4a53 (\"crypto: akcipher - default implementations for\nrequest callbacks\") introduced default callbacks for sign/verify\noperations, which just return an error code.\n\nHowever, these are not enough, because before calling sign the caller would\nlikely call set_priv_key first on the instantiated transform (as the\nin-kernel testmgr does). This function does not have a default stub, so the\nkernel crashes, when trying to set a private key on an akcipher, which\ndoesn't support signature generation.\n\nI've noticed this, when trying to add a KAT vector for ECDSA signature to\nthe testmgr.\n\nWith this patch the testmgr returns an error in dmesg (as it should)\ninstead of crashing the kernel NULL ptr dereference.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: akcipher - default implementation for setting a private key\n\nChanges from v1:\n  * removed the default implementation from set_pub_key: it is assumed that\n    an implementation must always have this callback defined as there are\n    no use case for an algorithm, which doesn't need a public key\n\nMany akcipher implementations (like ECDSA) support only signature\nverifications, so they don't have all callbacks defined.\n\nCommit 78a0324f4a53 (\"crypto: akcipher - default implementations for\nrequest callbacks\") introduced default callbacks for sign/verify\noperations, which just return an error code.\n\nHowever, these are not enough, because before calling sign the caller would\nlikely call set_priv_key first on the instantiated transform (as the\nin-kernel testmgr does). This function does not have a default stub, so the\nkernel crashes, when trying to set a private key on an akcipher, which\ndoesn't support signature generation.\n\nI've noticed this, when trying to add a KAT vector for ECDSA signature to\nthe testmgr.\n\nWith this patch the testmgr returns an error in dmesg (as it should)\ninstead of crashing the kernel NULL ptr dereference.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ncrypto: akcipher - implementación predeterminada para establecer una clave privada\n\nCambios de la v1:\n  * se eliminó la implementación predeterminada de set_pub_key: se asume que\n    una implementación siempre debe tener esta devolución de llamada definida ya que no hay\n    ningún caso de uso para un algoritmo que no necesita una clave pública\n\nMuchas implementaciones de akcipher (como ECDSA) solo admiten verificaciones de firma,\npor lo que no tienen todas las devoluciones de llamada definidas.\n\nEl commit 78a0324f4a53 (’crypto: akcipher - implementaciones predeterminadas para\ndevoluciones de llamada de solicitud’) introdujo devoluciones de llamada predeterminadas para\noperaciones de firma/verificación, que simplemente devuelven un código de error.\n\nSin embargo, estas no son suficientes, porque antes de llamar a sign el llamador\nprobablemente llamaría primero a set_priv_key en la transformación instanciada\n(como lo hace el testmgr en el kernel). Esta función no tiene un stub predeterminado,\npor lo que el kernel se bloquea al intentar establecer una clave privada en un akcipher\nque no admite la generación de firmas.\n\nHe notado esto al intentar añadir un vector KAT para la firma ECDSA al testmgr.\n\nCon este parche el testmgr devuelve un error en dmesg (como debería)\nen lugar de bloquear el kernel por desreferencia de puntero NULL.","source":"nvd"}],"published":"2025-12-24T12:22:51.122Z","modified":"2026-11-10T12:10:00.177Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"78a0324f4a5328088fea9426cfe1d1851276c475","fixed":"95c4e20adc3ea00d1594a2a05d9b187ed12ffa8e","status":"affected"},{"type":"git","introduced":"78a0324f4a5328088fea9426cfe1d1851276c475","fixed":"a1354bdd191d533211b7cb723aa76a66f516f197","status":"affected"},{"type":"git","introduced":"78a0324f4a5328088fea9426cfe1d1851276c475","fixed":"779a9930f3e152c82699feb389a0e6d6644e747e","status":"affected"},{"type":"git","introduced":"78a0324f4a5328088fea9426cfe1d1851276c475","fixed":"85bc736a18b872f54912e8bb70682d11770aece0","status":"affected"},{"type":"git","introduced":"78a0324f4a5328088fea9426cfe1d1851276c475","fixed":"f9058178597059d6307efe96a7916600f8ede08c","status":"affected"},{"type":"git","introduced":"78a0324f4a5328088fea9426cfe1d1851276c475","fixed":"bc155c6c188c2f0c5749993b1405673d25a80389","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.2","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.2","status":"unaffected"},{"type":"semver","introduced":"5.4.220","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.150","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.75","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.19.17","lastAffected":"5.19.*","status":"unaffected"},{"type":"semver","introduced":"6.0.3","lastAffected":"6.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/95c4e20adc3ea00d1594a2a05d9b187ed12ffa8e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a1354bdd191d533211b7cb723aa76a66f516f197","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/779a9930f3e152c82699feb389a0e6d6644e747e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/85bc736a18b872f54912e8bb70682d11770aece0","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f9058178597059d6307efe96a7916600f8ede08c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bc155c6c188c2f0c5749993b1405673d25a80389","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-50731","url":"https://www.cve.org/CVERecord?id=CVE-2022-50731","licence":"CVE Terms of Use","modified":"2026-05-11T19:24:25.645Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-50731","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50731","licence":"Public domain","modified":"2026-11-10T12:10:00.177Z"}],"updatedAt":"2026-11-25T22:58:21.338Z","epss":{"score":0.00269,"percentile":0.20412,"date":"2026-12-01T12:00:22.000Z"}}