<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/crypto/ccp, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=master</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2026-04-15T22:22:26Z</updated>
<entry>
<title>Merge tag 'v7.1-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6</title>
<updated>2026-04-15T22:22:26Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-04-15T22:22:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aec2f682d47c54ef434b2d440992626d80b1ebdc'/>
<id>urn:sha1:aec2f682d47c54ef434b2d440992626d80b1ebdc</id>
<content type='text'>
Pull crypto update from Herbert Xu:
 "API:
   - Replace crypto_get_default_rng with crypto_stdrng_get_bytes
   - Remove simd skcipher support
   - Allow algorithm types to be disabled when CRYPTO_SELFTESTS is off

  Algorithms:
   - Remove CPU-based des/3des acceleration
   - Add test vectors for authenc(hmac(md5),cbc({aes,des})) and
     authenc(hmac({md5,sha1,sha224,sha256,sha384,sha512}),rfc3686(ctr(aes)))
   - Replace spin lock with mutex in jitterentropy

  Drivers:
   - Add authenc algorithms to safexcel
   - Add support for zstd in qat
   - Add wireless mode support for QAT GEN6
   - Add anti-rollback support for QAT GEN6
   - Add support for ctr(aes), gcm(aes), and ccm(aes) in dthev2"

* tag 'v7.1-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (129 commits)
  crypto: af_alg - use sock_kmemdup in alg_setkey_by_key_serial
  crypto: vmx - remove CRYPTO_DEV_VMX from Kconfig
  crypto: omap - convert reqctx buffer to fixed-size array
  crypto: atmel-sha204a - add Thorsten Blum as maintainer
  crypto: atmel-ecc - add Thorsten Blum as maintainer
  crypto: qat - fix IRQ cleanup on 6xxx probe failure
  crypto: geniv - Remove unused spinlock from struct aead_geniv_ctx
  crypto: qce - simplify qce_xts_swapiv()
  crypto: hisilicon - Fix dma_unmap_single() direction
  crypto: talitos - rename first/last to first_desc/last_desc
  crypto: talitos - fix SEC1 32k ahash request limitation
  crypto: jitterentropy - replace long-held spinlock with mutex
  crypto: hisilicon - remove unused and non-public APIs for qm and sec
  crypto: hisilicon/qm - drop redundant variable initialization
  crypto: hisilicon/qm - remove else after return
  crypto: hisilicon/qm - add const qualifier to info_name in struct qm_cmd_dump_item
  crypto: hisilicon - fix the format string type error
  crypto: ccree - fix a memory leak in cc_mac_digest()
  crypto: qat - add support for zstd
  crypto: qat - use swab32 macro
  ...
</content>
</entry>
<entry>
<title>Merge tag 'x86_sev_for_v7.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2026-04-14T22:20:54Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-04-14T22:20:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=60b8d4d492815eed6d52646998167bc60dd94e5a'/>
<id>urn:sha1:60b8d4d492815eed6d52646998167bc60dd94e5a</id>
<content type='text'>
Pull x86 SEV updates from Borislav Petkov:

 - Change the SEV host code handling of when SNP gets enabled in order
   to allow the machine to claim SNP-related resources only when SNP
   guests are really going to be launched. The user requests this by
   loading the ccp module and thus it controls when SNP initialization
   is done

   So export an API which module code can call and do the necessary SNP
   setup only when really needed

 - Drop an unnecessary write-back and invalidate operation that was
   being performed too early, since the ccp driver already issues its
   own at the correct point in the initialization sequence

 - Drop the hotplug callbacks for enabling SNP on newly onlined CPUs,
   which were both architecturally unsound (the firmware rejects
   initialization if any CPU lacks the required configuration) and buggy
   (the MFDM SYSCFG MSR bit was not being set)

 - Code refactoring and cleanups to accomplish the above

