Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Prevent integer overflow: ioctl commands are u_long.



details:   https://anonhg.NetBSD.org/src/rev/383d7079b751
branches:  trunk
changeset: 448366:383d7079b751
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 31 12:31:50 2019 +0000

description:
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?

diffstat:

 sys/dev/raidframe/rf_compat50.c     |  4 ++--
 sys/dev/raidframe/rf_compat50.h     |  4 +---
 sys/dev/raidframe/rf_compat50_mod.h |  4 +++-
 sys/dev/raidframe/rf_compat80.c     |  4 ++--
 sys/dev/raidframe/rf_compat80_mod.h |  4 ++--
 sys/sys/compat_stub.h               |  6 +++---
 6 files changed, 13 insertions(+), 13 deletions(-)

diffs (107 lines):

diff -r 999c74a11e52 -r 383d7079b751 sys/dev/raidframe/rf_compat50.c
--- a/sys/dev/raidframe/rf_compat50.c   Thu Jan 31 10:06:32 2019 +0000
+++ b/sys/dev/raidframe/rf_compat50.c   Thu Jan 31 12:31:50 2019 +0000
@@ -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 @@
 }
 
 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;
diff -r 999c74a11e52 -r 383d7079b751 sys/dev/raidframe/rf_compat50.h
--- a/sys/dev/raidframe/rf_compat50.h   Thu Jan 31 10:06:32 2019 +0000
+++ b/sys/dev/raidframe/rf_compat50.h   Thu Jan 31 12:31:50 2019 +0000
@@ -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_ */
diff -r 999c74a11e52 -r 383d7079b751 sys/dev/raidframe/rf_compat50_mod.h
--- a/sys/dev/raidframe/rf_compat50_mod.h       Thu Jan 31 10:06:32 2019 +0000
+++ b/sys/dev/raidframe/rf_compat50_mod.h       Thu Jan 31 12:31:50 2019 +0000
@@ -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_ */
diff -r 999c74a11e52 -r 383d7079b751 sys/dev/raidframe/rf_compat80.c
--- a/sys/dev/raidframe/rf_compat80.c   Thu Jan 31 10:06:32 2019 +0000
+++ b/sys/dev/raidframe/rf_compat80.c   Thu Jan 31 12:31:50 2019 +0000
@@ -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 @@
 }
 
 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;
diff -r 999c74a11e52 -r 383d7079b751 sys/dev/raidframe/rf_compat80_mod.h
--- a/sys/dev/raidframe/rf_compat80_mod.h       Thu Jan 31 10:06:32 2019 +0000
+++ b/sys/dev/raidframe/rf_compat80_mod.h       Thu Jan 31 12:31:50 2019 +0000
@@ -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);
diff -r 999c74a11e52 -r 383d7079b751 sys/sys/compat_stub.h
--- a/sys/sys/compat_stub.h     Thu Jan 31 10:06:32 2019 +0000
+++ b/sys/sys/compat_stub.h     Thu Jan 31 12:31:50 2019 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index