diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-08-23 20:27:31 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-08-23 20:27:31 +0000 |
commit | 070bf521d537e03f9ed59a2ab859793f5c72e1fd (patch) | |
tree | b6b5e5bd19549cd9a8384be2e8ef90d4469552e3 | |
parent | b08ec6df09214ccf2f3cf10e86b77f5482b9246c (diff) |
remember to reset exec_maxhdrsz after lkm load/unload. ok fgsch@
-rw-r--r-- | sys/kern/exec_conf.c | 12 | ||||
-rw-r--r-- | sys/kern/kern_lkm.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/kern/exec_conf.c b/sys/kern/exec_conf.c index 285f1cb524b..8325e2ea0cb 100644 --- a/sys/kern/exec_conf.c +++ b/sys/kern/exec_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_conf.c,v 1.15 2003/08/23 20:02:59 tedu Exp $ */ +/* $OpenBSD: exec_conf.c,v 1.16 2003/08/23 20:27:30 tedu Exp $ */ /* $NetBSD: exec_conf.c,v 1.16 1995/12/09 05:34:47 cgd Exp $ */ /* @@ -177,10 +177,8 @@ init_exec(void) * XXX should be able to keep LKM code from modifying exec switch * when we're still using it, but... */ - if (exec_maxhdrsz == 0) { - for (i = 0; i < nexecs; i++) - if (execsw[i].es_check != NULL && - execsw[i].es_hdrsz > exec_maxhdrsz) - exec_maxhdrsz = execsw[i].es_hdrsz; - } + for (i = 0; i < nexecs; i++) + if (execsw[i].es_check != NULL && + execsw[i].es_hdrsz > exec_maxhdrsz) + exec_maxhdrsz = execsw[i].es_hdrsz; } diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c index 10afec4748f..c6ee557a414 100644 --- a/sys/kern/kern_lkm.c +++ b/sys/kern/kern_lkm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lkm.c,v 1.39 2003/07/21 22:44:50 tedu Exp $ */ +/* $OpenBSD: kern_lkm.c,v 1.40 2003/08/23 20:27:30 tedu Exp $ */ /* $NetBSD: kern_lkm.c,v 1.31 1996/03/31 21:40:27 christos Exp $ */ /* @@ -96,6 +96,8 @@ static int _lkm_exec(struct lkm_table *, int); void lkminit(void); int lkmexists(struct lkm_table *); +void init_exec(void); + void lkminit() { @@ -814,8 +816,8 @@ _lkm_exec(struct lkm_table *lkmtp, int cmd) /* replace with new */ bcopy(args->lkm_exec, &execsw[i], sizeof(struct execsw)); - /* realize need to recompute max header size */ - exec_maxhdrsz = 0; + /* need to recompute max header size */ + init_exec(); /* done! */ args->lkm_offset = i; /* slot in execsw[] */ @@ -829,8 +831,8 @@ _lkm_exec(struct lkm_table *lkmtp, int cmd) /* replace current slot contents with old contents */ bcopy(&args->lkm_oldexec, &execsw[i], sizeof(struct execsw)); - /* realize need to recompute max header size */ - exec_maxhdrsz = 0; + /* need to recompute max header size */ + init_exec(); break; |