* tag 'x86_sev_for_v7.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  crypto/ccp: Update HV_FIXED page states to allow freeing of memory
  crypto/ccp: Implement SNP x86 shutdown
  x86/sev, crypto/ccp: Move HSAVE_PA setup to arch/x86/
  x86/sev, crypto/ccp: Move SNP init to ccp driver
  x86/sev: Create snp_shutdown()
  x86/sev: Create snp_prepare()
  x86/sev: Create a function to clear/zero the RMP
  x86/sev: Rename SNP_FEATURES_PRESENT to SNP_FEATURES_IMPL
  x86/virt/sev: Keep the RMP table bookkeeping area mapped
  x86/virt/sev: Drop WBINVD before setting MSR_AMD64_SYSCFG_SNP_EN
  x86/virt/sev: Drop support for SNP hotplug
</content>
</entry>
<entry>
<title>crypto: ccp - Replace snprintf("%s") with strscpy</title>
<updated>2026-04-03T00:56:11Z</updated>
<author>
<name>Thorsten Blum</name>
<email>thorsten.blum@linux.dev</email>
</author>
<published>2026-03-24T11:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ee31b703e808f75a98b958305fbf2765a4e172a9'/>
<id>urn:sha1:ee31b703e808f75a98b958305fbf2765a4e172a9</id>
<content type='text'>
Replace snprintf("%s") with the faster and more direct strscpy().

Signed-off-by: Thorsten Blum &lt;thorsten.blum@linux.dev&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto/ccp: Update HV_FIXED page states to allow freeing of memory</title>
<updated>2026-03-30T10:10:05Z</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2026-03-24T16:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3aa64ab6a5ea553ee70526579908936a3ff9392'/>
<id>urn:sha1:c3aa64ab6a5ea553ee70526579908936a3ff9392</id>
<content type='text'>
After SNP is disabled, any pages allocated as HV_FIXED can now be freed.
Update the page state of these pages and the snp_leak_hv_fixed_pages()
function to free pages on SNP_SHUTDOWN.

Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Tycho Andersen (AMD) &lt;tycho@kernel.org&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Acked-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Link: https://patch.msgid.link/20260324161301.1353976-8-tycho@kernel.org
</content>
</entry>
<entry>
<title>crypto/ccp: Implement SNP x86 shutdown</title>
<updated>2026-03-30T10:02:12Z</updated>
<author>
<name>Tycho Andersen (AMD)</name>
<email>tycho@kernel.org</email>
</author>
<published>2026-03-24T16:13:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f995fc377ac7d3757e1d94e6403940c4b8f3d76e'/>
<id>urn:sha1:f995fc377ac7d3757e1d94e6403940c4b8f3d76e</id>
<content type='text'>
The SEV firmware has support to disable SNP during an SNP_SHUTDOWN_EX command.
Verify that this support is available and set the flag so that SNP is disabled
when it is not being used.

In cases where SNP is disabled, skip the call to amd_iommu_snp_disable(), as
all of the IOMMU pages have already been made shared. Also skip the panic
case, since snp_shutdown() does IPIs.

Signed-off-by: Tycho Andersen (AMD) &lt;tycho@kernel.org&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Acked-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Link: https://patch.msgid.link/20260324161301.1353976-7-tycho@kernel.org
</content>
</entry>
<entry>
<title>x86/sev, crypto/ccp: Move HSAVE_PA setup to arch/x86/</title>
<updated>2026-03-29T17:59:58Z</updated>
<author>
<name>Tycho Andersen (AMD)</name>
<email>tycho@kernel.org</email>
</author>
<published>2026-03-24T16:12:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7b2bc5f0ab983a7aad7fa5180cede4b3e91fc164'/>
<id>urn:sha1:7b2bc5f0ab983a7aad7fa5180cede4b3e91fc164</id>
<content type='text'>
Now that there is snp_prepare() that indicates when the CCP driver wants to
prepare the architecture for SNP_INIT(_EX), move this architecture-specific
bit of code to a more sensible place.

