aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/msgbuf.h
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2003-03-28 02:50:10 +0000
committerIan Dowse <iedowse@FreeBSD.org>2003-03-28 02:50:10 +0000
commit6205bf3107dc1918c3d09ff87a8e9989f01e2e0f (patch)
tree30c3acce3e8fb42b966dd12505c6284f5d7c6b04 /sys/sys/msgbuf.h
parentc591e5ebeedfe5a6d9f0186dd5dc92f8442d7af8 (diff)
downloadsrc-6205bf3107dc1918c3d09ff87a8e9989f01e2e0f.tar.gz
src-6205bf3107dc1918c3d09ff87a8e9989f01e2e0f.zip
Add a checksum to the kernel message buffer, and update it every
time a character is written. Use this at boot time to reject the existing buffer contents if they are corrupt. This fixes a problem seen on some hardware (especially laptops) where the message buffer gets partially corrupted during a short power cycle or reset, but the msgbuf structure is left intact so it gets reused, resulting in random junk and control characters appearing in dmesg and /var/log/messages. PR: kern/28497
Notes
Notes: svn path=/head/; revision=112732
Diffstat (limited to 'sys/sys/msgbuf.h')
-rw-r--r--sys/sys/msgbuf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/msgbuf.h b/sys/sys/msgbuf.h
index e6f6da22806a..22bd16110190 100644
--- a/sys/sys/msgbuf.h
+++ b/sys/sys/msgbuf.h
@@ -44,6 +44,7 @@ struct msgbuf {
int msg_bufx; /* write pointer */
int msg_bufr; /* read pointer */
char *msg_ptr; /* pointer to buffer */
+ u_int msg_cksum; /* checksum of contents */
};
#ifdef _KERNEL