DEBIAN-CVE-2022-49271

Source
https://security-tracker.debian.org/tracker/CVE-2022-49271
Import Source
https://storage.googleapis.com/osv-test-debian-osv/debian-cve-osv/DEBIAN-CVE-2022-49271.json
JSON Data
https://api.test.osv.dev/v1/vulns/DEBIAN-CVE-2022-49271
Upstream
Published
2025-02-26T07:01:04Z
Modified
2025-09-25T23:28:13.667123Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

In the Linux kernel, the following vulnerability has been resolved: cifs: prevent bad output lengths in smb2ioctlqueryinfo() When calling smb2ioctlqueryinfo() with smbqueryinfo::flags=PASSTHRUFSCTL and smbqueryinfo::outputbufferlength=0, the following would return 0x10 buffer = memdupuser(arg + sizeof(struct smbqueryinfo), qi.outputbufferlength); if (ISERR(buffer)) { kfree(vars); return PTRERR(buffer); } rather than a valid pointer thus making ISERR() check fail. This would then cause a NULL ptr deference in @buffer when accessing it later in smb2ioctlqueryioctl(). While at it, prevent having a @buffer smaller than 8 bytes to correctly handle SMB2SETINFO FileEndOfFileInformation requests when smbqueryinfo::flags=PASSTHRUSETINFO. Here is a small C reproducer which triggers a NULL ptr in @buffer when passing an invalid smbqueryinfo::flags #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> #define die(s) perror(s), exit(1) #define QUERYINFO 0xc018cf07 int main(int argc, char *argv[]) { int fd; if (argc < 2) exit(1); fd = open(argv[1], ORDONLY); if (fd == -1) die("open"); if (ioctl(fd, QUERYINFO, (uint32t[]) { 0, 0, 0, 4, 0, 0}) == -1) die("ioctl"); close(fd); return 0; } mount.cifs //srv/share /mnt -o ... gcc repro.c && ./a.out /mnt/f0 [ 114.138620] general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN NOPTI [ 114.139310] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] [ 114.139775] CPU: 2 PID: 995 Comm: a.out Not tainted 5.17.0-rc8 #1 [ 114.140148] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014 [ 114.140818] RIP: 0010:smb2ioctlqueryinfo+0x206/0x410 [cifs] [ 114.141221] Code: 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 c8 01 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 7b 28 4c 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 9c 01 00 00 49 8b 3f e8 58 02 fb ff 48 8b 14 24 [ 114.142348] RSP: 0018:ffffc90000b47b00 EFLAGS: 00010256 [ 114.142692] RAX: dffffc0000000000 RBX: ffff888115503200 RCX: ffffffffa020580d [ 114.143119] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffffa043a380 [ 114.143544] RBP: ffff888115503278 R08: 0000000000000001 R09: 0000000000000003 [ 114.143983] R10: fffffbfff4087470 R11: 0000000000000001 R12: ffff888115503288 [ 114.144424] R13: 00000000ffffffea R14: ffff888115503228 R15: 0000000000000000 [ 114.144852] FS: 00007f7aeabdf740(0000) GS:ffff888151600000(0000) knlGS:0000000000000000 [ 114.145338] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 114.145692] CR2: 00007f7aeacfdf5e CR3: 000000012000e000 CR4: 0000000000350ee0 [ 114.146131] Call Trace: [ 114.146291] <TASK> [ 114.146432] ? smb2queryreparsetag+0x890/0x890 [cifs] [ 114.146800] ? cifsmapchar+0x460/0x460 [cifs] [ 114.147121] ? rcureadlockschedheld+0x3f/0x70 [ 114.147412] ? cifsstrnduptoutf16+0x15b/0x250 [cifs] [ 114.147775] ? dentrypathraw+0xa6/0xf0 [ 114.148024] ? cifsconvertpathtoutf16+0x198/0x220 [cifs] [ 114.148413] ? smb2checkmessage+0x1080/0x1080 [cifs] [ 114.148766] ? rcureadlockschedheld+0x3f/0x70 [ 114.149065] cifsioctl+0x1577/0x3320 [cifs] [ 114.149371] ? lockdowngrade+0x6f0/0x6f0 [ 114.149631] ? cifsreaddir+0x2e60/0x2e60 [cifs] [ 114.149956] ? rcureadlockschedheld+0x3f/0x70 [ 114.150250] ? _rseqhandlenotifyresume+0x80b/0xbe0 [ 114.150562] ? _upread+0x192/0x710 [ 114.150791] ? _ia32sysrseq+0xf0/0xf0 [ 114.151025] ? _x64sysopenat+0x11f/0x1d0 [ 114.151296] _x64sysioctl+0x127/0x190 [ 114.151549] dosyscall64+0x3b/0x90 [ 114.151768] entrySYSCALL64afterhwframe+0x44/0xae [ 114.152079] RIP: 0033:0x7f7aead043df [ 114.152306] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 ---truncated---

References

Affected packages

Debian:11 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.10.113-1

Affected versions

5.*

5.10.46-4
5.10.46-5
5.10.70-1~bpo10+1
5.10.70-1
5.10.84-1
5.10.92-1~bpo10+1
5.10.92-1
5.10.92-2
5.10.103-1~bpo10+1
5.10.103-1
5.10.106-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:12 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.17.3-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.17.3-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:14 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.17.3-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}