Signed-off-by: Tycho Andersen (AMD) &lt;tycho@kernel.org&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Link: https://patch.msgid.link/20260324161301.1353976-6-tycho@kernel.org
</content>
</entry>
<entry>
<title>x86/sev, crypto/ccp: Move SNP init to ccp driver</title>
<updated>2026-03-29T10:32:09Z</updated>
<author>
<name>Tycho Andersen (AMD)</name>
<email>tycho@kernel.org</email>
</author>
<published>2026-03-24T16:12:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=299933b118d1bcf8b93d58076aed34582718b0dd'/>
<id>urn:sha1:299933b118d1bcf8b93d58076aed34582718b0dd</id>
<content type='text'>
Use the new snp_prepare() to initialize SNP from the ccp driver instead of at
boot time. This means that SNP is not enabled unless it is really going to be
used (i.e. kvm_amd loads the ccp driver automatically).

Signed-off-by: Tycho Andersen (AMD) &lt;tycho@kernel.org&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Link: https://patch.msgid.link/20260324161301.1353976-5-tycho@kernel.org
</content>
</entry>
<entry>
<title>crypto: ccp - simplify sev_update_firmware()</title>
<updated>2026-03-14T05:03:19Z</updated>
<author>
<name>Tycho Andersen (AMD)</name>
<email>tycho@kernel.org</email>
</author>
<published>2026-03-02T15:02:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=35a89319f60a48fb8cd07617f8e2c4649edbe361'/>
<id>urn:sha1:35a89319f60a48fb8cd07617f8e2c4649edbe361</id>
<content type='text'>
sev_do_cmd() has its own command buffer (sev-&gt;cmd_buf) with the correct
alignment, perms, etc. that it copies the command into, so prepending it to
the firmware data is unnecessary.

Switch sev_update_firmware() to using a stack allocated command in light of
this copy, and drop all of the resulting pointer math.

Signed-off-by: Tycho Andersen (AMD) &lt;tycho@kernel.org&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Fix leaking the same page twice</title>
<updated>2026-03-14T05:01:37Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2026-03-04T20:39:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c52607c43c397b79a9852ce33fc61de58c3645c'/>
<id>urn:sha1:5c52607c43c397b79a9852ce33fc61de58c3645c</id>
<content type='text'>
Commit 551120148b67 ("crypto: ccp - Fix a case where SNP_SHUTDOWN is
missed") fixed a case where SNP is left in INIT state if page reclaim
fails. It removes the transition to the INIT state for this command and
adjusts the page state management.

While doing this, it added a call to snp_leak_pages() after a call to
snp_reclaim_pages() failed. Since snp_reclaim_pages() already calls
snp_leak_pages() internally on the pages it fails to reclaim, calling
it again leaks the exact same page twice.

Fix by removing the extra call to snp_leak_pages().

The problem was found by an experimental code review agent based on
gemini-3.1-pro while reviewing backports into v6.18.y.

Assisted-by: Gemini:gemini-3.1-pro
Fixes: 551120148b67 ("crypto: ccp - Fix a case where SNP_SHUTDOWN is missed")
Cc: Tycho Andersen (AMD) &lt;tycho@kernel.org&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Reviewed-by: Tycho Andersen (AMD) &lt;tycho@kernel.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Fix use-after-free on error path</title>
<updated>2026-02-28T03:51:58Z</updated>
<author>
<name>Alper Ak</name>
<email>alperyasinak1@gmail.com</email>
</author>
<published>2026-02-09T10:30:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=889b0e2721e793eb46cf7d17b965aa3252af3ec8'/>
<id>urn:sha1:889b0e2721e793eb46cf7d17b965aa3252af3ec8</id>
<content type='text'>
In the error path of sev_tsm_init_locked(), the code dereferences 't'
after it has been freed with kfree(). The pr_err() statement attempts
to access t-&gt;tio_en and t-&gt;tio_init_done after the memory has been
released.

Move the pr_err() call before kfree(t) to access the fields while the
memory is still valid.

This issue reported by Smatch static analyser

Fixes:4be423572da1 ("crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)")
Signed-off-by: Alper Ak &lt;alperyasinak1@gmail.com&gt;
Acked-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
