vsprintf: Fix potential unaligned access
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 27 Jan 2022 18:12:32 +0000 (20:12 +0200)
committerPetr Mladek <pmladek@suse.com>
Thu, 10 Feb 2022 12:16:50 +0000 (13:16 +0100)
commitd75b26f880f60ead301e79ba0f4a635c5a60767f
tree5c99a6af6518edb2f07237cc519dbf41f479bf56
parenta229327733b86aa585effdb0d27a87b12aa51597
vsprintf: Fix potential unaligned access

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