summarylogtreecommitdiffstats
path: root/access_ok_remove_type.patch
blob: f3a8f39068770fa4dc96e37c13c5b8b365c98672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff -r -u a/eq3_char_loop.c b/eq3_char_loop.c
--- a/eq3_char_loop.c	2020-03-27 23:57:42.975868561 +0100
+++ b/eq3_char_loop.c	2020-03-27 23:58:16.482782251 +0100
@@ -456,9 +456,9 @@
 	* "write" is reversed
 	*/
 	if (_IOC_DIR(cmd) & _IOC_READ)
-	ret = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd));
+	ret = !access_ok((void *)arg, _IOC_SIZE(cmd));
 	else if (_IOC_DIR(cmd) & _IOC_WRITE)
-	ret =  !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd));
+	ret =  !access_ok((void *)arg, _IOC_SIZE(cmd));
 	if (ret) return -EFAULT;
 
 	switch(cmd) {
@@ -500,7 +500,7 @@
 	switch(cmd) {
 
 	case TCGETS:
-		if( access_ok(VERIFY_READ, (void *)arg, sizeof(struct termios) ) )
+		if( access_ok((void *)arg, sizeof(struct termios) ) )
 		{
 			ret = copy_to_user( (void*)arg, &channel->termios, sizeof(struct termios) );
 		} else {
@@ -508,7 +508,7 @@
 		}
 		break;
 	case TCSETS:
-		if( access_ok(VERIFY_WRITE, (void *)arg, sizeof(struct termios) ) )
+		if( access_ok((void *)arg, sizeof(struct termios) ) )
 		{
 			ret = copy_from_user( &channel->termios, (void*)arg, sizeof(struct termios) );
 		} else {