]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:46 +0000 (13:57 +0200)
commitfc624fa3a68333a8c87d368d5b8135d117add6d4
treee8b94408603756594e48025304d7ece8cfafddac
parent14b91b5575171c3f0f7165224e547f4276b3b8d7
vsprintf: Fix potential unaligned access

[ 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>
lib/vsprintf.c