CVE-2022-49940

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49940
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49940.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49940
Downstream
Related
Published
2025-06-18T11:15:20Z
Modified
2025-08-09T19:01:28Z
Summary
[none]
Details

In the Linux kernel, the following vulnerability has been resolved:

tty: ngsm: add sanity check for gsm->receive in gsmreceive_buf()

A null pointer dereference can happen when attempting to access the "gsm->receive()" function in gsmldreceivebuf(). Currently, the code assumes that gsm->recieve is only called after MUX activation. Since the gsmldreceivebuf() function can be accessed without the need to initialize the MUX, the gsm->receive() function will not be set and a NULL pointer dereference will occur.

Fix this by avoiding the call to "gsm->receive()" in case the function is not initialized by adding a sanity check.

Call Trace: <TASK> gsmldreceivebuf+0x1c2/0x2f0 drivers/tty/ngsm.c:2861 tiocsti drivers/tty/ttyio.c:2293 [inline] ttyioctl+0xa75/0x15d0 drivers/tty/ttyio.c:2692 vfsioctl fs/ioctl.c:51 [inline] _dosysioctl fs/ioctl.c:870 [inline] _sesysioctl fs/ioctl.c:856 [inline] _x64sysioctl+0x193/0x200 fs/ioctl.c:856 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x35/0xb0 arch/x86/entry/common.c:80 entrySYSCALL64afterhwframe+0x63/0xcd

References

Affected packages