Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cprng panic?



In article <504A43B2.3090006%execsw.org@localhost>,
SAITOH Masanobu  <msaitoh%execsw.org@localhost> wrote:
> My evbarm machine runnning -cuurent panics as follows:
>
>> cprng kernel: WARNING pseudorandom rekeying.
>> panic: kernel diagnostic assertion "(!cpu_intr_p() &&
>!cpu_softintr_p())" failed: file "../../../../kern/subr_kmem.c", line
>307 kmem(9) should not be used from the interrupt context

Try this:

christos

Index: kern/subr_cprng.c
===================================================================
RCS file: /cvsroot/src/sys/kern/subr_cprng.c,v
retrieving revision 1.11
diff -u -r1.11 subr_cprng.c
--- kern/subr_cprng.c   7 Sep 2012 02:42:13 -0000       1.11
+++ kern/subr_cprng.c   7 Sep 2012 22:05:12 -0000
@@ -284,7 +284,8 @@
         * If the generator has just been keyed, perform
         * the statistical RNG test.
         */
-       if (__predict_false(c->drbg.reseed_counter == 1)) {
+       if (__predict_false(c->drbg.reseed_counter == 1) &&
+           (flags & FASYNC) == 0) {
                rngtest_t *rt = kmem_alloc(sizeof(*rt), KM_NOSLEEP);
 
                if (rt) {
Index: netinet/tcp_subr.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.247
diff -u -r1.247 tcp_subr.c
--- netinet/tcp_subr.c  22 Mar 2012 20:34:39 -0000      1.247
+++ netinet/tcp_subr.c  7 Sep 2012 22:05:12 -0000
@@ -2214,7 +2214,7 @@
         */
        if (tcp_iss_gotten_secret == false) {
                cprng_strong(kern_cprng,
-                            tcp_iss_secret, sizeof(tcp_iss_secret), 0);
+                            tcp_iss_secret, sizeof(tcp_iss_secret), FASYNC);
                tcp_iss_gotten_secret = true;
        }
 



Home | Main Index | Thread Index | Old Index