Page MenuHomeFreeBSD

aesni: Avoid a potential out-of-bounds load in aes_encrypt_icm()
ClosedPublic

Authored by markj on Aug 30 2021, 5:40 PM.
Tags
None
Referenced Files
F163071002: D31730.diff
Sun, Jul 19, 7:56 PM
Unknown Object (File)
Tue, Jul 14, 6:13 AM
Unknown Object (File)
Tue, Jul 14, 1:45 AM
Unknown Object (File)
Wed, Jul 1, 2:24 PM
Unknown Object (File)
Jun 20 2026, 2:45 AM
Unknown Object (File)
May 19 2026, 10:54 AM
Unknown Object (File)
May 17 2026, 5:30 PM
Unknown Object (File)
May 17 2026, 5:24 PM
Subscribers

Details

Summary

Given a partial block at the end of a payload, aes_encrypt_icm() would
perform a 16-byte load of the residual into a temporary variable. This
is unsafe in principle since the full block may cross a page boundary.
Fix the problem by copying up to the end of input into a stack variable
and operating on that instead.

Reported by: syzbot+b7e44cde9e2e89f0f6c9@syzkaller.appspotmail.com
Reported by: syzbot+4b5eaf123a99456b5160@syzkaller.appspotmail.com

Test Plan

cryptocheck (which is also able to trigger the panic with KASAN enabled)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 41265
Build 38154: arc lint + arc unit