Module Name:    src
Committed By:   christos
Date:           Thu Jan 31 12:31:50 UTC 2019

Modified Files:
        src/sys/dev/raidframe: rf_compat50.c rf_compat50.h rf_compat50_mod.h
            rf_compat80.c rf_compat80_mod.h
        src/sys/sys: compat_stub.h

Log Message:
Prevent integer overflow: ioctl commands are u_long.
For consistency move prototype to the _mod.h header.

XXX: Why are the compat files here? Shouldn't they be in compat/common?
Or because this could be a separate module, they belong with it?


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/raidframe/rf_compat50.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/raidframe/rf_compat50.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/raidframe/rf_compat50_mod.h \
    src/sys/dev/raidframe/rf_compat80_mod.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/raidframe/rf_compat80.c
cvs rdiff -u -r1.8 -r1.9 src/sys/sys/compat_stub.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_compat50.c
diff -u src/sys/dev/raidframe/rf_compat50.c:1.5 src/sys/dev/raidframe/rf_compat50.c:1.6
--- src/sys/dev/raidframe/rf_compat50.c:1.5	Tue Jan 29 04:28:50 2019
+++ src/sys/dev/raidframe/rf_compat50.c	Thu Jan 31 07:31:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_compat50.c,v 1.5 2019/01/29 09:28:50 pgoyette Exp $	*/
+/*	$NetBSD: rf_compat50.c,v 1.6 2019/01/31 12:31:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -220,7 +220,7 @@ out:
 }
 
 int
-raidframe_ioctl_50(int cmd, int initted, RF_Raid_t *raidPtr, int unit,
+raidframe_ioctl_50(u_long cmd, int initted, RF_Raid_t *raidPtr, int unit,
     void *data, RF_Config_t **k_cfg)
 {
 	int error;

Index: src/sys/dev/raidframe/rf_compat50.h
diff -u src/sys/dev/raidframe/rf_compat50.h:1.3 src/sys/dev/raidframe/rf_compat50.h:1.4
--- src/sys/dev/raidframe/rf_compat50.h:1.3	Sat Jan 26 21:08:42 2019
+++ src/sys/dev/raidframe/rf_compat50.h	Thu Jan 31 07:31:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_compat50.h,v 1.3 2019/01/27 02:08:42 pgoyette Exp $	*/
+/*	$NetBSD: rf_compat50.h,v 1.4 2019/01/31 12:31:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -47,6 +47,4 @@
 int rf_config50(RF_Raid_t *, int, void *, RF_Config_t **);
 int rf_get_info50(RF_Raid_t *, void *);
 
-int raidframe_ioctl_50(int, int, RF_Raid_t *, int, void *, RF_Config_t **);
-
 #endif /* _RF_COMPAT50_H_ */

Index: src/sys/dev/raidframe/rf_compat50_mod.h
diff -u src/sys/dev/raidframe/rf_compat50_mod.h:1.2 src/sys/dev/raidframe/rf_compat50_mod.h:1.3
--- src/sys/dev/raidframe/rf_compat50_mod.h:1.2	Sat Jan 26 21:08:42 2019
+++ src/sys/dev/raidframe/rf_compat50_mod.h	Thu Jan 31 07:31:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_compat50_mod.h,v 1.2 2019/01/27 02:08:42 pgoyette Exp $	*/
+/* $NetBSD: rf_compat50_mod.h,v 1.3 2019/01/31 12:31:50 christos Exp $	*/
 
 
 /*-
@@ -36,4 +36,6 @@
 void raidframe_50_fini(void);
 void raidframe_50_init(void);
 
+int raidframe_ioctl_50(u_long, int, RF_Raid_t *, int, void *, RF_Config_t **);
+
 #endif	/* _RF_COMPAT50_MOD_H_ */
Index: src/sys/dev/raidframe/rf_compat80_mod.h
diff -u src/sys/dev/raidframe/rf_compat80_mod.h:1.2 src/sys/dev/raidframe/rf_compat80_mod.h:1.3
--- src/sys/dev/raidframe/rf_compat80_mod.h:1.2	Sat Jan 26 21:08:42 2019
+++ src/sys/dev/raidframe/rf_compat80_mod.h	Thu Jan 31 07:31:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_compat80_mod.h,v 1.2 2019/01/27 02:08:42 pgoyette Exp $	*/
+/* $NetBSD: rf_compat80_mod.h,v 1.3 2019/01/31 12:31:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 struct RF_Raid_s;
 struct RF_Config_s;
 
-int raidframe_ioctl_80(int, int, struct RF_Raid_s *, int, void *,
+int raidframe_ioctl_80(u_long, int, struct RF_Raid_s *, int, void *,
     struct RF_Config_s **);
 
 void raidframe_80_init(void);

Index: src/sys/dev/raidframe/rf_compat80.c
diff -u src/sys/dev/raidframe/rf_compat80.c:1.6 src/sys/dev/raidframe/rf_compat80.c:1.7
--- src/sys/dev/raidframe/rf_compat80.c:1.6	Tue Jan 29 18:57:01 2019
+++ src/sys/dev/raidframe/rf_compat80.c	Thu Jan 31 07:31:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_compat80.c,v 1.6 2019/01/29 23:57:01 pgoyette Exp $	*/
+/*	$NetBSD: rf_compat80.c,v 1.7 2019/01/31 12:31:50 christos Exp $	*/
 
 /*
  * Copyright (c) 2017 Matthew R. Green
@@ -223,7 +223,7 @@ rf_config80(RF_Raid_t *raidPtr, int unit
 }
 
 int
-raidframe_ioctl_80(int cmd, int initted, RF_Raid_t *raidPtr, int unit,
+raidframe_ioctl_80(u_long cmd, int initted, RF_Raid_t *raidPtr, int unit,
     void *data, RF_Config_t **k_cfg)  
 {
 	int error;

Index: src/sys/sys/compat_stub.h
diff -u src/sys/sys/compat_stub.h:1.8 src/sys/sys/compat_stub.h:1.9
--- src/sys/sys/compat_stub.h:1.8	Tue Jan 29 04:28:51 2019
+++ src/sys/sys/compat_stub.h	Thu Jan 31 07:31:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_stub.h,v 1.8 2019/01/29 09:28:51 pgoyette Exp $	*/
+/*	$NetBSD: compat_stub.h,v 1.9 2019/01/31 12:31:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -131,9 +131,9 @@ MODULE_HOOK(ocryptof_50_hook, int, (stru
 struct RF_Config_s;
 struct RF_Raid_s;
 MODULE_HOOK(raidframe_ioctl_50_hook, int,
-    (int, int, struct RF_Raid_s *, int, void *, struct RF_Config_s **));
+    (u_long, int, struct RF_Raid_s *, int, void *, struct RF_Config_s **));
 MODULE_HOOK(raidframe_ioctl_80_hook, int,
-    (int, int, struct RF_Raid_s *, int, void *, struct RF_Config_s **));
+    (u_long, int, struct RF_Raid_s *, int, void *, struct RF_Config_s **));
 
 /*
  * puffs compatibility

Reply via email to