Commit 553e41d
binfmt_elf_fdpic: clean up debug warnings
The binfmt_elf_fdpic loader has some debug trace that can be enabled at
build time. The recent 64-bit additions cause some warnings if that
debug is enabled, such as:
fs/binfmt_elf_fdpic.c: In function ‘elf_fdpic_map_file’:
fs/binfmt_elf_fdpic.c:46:33: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘Elf64_Addr’ {aka ‘long long unsigned int’} [-Wformat=]
46 | #define kdebug(fmt, ...) printk("FDPIC "fmt"\n" ,##__VA_ARGS__ )
| ^~~~~~~~
./include/linux/printk.h:427:25: note: in definition of macro ‘printk_index_wrap’
427 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
Cast values to the largest possible type (which is equivilent to unsigned
long long in this case) and use appropriate format specifiers to match.
Fixes: b922bf0 ("binfmt_elf_fdpic: support 64-bit systems")
Signed-off-by: Greg Ungerer <gerg@kernel.org>
Link: https://lore.kernel.org/r/20230927132933.3290734-1-gerg@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>1 parent 2632bb8 commit 553e41d
1 file changed
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
903 | | - | |
| 903 | + | |
904 | 904 | | |
905 | | - | |
906 | | - | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
907 | 909 | | |
908 | 910 | | |
909 | 911 | | |
| |||
1082 | 1084 | | |
1083 | 1085 | | |
1084 | 1086 | | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1088 | 1091 | | |
1089 | 1092 | | |
1090 | 1093 | | |
| |||
1146 | 1149 | | |
1147 | 1150 | | |
1148 | 1151 | | |
1149 | | - | |
1150 | | - | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1151 | 1155 | | |
1152 | 1156 | | |
1153 | 1157 | | |
| |||
0 commit comments