summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2005-04-06 01:06:44 +0000
committerColin Percival <cperciva@FreeBSD.org>2005-04-06 01:06:44 +0000
commitcfba578f829c4e411a77bbfce2d7062c288ee881 (patch)
treec8e4832305a1424dcc595daaa929c49efa807f25
parent1eb4f66564e654ab9199f4fab18af715a0a6e12f (diff)
downloadsrc-test2-cfba578f829c4e411a77bbfce2d7062c288ee881.tar.gz
src-test2-cfba578f829c4e411a77bbfce2d7062c288ee881.zip
Fully initialize the required TSS fields so that the io permission
bitmap is set correctly. Patch from: peter Security: FreeBSD-SA-05:03.amd64 Approved by: so (cperciva)
Notes
Notes: svn path=/releng/5.3/; revision=144698
-rw-r--r--UPDATING3
-rw-r--r--sys/amd64/amd64/machdep.c3
-rw-r--r--sys/amd64/amd64/mp_machdep.c1
-rw-r--r--sys/amd64/include/tss.h1
-rw-r--r--sys/conf/newvers.sh2
5 files changed, 8 insertions, 2 deletions
diff --git a/UPDATING b/UPDATING
index 7ebee814582e..0f529adc8667 100644
--- a/UPDATING
+++ b/UPDATING
@@ -8,6 +8,9 @@ Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running
portupgrade. Important recent entries: 20040724 (default X changes).
+20050406: p8 FreeBSD-SA-05:03.amd64
+ Correctly initialize the I/O permission bitmap on amd64.
+
20050404: p7 FreeBSD-SA-05:02.sendfile
Correct kernel memory disclosure bug in sendfile(2).
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 0a0287764ac4..8c46c43b422e 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1224,6 +1224,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
/* doublefault stack space, runs on ist1 */
common_tss[0].tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)];
+ /* Set the IO permission bitmap (empty due to tss seg limit) */
+ common_tss[0].tss_iobase = sizeof(struct amd64tss);
+
gsel_tss = GSEL(GPROC0_SEL, SEL_KPL);
ltr(gsel_tss);
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 0e8a16f13734..376191325dd8 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -372,6 +372,7 @@ init_secondary(void)
/* Init tss */
common_tss[cpu] = common_tss[0];
common_tss[cpu].tss_rsp0 = 0; /* not used until after switch */
+ common_tss[cpu].tss_iobase = sizeof(struct amd64tss);
gdt_segs[GPROC0_SEL].ssd_base = (long) &common_tss[cpu];
ssdtosyssd(&gdt_segs[GPROC0_SEL],
diff --git a/sys/amd64/include/tss.h b/sys/amd64/include/tss.h
index b6cfb0b89074..a4a4510cce12 100644
--- a/sys/amd64/include/tss.h
+++ b/sys/amd64/include/tss.h
@@ -50,7 +50,6 @@ struct amd64tss {
u_int64_t tss_rsp2 __packed; /* kernel stack pointer ring 2 */
u_int32_t tss_rsvd1;
u_int32_t tss_rsvd2;
- u_int32_t tss_rsvd3;
u_int64_t tss_ist1 __packed; /* Interrupt stack table 1 */
u_int64_t tss_ist2 __packed; /* Interrupt stack table 2 */
u_int64_t tss_ist3 __packed; /* Interrupt stack table 3 */
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 222bf72373a0..4962370e8209 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -32,7 +32,7 @@
TYPE="FreeBSD"
REVISION="5.3"
-BRANCH="RELEASE-p7"
+BRANCH="RELEASE-p8"
RELEASE="${REVISION}-${BRANCH}"
VERSION="${TYPE} ${RELEASE}"