vsprintf: add new `%pA` format specifier
maillist inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5J75G CVE: NA Reference: https://lore.kernel.org/rust-for-linux/CANiq72nDcJLSB3pLhkdqGdLitfmqqCUVVfkY5EjP9AcwVv9B4A@mail.gmail.com/T/#t -------------------------------- This patch adds a format specifier `%pA` to `vsprintf` which formats a pointer as `core::fmt::Arguments`. Doing so allows us to directly format to the internal buffer of `printf`, so we do not have to use a temporary buffer on the stack to pre-assemble the message on the Rust side. This specifier is intended only to be used from Rust and not for C, so `checkpatch.pl` is intentionally unchanged to catch any misuse. Reviewed-by: NKees Cook <keescook@chromium.org> Acked-by: NPetr Mladek <pmladek@suse.com> Co-developed-by: NAlex Gaynor <alex.gaynor@gmail.com> Signed-off-by: NAlex Gaynor <alex.gaynor@gmail.com> Co-developed-by: NWedson Almeida Filho <wedsonaf@google.com> Signed-off-by: NWedson Almeida Filho <wedsonaf@google.com> Signed-off-by: NGary Guo <gary@garyguo.net> Co-developed-by: NMiguel Ojeda <ojeda@kernel.org> Signed-off-by: NMiguel Ojeda <ojeda@kernel.org> Signed-off-by: NWeilong Chen <chenweilong@huawei.com>
Showing
想要评论请 注册 或 登录