CVE-2022-49254: media: ti-vpe: cal: Fix a NULL pointer dereference in cal_ctx_v4l2_init_formats()
In the Linux kernel, the following vulnerability has been resolved:
media: ti-vpe: cal: Fix a NULL pointer dereference in calctxv4l2initformats()
In calctxv4l2initformats(), devmkzalloc() is assigned to ctx->activefmt and there is a dereference of it after that, which could lead to NULL pointer dereference on failure of devmkzalloc().
Fix this bug by adding a NULL check of ctx->activefmt.
This bug was found by a static analyzer.
Builds with 'make allyesconfig' show no new warnings, and our static analyzer no longer warns about this code.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.17.3-1 - Compensating control
In cal_ctx_v4l2_init_formats(), add a NULL check for ctx->active_fmt after devm_kzalloc() assigns it, before dereferencing it.