fix: enable early printing of hashed pointers
Subsystems (4)
cover fix: enable early printing of hashed pointers
Hi Ted,
Sending this set to you because it fixes the recent patch set applied to your random-next branch.
This set includes changes already posted on LKML as
[PATCH v9 0/4] enable early printing of hashed pointers
Since I'm a massive noob I did not realise that since v7 of this set was applied to random-next already that doing incremental versions was pointless.
So, this set is the changes done in v8 and v9 of the above patch set. I have retained the acked-by tag from Randy for the docs fixes. Attribution for pointing out the issues has been 'lost in translation', I'll buy you guys a beer one day instead ...
With this set applied linux-next still throws a build warning
lib/vsprintf.c:1667:13: warning: ‘have_filled_random_ptr_key’ defined but not used [-Wunused-variable]
This is fixed by another patch currently in flight ([PATCH] "vsprintf:
fix build warning" - thanks Arnd).
Epic amounts of confusion, solely caused as usual by myself.
thanks,
Tobin.
Tobin C. Harding (3):
random: Remove unnecessary cast
vsprintf: Remove incorrect EXPORT_SYMBOL
docs: Fix docs for boot parameter debug_boot_weak_hash
Documentation/admin-guide/kernel-parameters.txt | 13 ++++++------- drivers/char/random.c | 2 +- lib/vsprintf.c | 1 - 3 files changed, 7 insertions(+), 9 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 random: Remove unnecessary cast
Currently we are casting an argument to the macro min_t(). This is unnecessary since the macro already includes a cast.
Remove unnecessary cast from argument to macro min_t()
--- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/random.c +1 -1
@@ -1736,7 +1736,7 @@ int __must_check get_random_bytes_arch(void *buf, int nbytes)trace_get_random_bytes_arch (left, _RET_IP_);while (left) {unsigned long v; -int chunk =min_t (int, left, (int )sizeof (unsigned long )); +int chunk =min_t (int, left,sizeof (unsigned long ));if (!arch_get_random_long (&v))break ;
Signature · 1 line
2.17.1
Re: [PATCH 1/3] random: Remove unnecessary cast
Quoted 6 lines · On Tue, 10 Jul 2018 10:25:17 +1000 "Tobin C. Harding" <[email protected]> wrote:
Currently we are casting an argument to the macro
min_t(). This is unnecessary since the macro already includes a cast.Remove unnecessary cast from argument to macro
min_t()Signed-off-by Tobin C. Harding <[email protected]>
-- Steve
Quoted 17 lines
--- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/char/random.c +1
-1@@ -1736,7 +1736,7 @@ int __must_check get_random_bytes_arch(void *buf, int nbytes)trace_get_random_bytes_arch (left, _RET_IP_);while (left) {unsigned long v; -int chunk =min_t (int, left, (int )sizeof (unsigned long )); +int chunk =min_t (int, left,sizeof (unsigned long ));if (!arch_get_random_long (&v))break ;
PATCH 2/3 vsprintf: Remove incorrect EXPORT_SYMBOL
In reply to Tobin C. HardingRecently boot variable 'debug_boot_weak_hash' was added (by me). In a classic case of cargo cult programming the novice developer added a macro call to EXPORT_SYMBOL(). This is wrong and was pointed out on LKML. As pointed out EXPORT_SYMBOL() cannot be used on static variables.
Remove incorrect usage of macro EXPORT_SYMBOL()
--- lib/vsprintf.c | 1 - 1 file changed, 1 deletion(-)
lib/vsprintf.c +0 -1
@@ -1655,7 +1655,6 @@ static DEFINE_STATIC_KEY_TRUE(not_filled_random_ptr_key);/* Make pointers available for printing early in the boot sequence. */ static int debug_boot_weak_hash__ro_after_init ; -EXPORT_SYMBOL (debug_boot_weak_hash);static int __init debug_boot_weak_hash_enable (char *str) {
Signature · 1 line
2.17.1
Steven Rostedt
maintainerRe: [PATCH 2/3] vsprintf: Remove incorrect EXPORT_SYMBOL
Quoted 10 lines · On Tue, 10 Jul 2018 10:25:18 +1000 "Tobin C. Harding" <[email protected]> wrote:
Recently boot variable '
debug_boot_weak_hash' was added (by me). In a classic case of cargo cult programming the novice developer added a macro call toEXPORT_SYMBOL(). This is wrong and was pointed out on LKML. As pointed outEXPORT_SYMBOL()cannot be used on static variables.Remove incorrect usage of macro
EXPORT_SYMBOL()Fixes bfe80ed3d7c76 ("vsprintf: add command line option debug_boot_weak_hash")Signed-off-by Tobin C. Harding <[email protected]>
Hmm, not sure if Ted rebases his trees or not, but if he does, he could also fold this into that commit.
-- Steve
Quoted 16 lines
--- lib/vsprintf.c | 1 - 1 file changed, 1 deletion(-)lib/vsprintf.c +0
-1@@ -1655,7 +1655,6 @@ static DEFINE_STATIC_KEY_TRUE(not_filled_random_ptr_key);/* Make pointers available for printing early in the boot sequence. */ static int debug_boot_weak_hash__ro_after_init ; -EXPORT_SYMBOL (debug_boot_weak_hash);static int __init debug_boot_weak_hash_enable (char *str) {
PATCH 3/3 docs: Fix docs for boot parameter debug_boot_weak_hash
In reply to Tobin C. HardingRecently boot parameter 'debug_boot_weak_hash' was added. Latter discussion on LKML developed more descriptive documentation but due to the programmers lack of understanding (*cough* me) on how linux-next works these improvements never got picked up.
Update documentation for boot parameter 'debug_boot_weak_hash' as discussed (patch posted and acked) on LKML.
--- Documentation/admin-guide/kernel-parameters.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +6 -7
@@ -749,13 +749,12 @@ debug [KNL] Enable kernel debugging (events log level). debug_boot_weak_hash - [KNL] Enable printing pointers early in the boot - sequence. If enabled, we use a weak hash instead of - siphash to hash pointers. Use this option if you need - to see pointer values during early boot (i.e you are - seeing instances of '(___ptrval___)'). - Cryptographically insecure, please do not use on - production kernels. + [KNL] Enable printing [hashed] pointers early in the + boot sequence. If enabled, we use a weak hash instead + of siphash to hash pointers. Use this option if you are + seeing instances of '(___ptrval___)') and need to see a + value (hashed pointer) instead. Cryptographically + insecure, please do not use on production kernels. debug_locks_verbose= [KNL] verbose self-tests
Signature · 1 line
2.17.1
Re: [PATCH 3/3] docs: Fix docs for boot parameter debug_boot_weak_hash
Quoted 11 lines · On Tue, 10 Jul 2018 10:25:19 +1000 "Tobin C. Harding" <[email protected]> wrote:
Recently boot parameter '
debug_boot_weak_hash' was added. Latter discussion on LKML developed more descriptive documentation but due to the programmers lack of understanding (*cough* me) on how linux-next works these improvements never got picked up.Update documentation for boot parameter '
debug_boot_weak_hash' as discussed (patch posted and acked) on LKML.Fixes bfe80ed3d7c76 ("vsprintf: add command line option debug_boot_weak_hash")Acked-by Randy Dunlap <[email protected]>Signed-off-by Tobin C. Harding <[email protected]>
-- Steve
Quoted 28 lines
--- Documentation/admin-guide/kernel-parameters.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)Documentation/admin-guide/kernel-parameters.txt +6
-7@@ -749,13 +749,12 @@ debug [KNL] Enable kernel debugging (events log level). debug_boot_weak_hash - [KNL] Enable printing pointers early in the boot - sequence. If enabled, we use a weak hash instead of - siphash to hash pointers. Use this option if you need - to see pointer values during early boot (i.e you are - seeing instances of '(___ptrval___)'). - Cryptographically insecure, please do not use on - production kernels. + [KNL] Enable printing [hashed] pointers early in the + boot sequence. If enabled, we use a weak hash instead + of siphash to hash pointers. Use this option if you are + seeing instances of '(___ptrval___)') and need to see a + value (hashed pointer) instead. Cryptographically + insecure, please do not use on production kernels. debug_locks_verbose= [KNL] verbose self-tests
Steven Rostedt
maintainerQuoted 3 lines · On Tue, 10 Jul 2018 10:25:16 +1000 "Tobin C. Harding" <[email protected]> wrote:
Since I'm a massive noob I did not realise that since v7 of this set was applied to random-next already that doing incremental versions was pointless.
I wouldn't say you are a noob anymore. You are making the same types of mistakes that seasoned kernel developers make ;-)
-- Steve
Quoted 9 lines · Steven Rostedt
Quoted 3 lines · On Tue, 10 Jul 2018 10:25:16 +1000 "Tobin C. Harding" <[email protected]> wrote:
Since I'm a massive noob I did not realise that since v7 of this set was applied to random-next already that doing incremental versions was pointless.
I wouldn't say you are a noob anymore. You are making the same types of mistakes that seasoned kernel developers make ;-)
Thanks for the vote of confidence Steve :)