conf/124747: [patch] savecore can't create dump from encrypted swap

Gleb Kurtsou gk at FreeBSD.org
Thu Jun 19 06:50:01 UTC 2008


>Number:         124747
>Category:       conf
>Synopsis:       [patch] savecore can't create dump from encrypted swap
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 19 06:50:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Gleb Kurtsou
>Release:        8.0-CURRENT
>Organization:
>Environment:
FreeBSD h1.d 8.0-CURRENT FreeBSD 8.0-CURRENT #47: Sat Jun 14 14:03:58 EEST 2008     root at h1.d:/usr/obj/usr/freebsd-src/p4/sys/MY1  i386
>Description:
Issue was mentioned recently on stable@
http://docs.freebsd.org/cgi/mid.cgi?47F548D9.8060905

The problem is in order of rc.d scripts.  After encswap finishes it's
impossible to open original (not encrypted) swap device for write so
savecore fails.


>How-To-Repeat:
1. enable swap encryption

/dev/ad0s3b.eli         none            swap    sw              0       0

2. setup dumpdev. in /etc/rc.conf

dumpdev="/dev/ad0s3b"

3. force panic.

4. savecore can't read dump because dumpdev is already open for write.
>Fix:
The following patch adds 'encswap' target to be run after 'disks' but
before 'swap1'. With the patch order of scripts becomes:
dumpon
geli
savecore
encswap
swap1

instead of:
dumpon
geli
encswap
swap1
savecore

The problem is that savecore looses ability to log to syslog. You still get
messages on console. The only solution I see is to use some hackery
magic to inject log messages into kern.msgbuf with the help of
/dev/console. I'm not sure it's really needed.

I use this patch since apr 2008. It works for me.



Patch attached with submission follows:

diff -ur rc.d.orig/encswap rc.d/encswap
--- rc.d.orig/encswap	2008-04-27 14:53:38.000000000 +0300
+++ etc/rc.d/encswap	2008-04-27 14:53:27.000000000 +0300
@@ -4,7 +4,7 @@
 #
 
-# PROVIDE: disks
-# REQUIRE: initrandom
+# PROVIDE: encswap
+# REQUIRE: initrandom disks
 # KEYWORD: nojail
 
 . /etc/rc.subr
diff -ur rc.d.orig/savecore rc.d/savecore
--- rc.d.orig/savecore	2008-04-27 14:53:38.000000000 +0300
+++ etc/rc.d/savecore	2008-04-27 14:53:27.000000000 +0300
@@ -4,8 +4,7 @@
 #
 
 # PROVIDE: savecore
-# REQUIRE: syslogd
-# BEFORE:  SERVERS
+# BEFORE:  encswap
 # KEYWORD: nojail
 
 . /etc/rc.subr
diff -ur rc.d.orig/swap1 rc.d/swap1
--- rc.d.orig/swap1	2008-04-27 14:53:38.000000000 +0300
+++ etc/rc.d/swap1	2008-04-27 14:53:27.000000000 +0300
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: localswap
-# REQUIRE: disks
+# REQUIRE: encswap disks
 # KEYWORD: nojail shutdown
 
 . /etc/rc.subr




>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list