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 12:23:16 +0000 (14:23 +0200)
commit2305e3460b424342fd658d2e79f5b66aac3b0497
treed4de08544546c3d2f30121d7cc9b7a86eaf96be3
parentb4c8675a710ab9fcfef06cff6e0123aaae742c38
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