lkml.org 
[lkml]   [2018]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/3] enable early printing of hashed pointers
Date
Currently if an attempt is made to print a pointer before there is
enough entropy then '(____ptrval____)' is printed. This makes debugging
stack traces during early boot difficult.

It was observed that we can relax the requirement for cryptographically
secure hashing when debugging while still maintaining pointer hashing
behaviour. This allows kernels to be debugged without developers
relying on different pointer printing behavior.

Most of this code (excluding the command line option stuff) was written
by Kees and Linus on LKML. Any mistakes introduced are however my own.

For the command line option stuff I copied crypto/fips.c mixed with
kernel/power/hibernate.c

Taking suggestions please on the get_random_bytes_arch() local variable
name 'left' (I thought of 'togo' and 'rem' (as in remaining) as well).

Testing

The command line option stuff has been verified to work. I have built
and booted a patched kernel on a machine without RDRAND (qemu) and on a
machine with RDRAND (intel core M5Y70). The code appears to work as it
is written. I am unsure however whether this solves the initial
problem. I tried printing a pointer from within
init/main.c:kernel_init() and that did _not_ work. I do not know how
early is early, or in other words, when we are hoping for this to work.

thanks,
Tobin.


Tobin C. Harding (3):
random: Fix whitespace pre random-bytes work
random: Return nbytes filled from hw RNG
vsprintf: Add use-early-random-bytes cmd line option

drivers/char/random.c | 19 ++++++++++---------
include/linux/random.h | 2 +-
lib/vsprintf.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 58 insertions(+), 13 deletions(-)

--
2.7.4

\
 
 \ /
  Last update: 2018-05-02 01:34    [W:0.122 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site