(5/7) untrusted entropy sources
Subsystems (6)
PATCH 1/1 (5/7) untrusted entropy sources
[correction: RML's SA_SAMPLE_RANDOM patch is safe after _this_ patch]
This makes irq and blkdev interrupts untrusted and does away with their superfluous state initialization and tracking.
arch/alpha/kernel/irq.c +0 -11
@@ -166,17 +166,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }/* * The following block of code has to be executed atomically
arch/arm/kernel/irq.c +0 -11
@@ -458,17 +458,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }/* * The following block of code has to be executed atomically
arch/cris/kernel/irq.c +0 -3
@@ -315,9 +315,6 @@ shared =1 ; } -if (new->flags &SA_SAMPLE_RANDOM ) -rand_initialize_irq (irq); -save_flags (flags);cli (); *p = new;
arch/i386/kernel/irq.c +0 -11
@@ -733,17 +733,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }/* * The following block of code has to be executed atomically
arch/ia64/kernel/irq.c +0 -11
@@ -1016,17 +1016,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }if (new->flags &SA_PERCPU_IRQ ) { desc->status |=IRQ_PER_CPU ;
arch/ia64/kernel/irq_ia64.c +0 -1
@@ -22,7 +22,6 @@#include <linux/kernel_stat.h> #include <linux/slab.h> #include <linux/ptrace.h> -#include <linux/random.h> /* for rand_initialize_irq() */ #include <linux/signal.h> #include <linux/smp.h> #include <linux/smp_lock.h>
arch/mips/baget/irq.c +0 -3
@@ -284,9 +284,6 @@ shared =1 ; } -if (new->flags &SA_SAMPLE_RANDOM ) -rand_initialize_irq (irq); -save_and_cli (flags); *p = new;restore_flags (flags);
arch/mips/dec/irq.c +0 -2
@@ -181,8 +181,6 @@ }while (old); shared =1 ; } -if (new->flags &SA_SAMPLE_RANDOM ) -rand_initialize_irq (irq);save_and_cli (flags); *p = new;
arch/mips/kernel/irq.c +0 -11
@@ -649,17 +649,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }/* * The following block of code has to be executed atomically
arch/mips/kernel/old-irq.c +0 -3
@@ -263,9 +263,6 @@ shared =1 ; } -if (new->flags &SA_SAMPLE_RANDOM ) -rand_initialize_irq (irq); -save_and_cli (flags); *p = new;
arch/mips/philips/nino/irq.c +0 -2
@@ -227,8 +227,6 @@ }while (old); shared =1 ; } -if (new->flags &SA_SAMPLE_RANDOM ) -rand_initialize_irq (irq);save_and_cli (flags); *p = new;
arch/mips64/mips-boards/malta/malta_int.c +0 -3
@@ -247,9 +247,6 @@ shared =1 ; } -if (new->flags &SA_SAMPLE_RANDOM ) -rand_initialize_irq (irq); - *p = new;if (!shared)enable_irq (irq);
arch/mips64/sgi-ip27/ip27-irq.c +0 -2
@@ -339,8 +339,6 @@printk ("IRQ array overflow %d\n" , irq);while (1 ); } -if (new->flags &SA_SAMPLE_RANDOM ) -rand_initialize_irq (irq);save_and_cli (flags); p = irq_action + irq;
arch/ppc/kernel/irq.c +0 -11
@@ -133,17 +133,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }/* * The following block of code has to be executed atomically
arch/ppc64/kernel/irq.c +0 -11
@@ -120,17 +120,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }/* * The following block of code has to be executed atomically
arch/sh/kernel/irq.c +0 -11
@@ -499,17 +499,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }/* * The following block of code has to be executed atomically
arch/sparc64/kernel/irq.c +0 -14
@@ -316,20 +316,6 @@if (!handler)return -EINVAL ; -if ((bucket != &pil0_dummy_bucket) && (irqflags &SA_SAMPLE_RANDOM )) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. In SA_STATIC_ALLOC case, -* random driver's kmalloc will fail, but it is safe. -* If already initialized, random driver will not reinit. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - } -spin_lock_irqsave (&irq_action_lock, flags); action = *(bucket->pil + irq_action);
arch/x86_64/kernel/irq.c +0 -11
@@ -986,17 +986,6 @@* so we have to be careful not to interfere with a * running system. */ -if (new->flags &SA_SAMPLE_RANDOM ) { -/* -* This function might sleep, we want to call it first, -* outside of the atomic block. -* Yes, this might clear the entropy pool if the wrong -* driver is attempted to be loaded, without actually -* installing a new handler, but is this really a problem, -* only the sysadmin is able to do this. -*/ -rand_initialize_irq (irq); - }/* * The following block of code has to be executed atomically
drivers/char/random.c +3 -61
101 lines not on this page · raw message
include/linux/random.h +0 -2
@@ -43,8 +43,6 @@#ifdef __KERNEL__extern void rand_initialize (void ); -extern void rand_initialize_irq (int irq); -extern void rand_initialize_blkdev (int irq,int mode);extern void batch_entropy_store (u32 val,int bits);
Signature · 1 line
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."