af_alg06 test from crypto test suite in LTP failed with kernel oops on B/C
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
Cosmic |
Won't Fix
|
Undecided
|
Po-Hsu Lin | ||
linux-aws (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Po-Hsu Lin | ||
Cosmic |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
== Justification ==
From the commit message:
Keys for "authenc" AEADs are formatted as an rtattr containing a 4-byte
'enckeylen', followed by an authentication key and an encryption key.
crypto_
However, it fails to consider the case where the rtattr's payload is
longer than 4 bytes but not 4-byte aligned, and where the key ends
before the next 4-byte aligned boundary. In this case, 'keylen -=
RTA_ALIGN(
causes a buffer overread and crash during crypto_
This error can be easily reproduced with the af_alg06 test in LTP test suite. (Basically it's the reproducer in the commit message)
== Fix ==
8f9c4693 (crypto: authenc - fix parsing key with misaligned rta_len)
This patch can be cherry-picked into B/C, and it's already in X/D/E.
== Test ==
Test kernels could be found here:
https:/
Both verified on a KVM node, this issue will no longer exist.
== Regression potential ==
Low, this patch just improves the checking for rtattr payload size to make sure it's the expected size. Also It has been upstream since 2018 Dec. and applied in some of our kernels. No subsequent bug report was filed against it.
== Original bug report ==
LTP: starting af_alg06
BUG: unable to handle kernel paging request at ffff9cbffffe0000
IP: sha256_
PGD 4d341067 P4D 4d341067 PUD 4d345067 PMD 4d346067 PTE 0
Oops: 0000 [#1] SMP PTI
Modules linked in: authenc algif_aead xfrm_user xfrm_algo sha3_generic algif_hash salsa20_generic algif_skcipher af_alg kvm_intel kvm irqbypass joydev input_leds serio_raw mac_hid sch_fq_codel ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_
CPU: 0 PID: 24368 Comm: af_alg06 Not tainted 4.15.0-50-generic #54-Ubuntu
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-
RIP: 0010:sha256_
RSP: 0018:ffffb58e83
RAX: 0000000000000034 RBX: ffff9cbffffe000c RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff9cbffffdffcc RDI: ffffb58e8344bca8
RBP: ffffb58e8344bbd0 R08: 000000001b6c96f6 R09: ffffb58e8344baa0
R10: 000000007a9a01a1 R11: 000000001ecb7428 R12: ffff9cc0f332c00c
R13: ffffb58e8344bca8 R14: ffff9cbff4d8d048 R15: ffff9cbff332c00c
FS: 00007f9f2a44d58
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff9cbffffe0000 CR3: 000000007c1da000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
sha256_
crypto_
crypto_
shash_
crypto_
hmac_
? tty_insert_
crypto_
? pty_write+0x71/0x90
shash_
crypto_
crypto_
crypto_
aead_
alg_setsockop
SyS_setsockop
do_syscall_
entry_
RIP: 0033:0x7f9f29f61e6a
RSP: 002b:00007ffdd0
RAX: ffffffffffffffda RBX: 00007f9f2a44d500 RCX: 00007f9f29f61e6a
RDX: 0000000000000001 RSI: 0000000000000117 RDI: 0000000000000006
RBP: 0000000000000006 R08: 0000000000000009 R09: 00007ffdd050b960
R10: 00007ffdd050ba4f R11: 0000000000000207 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: 000056456d64d908
Code: 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 81 ec 08 01 00 00 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 <8b> 14 06 0f ca 89 94 05 d0 fe ff ff 48 83 c0 04 48 83 f8 40 75
RIP: sha256_
CR2: ffff9cbffffe0000
---[ end trace ac2d55c95d4eed9d ]---
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: linux-image-
ProcVersionSign
Uname: Linux 4.15.0-50-generic x86_64
AlsaDevices:
total 0
crw-rw---- 1 root audio 116, 1 May 20 08:23 seq
crw-rw---- 1 root audio 116, 33 May 20 08:23 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
ApportVersion: 2.20.9-0ubuntu7.6
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
Date: Mon May 20 08:44:39 2019
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig': 'iwconfig'
Lsusb: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
PciMultimedia:
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=C.UTF-8
SHELL=/bin/bash
ProcFB: 0 cirrusdrmfb
ProcKernelCmdLine: BOOT_IMAGE=
RelatedPackageV
linux-
linux-
linux-firmware 1.173.6
RfKill: Error: [Errno 2] No such file or directory: 'rfkill': 'rfkill'
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/01/2014
dmi.bios.vendor: SeaBIOS
dmi.bios.version: Ubuntu-
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.
dmi.modalias: dmi:bvnSeaBIOS:
dmi.product.name: Standard PC (i440FX + PIIX, 1996)
dmi.product.
dmi.sys.vendor: QEMU
CVE References
Changed in linux (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Cosmic): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Cosmic): | |
status: | Fix Committed → Won't Fix |
Changed in linux-aws (Ubuntu Cosmic): | |
status: | New → Won't Fix |
Changed in linux-aws (Ubuntu Bionic): | |
status: | New → In Progress |
assignee: | nobody → Po-Hsu Lin (cypressyew) |
https:/ /github. com/torvalds/ linux/commit/ 8f9c46934848784 4328e162db57112 f7d347c49f