linux/net
Linus Torvalds d47db9bf50 Crypto library updates for 7.3
Add library APIs for most AES encryption modes that are used in the
 kernel (ECB, CBC, CBC-CTS, CTR, XCTR, XTS, GCM, CCM).
 
 These AES modes have many in-kernel users that are currently using the
 crypto_skcipher or crypto_aead APIs. These existing APIs are difficult
 to use and inefficient. Until now, the lack of proper library support
 for these has been the main gap in the crypto library.
 
 This set of changes is the next stage of addressing it:
 
   - Implement the new APIs on top of the existing support for
     single-block AES in the library.
 
   - Fully document the new APIs.
 
   - Migrate the only user of the old AES-GCM library API to the new,
     more flexible API; then remove the old API and its implementation.
 
   - Wire up the new APIs to the traditional crypto API by adding
     crypto_skcipher and crypto_aead algorithms.
 
     This makes the new APIs be covered by the traditional crypto API's
     self-tests. It also makes them be already used for real on systems
     that don't have architecture-optimized code for these modes.
 
     But most importantly, this is a prerequisite for migrating the
     architecture-optimized code for these AES modes (i.e.
     arch/*/crypto/aes*) into the library, which as usual will
     eliminate a lot of redundant "glue" code.
 
 Note that unlike some of the other algorithms that have been migrated
 to the library, e.g. SHA-512, for these AES modes there was too much
 to get done in one cycle. Nor did it make sense to handle these modes
 one at a time, because they tend to be coupled together or depend on
 each other, especially in the architecture-optimized AES code.
 
 Thus, most of the benefits (reductions in lines of code, performance
 improvements, etc.) will follow in later cycles when
 architecture-optimized code is migrated into the library and users of
 crypto_skcipher and crypto_aead are updated to use the new APIs.
 
 The design of the new APIs was informed by writing proof-of-concept
 patches for many kernel subsystems currently accessing these same
 algorithms via crypto_skcipher or crypto_aead (patches 18-33 of
 https://lore.kernel.org/r/20260707053503.209874-1-ebiggers@kernel.org/).
 
 While those patches will be resent for real later, the total diffstat
 for them was negative 1905 lines. So clearly the new APIs are quite a
 bit easier to use and align better with what users actually need.
 
 Besides the new AES encryption APIs, there are also a few changes for
 improved AES-CMAC key and context zeroization.
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQSacvsUNc7UX4ntmEPzXCl4vpKOKwUCaoEqhRQcZWJpZ2dlcnNA
 a2VybmVsLm9yZwAKCRDzXCl4vpKOKy8YAP4o44z09KdugtigFIFX7qQnLk0uPAw+
 sTPqmu+FA4jOGAD/Vy23hzAVpWmSBFhyo7HMK9W0ABK7cqj6x23I/N6JRgM=
 =SLPT
 -----END PGP SIGNATURE-----

Merge tag 'libcrypto-updates-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux

Pull crypto library updates from Eric Biggers:
 "Add library APIs for most AES encryption modes that are used in the
  kernel (ECB, CBC, CBC-CTS, CTR, XCTR, XTS, GCM, CCM).

  These AES modes have many in-kernel users that are currently using the
  crypto_skcipher or crypto_aead APIs. These existing APIs are difficult
  to use and inefficient. Until now, the lack of proper library support
  for these has been the main gap in the crypto library.

  This set of changes is the next stage of addressing it:

   - Implement the new APIs on top of the existing support for
     single-block AES in the library.

   - Fully document the new APIs.

   - Migrate the only user of the old AES-GCM library API to the new,
     more flexible API; then remove the old API and its implementation.

   - Wire up the new APIs to the traditional crypto API by adding
     crypto_skcipher and crypto_aead algorithms.

     This makes the new APIs be covered by the traditional crypto API's
     self-tests. It also makes them be already used for real on systems
     that don't have architecture-optimized code for these modes.

     But most importantly, this is a prerequisite for migrating the
     architecture-optimized code for these AES modes (i.e.
     arch/*/crypto/aes*) into the library, which as usual will eliminate
     a lot of redundant "glue" code.

  Note that unlike some of the other algorithms that have been migrated
  to the library, e.g. SHA-512, for these AES modes there was too much
  to get done in one cycle. Nor did it make sense to handle these modes
  one at a time, because they tend to be coupled together or depend on
  each other, especially in the architecture-optimized AES code.

  Thus, most of the benefits (reductions in lines of code, performance
  improvements, etc.) will follow in later cycles when
  architecture-optimized code is migrated into the library and users of
  crypto_skcipher and crypto_aead are updated to use the new APIs.

  The design of the new APIs was informed by writing proof-of-concept
  patches for many kernel subsystems currently accessing these same
  algorithms via crypto_skcipher or crypto_aead (patches 18-33 of
  https://lore.kernel.org/r/20260707053503.209874-1-ebiggers@kernel.org/).

  While those patches will be resent for real later, the total diffstat
  for them was negative 1905 lines. So clearly the new APIs are quite a
  bit easier to use and align better with what users actually need.

  Besides the new AES encryption APIs, there are also a few changes for
  improved AES-CMAC key and context zeroization"

* tag 'libcrypto-updates-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux:
  mac80211: fils_aead: Use __cleanup() instead of memzero_explicit()
  Bluetooth: SMP: clear the aes_cmac_key when done
  smb: clear the aes_cmac_key and aes_cmac_ctx when done
  lib/crypto: aes-cmac: Add zeroization functions
  lib/crypto: aesgcm: Remove old AES-GCM library
  x86/sev: Remove obsolete virtual address check
  x86/sev: Use new AES-GCM library
  crypto: aes - Add CCM support using library
  crypto: aes - Add GCM support using library
  crypto: aes - Add XTS support using library
  crypto: aes - Add CTR and XCTR support using library
  crypto: aes - Add CBC and CBC-CTS support using library
  crypto: aes - Add ECB support using library
  lib/crypto: aes: Add CCM support
  lib/crypto: aes: Add GCM support
  lib/crypto: aes: Add XTS support
  lib/crypto: aes: Add CTR and XCTR support
  lib/crypto: aes: Add CBC and CBC-CTS support
  lib/crypto: aes: Add ECB support
  crypto: xts - Split out __xts_verify_key() helper
2026-08-17 19:16:42 -07:00
..
6lowpan 6lowpan: fix NHC entry use-after-free on error path 2026-06-11 15:27:07 -07:00
9p 9p: Add missing read barrier in virtio zero-copy path 2026-06-21 05:22:57 +00:00
802 appletalk: move the protocol out of tree 2026-06-16 14:37:06 -07:00
8021q vlan: defer real device state propagation to netdev_work 2026-06-25 10:18:40 -07:00
atm net/atm: fix slab-out-of-bounds read in vcc_setsockopt() 2026-08-06 09:29:14 -07:00
batman-adv batman-adv: dat: fix tie-break for candidate selection 2026-07-06 07:18:59 +02:00
bluetooth Crypto library updates for 7.3 2026-08-17 19:16:42 -07:00
bpf bpf: Fix partial copy of non-linear test_run output 2026-06-21 17:55:06 -07:00
bridge netfilter: bridge: release template ct on non-IP path 2026-08-10 20:14:01 +02:00
can can: isotp: check register_netdevice_notifier() error in module init 2026-07-29 11:26:41 +02:00
ceph libceph: Avoid using invalid osd indices from primary_temp 2026-08-12 21:21:41 +02:00
core There is a known WiFi/mt76 regression, waiting for a complete fix that 2026-08-13 08:37:26 -07:00
dcb Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
devlink devlink: fix net namespace reference leak in reload 2026-07-31 18:23:44 -07:00
dns_resolver net/dns_resolver: use kasprintf + kmemdup_nul to simplify dns_query 2026-06-04 18:39:29 -07:00
dsa net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
ethernet bonding: prevent potential infinite loop in bond_header_parse() 2026-03-16 19:29:45 -07:00
ethtool ethtool: rss: Fix hfunc and input_xfrm parsing on big endian 2026-07-09 11:38:30 +02:00
handshake handshake: Require admin permission for DONE command 2026-06-12 15:45:44 -07:00
hsr net: hsr: fix memory leak on slave unregistration by removing synced VLANs 2026-07-22 10:24:44 -07:00
ieee802154 ieee802154: allow legacy LLSEC ADD/DEL ops to pass strict validation 2026-06-19 23:02:42 +02:00
ife net: ife: require ETH_HLEN to be pullable in ife_decode() 2026-06-13 17:34:39 -07:00
ipv4 There is a known WiFi/mt76 regression, waiting for a complete fix that 2026-08-13 08:37:26 -07:00
ipv6 ip6_tunnel: clear skb2->cb[] in ip6ip6_err() 2026-08-05 17:30:38 -07:00
iucv net/af_iucv: fix NULL deref in afiucv_hs_callback_syn() 2026-07-21 13:36:35 -07:00
kcm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-16 14:59:58 -07:00
key ipsec-2026-06-22 2026-06-23 16:22:24 -07:00
l2tp l2tp: fix tunnel and session refcount leak on seq_file release 2026-08-13 11:49:31 +02:00
l3mdev
lapb treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
llc llc: fix SAP refcount leak when creating incoming sockets 2026-07-17 13:17:46 +02:00
mac80211 Crypto library updates for 7.3 2026-08-17 19:16:42 -07:00
mac802154 mac802154: fix netdev use-after-free in beacon worker 2026-08-05 17:12:50 -07:00
mctp mctp: check register_netdevice_notifier() error in mctp_device_init() 2026-07-23 09:17:36 -07:00
mpls net: mpls: initialize rtm_tos in mpls_getroute() 2026-07-28 11:06:06 +02:00
mptcp mptcp: reclaim forward-allocated memory on RX path errors 2026-08-06 08:46:24 -07:00
ncsi net/ncsi: fix heap OOB read in NCSI_CMD_SEND_CMD payload length 2026-08-05 17:24:57 -07:00
netfilter There is a known WiFi/mt76 regression, waiting for a complete fix that 2026-08-13 08:37:26 -07:00
netlabel Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-06-11 14:33:35 -07:00
netlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-05-28 14:02:21 -07:00
nfc nfc: nci: uart: Constify struct tty_ldisc_ops 2026-06-11 20:21:32 +02:00
nsh
openvswitch net: openvswitch: reallocate update replies for mismatched IDs 2026-08-04 18:19:50 -07:00
packet af_packet: Don't send zero-byte data in tpacket_snd(). 2026-08-11 17:32:53 -07:00
phonet phonet: check register_netdevice_notifier() error in phonet_device_init() 2026-07-23 10:28:50 -07:00
psample net: psample: fix info leak in PSAMPLE_ATTR_DATA 2026-06-17 16:35:50 -07:00
psp psp: fix NULL genl_sock deref race with concurrent netns teardown 2026-07-29 16:48:16 -07:00
qrtr net: qrtr: ns: Raise lookup limit to 128 2026-08-06 08:10:44 -07:00
rds rds: tcp: hold the RCU lock across ipv6_chk_addr() in rds_tcp_laddr_check() 2026-07-23 14:11:37 -07:00
rfkill Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
rxrpc rxrpc: fix io_thread race in rxrpc_wake_up_io_thread() 2026-07-21 11:52:29 +02:00
sched net/sched: cls_bpf: reject dev-bound programs bound to a different device 2026-08-13 11:08:39 +02:00
sctp sctp: fix use-after-free of cached ASCONF chunk 2026-08-12 17:54:42 -07:00
shaper net: shaper: add a note that we expect cap dumps to be tiny 2026-06-11 12:55:23 +02:00
smc net/smc: fix TOCTOU race between smc_listen_out() and listener close 2026-08-06 13:35:41 +02:00
strparser net: strparser: fix skb_head leak in strp_abort_strp() 2026-04-14 12:37:00 +02:00
sunrpc SUNRPC: pin upper rpc_clnt across the TLS connect_worker 2026-07-08 14:07:19 -04:00
switchdev bridge: No DEV_PATH_BR_VLAN_UNTAG_HW for dsa foreign 2026-03-19 13:14:00 +01:00
tipc tipc: read le->link under the node lock in tipc_node_link_down() 2026-08-11 15:50:22 +02:00
tls net/tls: Fail tls_sw_splice_read() after a failed async decrypt 2026-08-11 15:39:00 +02:00
unix vfs-7.3-rc1.kthread 2026-08-17 11:35:12 -07:00
vmw_vsock vsock/virtio: avoid refilling the RX queue after teardown 2026-08-03 16:28:58 -07:00
wireless wifi: cfg80211: publish PMSR request before starting the driver 2026-07-28 15:08:57 +02:00
x25 net/x25: fix use-after-free of the socket by its timers 2026-07-30 18:46:45 -07:00
xdp xsk: validate metadata when processing requests 2026-08-03 16:43:54 -07:00
xfrm xfrm: policy: preallocate inexact bins before xfrm_hash_rebuild reinsert 2026-07-06 08:30:02 +02:00
compat.c net: Remove support for AIO on sockets 2026-05-29 14:05:30 +08:00
devres.c
Kconfig appletalk: move the protocol out of tree 2026-06-16 14:37:06 -07:00
Kconfig.debug
Makefile appletalk: move the protocol out of tree 2026-06-16 14:37:06 -07:00
socket.c fs: Add bpf_sock_read_xattr() kfunc to read socket xattrs 2026-06-29 10:31:14 +02:00
sysctl_net.c