mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
`struct linker_set execsw_set' was declared as const and pointers in it
were declared as non-const. This is backwards (_lkm_exec() changes the pointers but all the target `struct execsw's are const). Fixed this and poisoned related declarations to match and removed the bogus casts that hid the bug.
This commit is contained in:
parent
3f6a052a89
commit
e7fa2650cc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18026
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: coff.c,v 1.4 1995/11/13 07:18:21 bde Exp $
|
||||
* $Id: coff.c,v 1.5 1995/11/14 07:33:54 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
extern const struct execsw coff_execsw;
|
||||
|
||||
MOD_EXEC(ibcs2_coff, -1, (struct execsw*)&coff_execsw);
|
||||
MOD_EXEC(ibcs2_coff, -1, &coff_execsw);
|
||||
|
||||
static int
|
||||
ibcs2_coff_load(struct lkm_table *lkmtp, int cmd)
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux.c,v 1.5 1996/03/10 08:42:32 sos Exp $
|
||||
* $Id: linux.c,v 1.6 1996/03/10 22:43:37 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
extern const struct execsw linux_execsw;
|
||||
|
||||
MOD_EXEC(linux, -1, (struct execsw*)&linux_execsw);
|
||||
MOD_EXEC(linux, -1, &linux_execsw);
|
||||
|
||||
extern Elf32_Interp_info linux_interp;
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: kern_lkm.c,v 1.30 1996/05/01 02:42:54 bde Exp $
|
||||
* $Id: kern_lkm.c,v 1.31 1996/05/24 01:39:50 dyson Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -636,8 +636,8 @@ _lkm_vfs(lkmtp, cmd)
|
||||
|
||||
/* like in vfs_op_init */
|
||||
for(i = 0; args->lkm_vnodeops->ls_items[i]; i++) {
|
||||
struct vnodeopv_desc *opv =
|
||||
(struct vnodeopv_desc *)args->lkm_vnodeops->ls_items[i];
|
||||
const struct vnodeopv_desc *opv =
|
||||
args->lkm_vnodeops->ls_items[i];
|
||||
*(opv->opv_desc_vector_p) = NULL;
|
||||
}
|
||||
vfs_opv_init((struct vnodeopv_desc **)args->lkm_vnodeops->ls_items);
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: coff.c,v 1.4 1995/11/13 07:18:21 bde Exp $
|
||||
* $Id: coff.c,v 1.5 1995/11/14 07:33:54 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
extern const struct execsw coff_execsw;
|
||||
|
||||
MOD_EXEC(ibcs2_coff, -1, (struct execsw*)&coff_execsw);
|
||||
MOD_EXEC(ibcs2_coff, -1, &coff_execsw);
|
||||
|
||||
static int
|
||||
ibcs2_coff_load(struct lkm_table *lkmtp, int cmd)
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux.c,v 1.5 1996/03/10 08:42:32 sos Exp $
|
||||
* $Id: linux.c,v 1.6 1996/03/10 22:43:37 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
extern const struct execsw linux_execsw;
|
||||
|
||||
MOD_EXEC(linux, -1, (struct execsw*)&linux_execsw);
|
||||
MOD_EXEC(linux, -1, &linux_execsw);
|
||||
|
||||
extern Elf32_Interp_info linux_interp;
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kernel.h 8.3 (Berkeley) 1/21/94
|
||||
* $Id: kernel.h,v 1.19 1996/01/30 23:00:46 mpp Exp $
|
||||
* $Id: kernel.h,v 1.20 1996/06/23 17:40:47 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_KERNEL_H_
|
||||
@ -260,10 +260,11 @@ void kproc_start __P((void *udata));
|
||||
#endif /* PSEUDO_LKM */
|
||||
|
||||
struct linker_set {
|
||||
int ls_length;
|
||||
caddr_t ls_items[1]; /* really ls_length of them, trailing NULL */
|
||||
int ls_length;
|
||||
const void *ls_items[1]; /* really ls_length of them,
|
||||
* trailing NULL */
|
||||
};
|
||||
|
||||
extern const struct linker_set execsw_set;
|
||||
extern struct linker_set execsw_set;
|
||||
|
||||
#endif /* !_SYS_KERNEL_H_*/
|
||||
|
@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: lkm.h,v 1.10 1995/11/21 12:55:11 bde Exp $
|
||||
* $Id: lkm.h,v 1.11 1995/12/13 15:13:46 julian Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_LKM_H_
|
||||
@ -134,7 +134,7 @@ struct lkm_exec {
|
||||
int lkm_ver;
|
||||
char *lkm_name;
|
||||
u_long lkm_offset;
|
||||
struct execsw *lkm_exec;
|
||||
const struct execsw *lkm_exec;
|
||||
struct execsw lkm_oldexec;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user