]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
char: applicom: fix NULL pointer dereference in ac_ioctl
authorTianchu Chen <flynnnchen@tencent.com>
Fri, 28 Nov 2025 07:53:23 +0000 (15:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:14 +0000 (12:57 +0100)
commitf83e3e9f89181b42f6076a115d767a7552c4a39e
tree9f1298e1e5f760635405f19bee1a84a0cc456f9a
parent687ccc341f63cf21a351faa2196c82f0c90aff6d
char: applicom: fix NULL pointer dereference in ac_ioctl

commit 82d12088c297fa1cef670e1718b3d24f414c23f7 upstream.

Discovered by Atuin - Automated Vulnerability Discovery Engine.

In ac_ioctl, the validation of IndexCard and the check for a valid
RamIO pointer are skipped when cmd is 6. However, the function
unconditionally executes readb(apbs[IndexCard].RamIO + VERS) at the
end.

If cmd is 6, IndexCard may reference a board that does not exist
(where RamIO is NULL), leading to a NULL pointer dereference.

Fix this by skipping the readb access when cmd is 6, as this
command is a global information query and does not target a specific
board context.

Signed-off-by: Tianchu Chen <flynnnchen@tencent.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: stable <stable@kernel.org>
Link: https://patch.msgid.link/20251128155323.a786fde92ebb926cbe96fcb1@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/applicom.c