]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
vsprintf: Fix potential unaligned access
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 27 Jan 2022 18:12:32 +0000 (20:12 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:13 +0000 (11:57 +0200)
commita6e7d766b5b509a1c299f6f930a4f84e8c3699bb
tree1f5354fd795be96938784d99edaaba01a7aec53b
parent0b28ab82ab89898a4e96732e425a91f9e93861f1
vsprintf: Fix potential unaligned access

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit d75b26f880f60ead301e79ba0f4a635c5a60767f ]

The %p4cc specifier in some cases might get an unaligned pointer.
Due to this we need to make copy to local variable once to avoid
potential crashes on some architectures due to improper access.

Fixes: af612e43de6d ("lib/vsprintf: Add support for printing V4L2 and DRM fourccs")
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20220127181233.72910-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 2305e3460b424342fd658d2e79f5b66aac3b0497)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
lib/vsprintf.c