Re: [SECURITY PATCH 114/117] kern/misc: Add function to check printf() format against expected format

2021-03-17 Thread Colin Watson
On Tue, Mar 02, 2021 at 07:02:01PM +0100, Daniel Kiper wrote: > @@ -1121,6 +1159,42 @@ grub_xasprintf (const char *fmt, ...) >return ret; > } > > +grub_err_t > +grub_printf_fmt_check (const char *fmt, const char *fmt_expected) > +{ > + struct printf_args args_expected, args_fmt; > +

[SECURITY PATCH 114/117] kern/misc: Add function to check printf() format against expected format

2021-03-02 Thread Daniel Kiper
From: Thomas Frauendorfer | Miray Software The grub_printf_fmt_check() function parses the arguments of an untrusted printf() format and an expected printf() format and then compares the arguments counts and arguments types. The arguments count in the untrusted format string must be less or