summarylogtreecommitdiffstats
path: root/0001-kernel-5.0.0-8250_core-access_ok.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-kernel-5.0.0-8250_core-access_ok.patch')
-rw-r--r--0001-kernel-5.0.0-8250_core-access_ok.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/0001-kernel-5.0.0-8250_core-access_ok.patch b/0001-kernel-5.0.0-8250_core-access_ok.patch
new file mode 100644
index 000000000000..18e78399d5d3
--- /dev/null
+++ b/0001-kernel-5.0.0-8250_core-access_ok.patch
@@ -0,0 +1,26 @@
+--- driver/8250_core.c.orig 2018-06-11 10:29:19.000000000 -0400
++++ driver/8250_core.c 2019-03-10 20:36:57.151744874 -0400
+@@ -4051,16 +4051,22 @@ serial8250_register_ports(struct uart_dr
+ static inline int pci_portnum_cti(struct uart_port *port)
+ {
+ return (port->iobase % 0x100) / 0x08;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
++#define compat_access_ok(u,v,w) access_ok(v,w)
++#else
++#define compat_access_ok(u,v,w) access_ok(u,v,w)
++#endif
++
+ static int get_lmode_from_arg(unsigned int *value){
+
+ int lmode;
+
+ //use copy_from_user if userspace pointer is valid
+- if(access_ok(VERIFY_READ, (void __user *)value, sizeof(int))){
++ if(compat_access_ok(VERIFY_READ, (void __user *)value, sizeof(int))){
+ if(copy_from_user(&lmode, (void __user *)value, sizeof(int))){
+ return -EFAULT;
+ };
+ return lmode;
+ }