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
Unknown Object (File)
Sat, Jun 15, 7:41 PM
Unknown Object (File)
Sun, Jun 2, 2:37 AM
Unknown Object (File)
May 10 2024, 11:38 PM
Unknown Object (File)
May 2 2024, 1:03 PM
Unknown Object (File)
Apr 28 2024, 5:48 PM
Unknown Object (File)
Apr 21 2024, 9:38 PM
Unknown Object (File)
Apr 19 2024, 11:50 AM
Unknown Object (File)
Apr 6 2024, 2: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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable