* [rcar:gmsl/dev 23/23] lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.
@ 2020-02-11 6:04 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2020-02-11 6:04 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3359 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head: 93aef18a872beaf24093f699268e56a484e31f64
commit: 93aef18a872beaf24093f699268e56a484e31f64 [23/23] lib: vsprint debug-ptrval
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.
Old smatch warnings:
lib/vsprintf.c:1405 ip6_compressed_string() warn: possible spectre second half. '*p'
lib/vsprintf.c:1408 ip6_compressed_string() warn: possible spectre second half. '*p'
# https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/?id=93aef18a872beaf24093f699268e56a484e31f64
git remote add rcar https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git
git remote update rcar
git checkout 93aef18a872beaf24093f699268e56a484e31f64
vim +800 lib/vsprintf.c
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 789)
9073dac14e397f Geert Uytterhoeven 2018-10-11 790 static char *ptr_to_id(char *buf, char *end, const void *ptr,
9073dac14e397f Geert Uytterhoeven 2018-10-11 791 struct printf_spec spec)
9073dac14e397f Geert Uytterhoeven 2018-10-11 792 {
9073dac14e397f Geert Uytterhoeven 2018-10-11 793 const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)";
9073dac14e397f Geert Uytterhoeven 2018-10-11 794 unsigned long hashval;
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 795) int ret;
9073dac14e397f Geert Uytterhoeven 2018-10-11 796
93aef18a872bea Laurent Pinchart 2020-02-10 797 return pointer_string(buf, end, ptr, spec);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93aef18a872bea Laurent Pinchart 2020-02-10 798
9073dac14e397f Geert Uytterhoeven 2018-10-11 799 /* When debugging early boot use non-cryptographically secure hash. */
9073dac14e397f Geert Uytterhoeven 2018-10-11 @800 if (unlikely(debug_boot_weak_hash)) {
9073dac14e397f Geert Uytterhoeven 2018-10-11 801 hashval = hash_long((unsigned long)ptr, 32);
9073dac14e397f Geert Uytterhoeven 2018-10-11 802 return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 803 }
9073dac14e397f Geert Uytterhoeven 2018-10-11 804
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 805) ret = __ptr_to_hashval(ptr, &hashval);
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 806) if (ret) {
9073dac14e397f Geert Uytterhoeven 2018-10-11 807 spec.field_width = 2 * sizeof(ptr);
9073dac14e397f Geert Uytterhoeven 2018-10-11 808 /* string length must be less than default_width */
c8c3b584343cb7 Petr Mladek 2019-04-17 809 return error_string(buf, end, str, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 810 }
9073dac14e397f Geert Uytterhoeven 2018-10-11 811
9073dac14e397f Geert Uytterhoeven 2018-10-11 812 return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 813 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 2+ messages in thread* [rcar:gmsl/dev 23/23] lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.
@ 2020-02-11 6:04 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2020-02-11 6:04 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3359 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head: 93aef18a872beaf24093f699268e56a484e31f64
commit: 93aef18a872beaf24093f699268e56a484e31f64 [23/23] lib: vsprint debug-ptrval
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.
Old smatch warnings:
lib/vsprintf.c:1405 ip6_compressed_string() warn: possible spectre second half. '*p'
lib/vsprintf.c:1408 ip6_compressed_string() warn: possible spectre second half. '*p'
# https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/?id=93aef18a872beaf24093f699268e56a484e31f64
git remote add rcar https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git
git remote update rcar
git checkout 93aef18a872beaf24093f699268e56a484e31f64
vim +800 lib/vsprintf.c
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 789)
9073dac14e397f Geert Uytterhoeven 2018-10-11 790 static char *ptr_to_id(char *buf, char *end, const void *ptr,
9073dac14e397f Geert Uytterhoeven 2018-10-11 791 struct printf_spec spec)
9073dac14e397f Geert Uytterhoeven 2018-10-11 792 {
9073dac14e397f Geert Uytterhoeven 2018-10-11 793 const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)";
9073dac14e397f Geert Uytterhoeven 2018-10-11 794 unsigned long hashval;
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 795) int ret;
9073dac14e397f Geert Uytterhoeven 2018-10-11 796
93aef18a872bea Laurent Pinchart 2020-02-10 797 return pointer_string(buf, end, ptr, spec);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93aef18a872bea Laurent Pinchart 2020-02-10 798
9073dac14e397f Geert Uytterhoeven 2018-10-11 799 /* When debugging early boot use non-cryptographically secure hash. */
9073dac14e397f Geert Uytterhoeven 2018-10-11 @800 if (unlikely(debug_boot_weak_hash)) {
9073dac14e397f Geert Uytterhoeven 2018-10-11 801 hashval = hash_long((unsigned long)ptr, 32);
9073dac14e397f Geert Uytterhoeven 2018-10-11 802 return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 803 }
9073dac14e397f Geert Uytterhoeven 2018-10-11 804
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 805) ret = __ptr_to_hashval(ptr, &hashval);
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 806) if (ret) {
9073dac14e397f Geert Uytterhoeven 2018-10-11 807 spec.field_width = 2 * sizeof(ptr);
9073dac14e397f Geert Uytterhoeven 2018-10-11 808 /* string length must be less than default_width */
c8c3b584343cb7 Petr Mladek 2019-04-17 809 return error_string(buf, end, str, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 810 }
9073dac14e397f Geert Uytterhoeven 2018-10-11 811
9073dac14e397f Geert Uytterhoeven 2018-10-11 812 return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 813 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-11 6:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-11 6:04 [rcar:gmsl/dev 23/23] lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code Dan Carpenter
2020-02-11 6:04 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.