summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO8
-rw-r--r--0002-kernel-5.0.0-do_gettimeofday.patch24
-rw-r--r--0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch183
-rw-r--r--PKGBUILD16
4 files changed, 227 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0751f18dd73..e7593d752cb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Thu Nov 15 02:47:50 UTC 2018
+# Mon Mar 11 02:08:55 UTC 2019
pkgbase = dgrp
pkgdesc = tty driver for Digi RealPort ConnectPort EtherLite Flex One CM PortServer TS IBM RAN serial console terminal servers
pkgver = 1.9.39
- pkgrel = 1
+ pkgrel = 2
url = https://www.digi.com/
install = dgrp-install.sh
arch = i686
@@ -57,6 +57,8 @@ pkgbase = dgrp
source = http://ftp1.digi.com/support/utilities/40002709_C.mib
source = http://ftp1.digi.com/support/utilities/rfc1316.mib
source = http://ftp1.digi.com/support/utilities/rfc1317.mib
+ source = 0002-kernel-5.0.0-do_gettimeofday.patch
+ source = 0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
sha256sums = 0db5204cc7d7806fde39b5ea7b6a465b4310739c380d7330131956e63af0f137
sha256sums = 42898b9d24262de27e9b1f3067d51d01373810b7c9e4991403a7f0a5dd7a26cf
sha256sums = 66f8b106a052b4807513ace92978e5e6347cef08eee39e4b4ae31c60284cc0a3
@@ -87,6 +89,8 @@ pkgbase = dgrp
sha256sums = c471cafa43503a40d43b42acd8bc6ef49db29e55a74e0494c85f729ea45fe243
sha256sums = 5cac7ce2e6f043127f314b93694af021ae7820ffb5bf3de343da7a240d05e9c8
sha256sums = 8654496d83c083e457e8bb9bae2b1e71804d156a38c284d89872d0125eba947d
+ sha256sums = 353d15624675c78dfd83318195d75bdb0507fd0476f5e22be1329bf257d2de1e
+ sha256sums = acbcf462628daf4fa2dbee064969a158ccc0bb0ce9f286ceb3617e470eab1c1f
pkgname = dgrp
diff --git a/0002-kernel-5.0.0-do_gettimeofday.patch b/0002-kernel-5.0.0-do_gettimeofday.patch
new file mode 100644
index 00000000000..4d1061186fa
--- /dev/null
+++ b/0002-kernel-5.0.0-do_gettimeofday.patch
@@ -0,0 +1,24 @@
+--- driver/2.6.27/dgrp_mon_ops.c.orig 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_mon_ops.c 2019-03-10 21:10:01.023556586 -0400
+@@ -218,10 +218,21 @@ int unregister_mon_device(struct nd_stru
+ node->nd_mon_de = NULL;
+
+ return 0;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
++/* Temporary until reimplemented with 64 bit functions */
++static inline void do_gettimeofday(struct timeval *tv)
++{
++ struct timespec64 now;
++
++ ktime_get_real_ts64(&now);
++ tv->tv_sec = now.tv_sec;
++ tv->tv_usec = now.tv_nsec/1000;
++}
++#endif
+
+ /*****************************************************************************
+ *
+ * Function:
+ *
diff --git a/0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch b/0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
new file mode 100644
index 00000000000..5966ff3e8aa
--- /dev/null
+++ b/0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch
@@ -0,0 +1,183 @@
+diff -pNaru5 driver/2.6.27.orig/dgrp_net_ops.c driver/2.6.27/dgrp_net_ops.c
+--- driver/2.6.27.orig/dgrp_net_ops.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_net_ops.c 2019-03-10 21:19:01.244643855 -0400
+@@ -4530,15 +4530,20 @@ static long dgrp_net_ioctl(struct file *
+
+ nd = file->private_data;
+
+ dbg_net_trace(IOCTL, ("net ioctl(%p) start\n", nd));
+
++#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
+
+ if (_IOC_DIR(cmd) & _IOC_READ)
+- rtn = access_ok(VERIFY_WRITE, (void *) arg, size);
++ rtn = compat_access_ok(VERIFY_WRITE, (void *) arg, size);
+ else if (_IOC_DIR(cmd) & _IOC_WRITE)
+- rtn = access_ok(VERIFY_READ, (void *) arg, size);
++ rtn = compat_access_ok(VERIFY_READ, (void *) arg, size);
+
+ if (rtn == 0)
+ goto done;
+
+ rtn = 0;
+diff -pNaru5 driver/2.6.27.orig/dgrp_ports_ops.c driver/2.6.27/dgrp_ports_ops.c
+--- driver/2.6.27.orig/dgrp_ports_ops.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_ports_ops.c 2019-03-10 21:19:56.391097938 -0400
+@@ -516,11 +516,17 @@ static ssize_t dgrp_ports_read(struct fi
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buf, len) == 0) {
++#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
++
++ if (compat_access_ok(VERIFY_WRITE, buf, len) == 0) {
+ res = -EFAULT;
+ goto done;
+ }
+
+ res = copy_to_user(buf, &linebuf[linepos], len);
+diff -pNaru5 driver/2.6.27.orig/dgrp_specproc.c driver/2.6.27/dgrp_specproc.c
+--- driver/2.6.27.orig/dgrp_specproc.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_specproc.c 2019-03-10 21:20:22.024333131 -0400
+@@ -642,11 +642,17 @@ static int write_config(struct dgrp_proc
+ len = *lenp;
+
+ if (len > INBUFLEN - 1)
+ len = INBUFLEN - 1;
+
+- if (access_ok(VERIFY_READ, buffer, len) == 0)
++#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
++
++ if (compat_access_ok(VERIFY_READ, buffer, len) == 0)
+ return -EFAULT;
+
+ if (copy_from_user(inbuf, buffer, len))
+ return -EFAULT;
+
+@@ -729,11 +735,11 @@ static int read_config(struct dgrp_proc_
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++ if (compat_access_ok(VERIFY_WRITE, buffer, len) == 0)
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+@@ -1116,11 +1122,11 @@ static int write_info(struct dgrp_proc_e
+ len = *lenp;
+
+ if (len > INBUFLEN - 1)
+ len = INBUFLEN - 1;
+
+- if (access_ok(VERIFY_READ, buffer, len) == 0)
++ if (compat_access_ok(VERIFY_READ, buffer, len) == 0)
+ return -EFAULT;
+ if (copy_from_user(inbuf, buffer, len))
+ return -EFAULT;
+
+ inbuf[len] = 0;
+@@ -1322,11 +1328,11 @@ static int read_info(struct dgrp_proc_en
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++ if (compat_access_ok(VERIFY_WRITE, buffer, len) == 0)
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+@@ -1431,11 +1437,11 @@ static int read_nodeinfo(struct dgrp_pro
+ if (len > left) {
+ len = left;
+ notdone = 1;
+ }
+
+- if (access_ok(VERIFY_WRITE, buffer, len) == 0)
++ if (compat_access_ok(VERIFY_WRITE, buffer, len) == 0)
+ return -EFAULT;
+ if (copy_to_user(buffer, &linebuf[linepos], len))
+ return -EFAULT;
+
+ if (notdone)
+diff -pNaru5 driver/2.6.27.orig/dgrp_tty.c driver/2.6.27/dgrp_tty.c
+--- driver/2.6.27.orig/dgrp_tty.c 2018-06-01 12:10:27.000000000 -0400
++++ driver/2.6.27/dgrp_tty.c 2019-03-10 21:19:44.367810782 -0400
+@@ -2992,11 +2992,17 @@ static int set_modem_info(struct ch_stru
+ int error;
+ unsigned int arg;
+ int mval = 0;
+ ulong lock_flags;
+
+- error = access_ok(VERIFY_READ, value, sizeof(int));
++#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
++
++ error = compat_access_ok(VERIFY_READ, value, sizeof(int));
+ if (error == 0)
+ return -EFAULT;
+
+ get_user(arg, (unsigned int *) value);
+ mval |= ((arg & TIOCM_RTS) ? DM_RTS : 0)
+@@ -3425,11 +3431,11 @@ dgrp_tty_ioctl(struct tty_struct *tty, u
+ * the break.
+ */
+ return 0;
+
+ case TIOCGSOFTCAR:
+- rc = access_ok(VERIFY_WRITE, (void *) arg, sizeof(long));
++ rc = compat_access_ok(VERIFY_WRITE, (void *) arg, sizeof(long));
+ if (rc == 0)
+ return -EFAULT;
+ put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
+ return 0;
+
+@@ -3445,11 +3451,11 @@ dgrp_tty_ioctl(struct tty_struct *tty, u
+ (arg ? CLOCAL : 0));
+ #endif
+ return 0;
+
+ case TIOCMGET:
+- rc = access_ok(VERIFY_WRITE, (void *) arg,
++ rc = compat_access_ok(VERIFY_WRITE, (void *) arg,
+ sizeof(unsigned int));
+ if (rc == 0)
+ return -EFAULT;
+ return get_modem_info(ch, (unsigned int *) arg);
+
+@@ -3729,11 +3735,11 @@ dgrp_tty_ioctl(struct tty_struct *tty, u
+ ch->ch_xxoff = dflow.stopc;
+ }
+ break;
+
+ case DIGI_GETCUSTOMBAUD:
+- rc = access_ok(VERIFY_WRITE, (void *) arg, sizeof(int));
++ rc = compat_access_ok(VERIFY_WRITE, (void *) arg, sizeof(int));
+ if (rc == 0)
+ return -EFAULT;
+ put_user(ch->ch_custom_speed, (unsigned int *) arg);
+ break;
+
diff --git a/PKGBUILD b/PKGBUILD
index ca323ca8330..f442a76ce33 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -106,7 +106,7 @@ pkgname='dgrp'
#_pkgver='1.9-38'; _dl='81000137_Y.tgz'
_pkgver='1.9-39'; _dl='40002086_Z.tgz'
pkgver="${_pkgver//-/.}"
-pkgrel='1'
+pkgrel='2'
pkgdesc="tty driver for Digi ${_opt_RealPort} ConnectPort EtherLite Flex One CM PortServer TS IBM RAN serial console terminal servers"
#_pkgdescshort="Digi ${_opt_RealPort} driver for Ethernet serial servers" # For when we used to generate the autorebuild from here
arch=('i686' 'x86_64')
@@ -184,6 +184,8 @@ source=(
"${_mibs[@]/#/${_mibsrc}}"
#'0000-Kernel-4-13-CLASS_ATTR_STRING.patch' # https://www.digi.com/support/forum/67157/realport-compile-error-with-fedora-27-kernel-4-14-14 https://www.digi.com/support/forum/65817/class_attr_driver_version-error-compiling-in-kernel-4-13
#'0001-Kernel-4-15-timers.patch' # https://forum.blackmagicdesign.com/viewtopic.php?uid=16&f=3&t=68382&start=0
+ '0002-kernel-5.0.0-do_gettimeofday.patch'
+ '0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch' # https://lkml.org/lkml/2019/1/4/418
)
unset _mibsrc
#source_i686=('http://ftp1.digi.com/support/utilities/40002890_A.tgz')
@@ -218,7 +220,9 @@ sha256sums=('0db5204cc7d7806fde39b5ea7b6a465b4310739c380d7330131956e63af0f137'
'731e05fc551367faa6ad5dc317eedf305388ab12db196c0a1361a3d01bd35279'
'c471cafa43503a40d43b42acd8bc6ef49db29e55a74e0494c85f729ea45fe243'
'5cac7ce2e6f043127f314b93694af021ae7820ffb5bf3de343da7a240d05e9c8'
- '8654496d83c083e457e8bb9bae2b1e71804d156a38c284d89872d0125eba947d')
+ '8654496d83c083e457e8bb9bae2b1e71804d156a38c284d89872d0125eba947d'
+ '353d15624675c78dfd83318195d75bdb0507fd0476f5e22be1329bf257d2de1e'
+ 'acbcf462628daf4fa2dbee064969a158ccc0bb0ce9f286ceb3617e470eab1c1f')
if [ "${_opt_DKMS}" -ne 0 ]; then
depends+=('linux' 'dkms' 'linux-headers')
@@ -296,6 +300,14 @@ prepare() {
false
fi
+ #cp -p driver/2.6.27/dgrp_mon_ops.c{,.orig}; false
+ #diff -pNau5 driver/2.6.27/dgrp_mon_ops.c{.orig,} > '0002-kernel-5.0.0-do_gettimeofday.patch'
+ patch -Nbup0 -i "${srcdir}/0002-kernel-5.0.0-do_gettimeofday.patch"
+
+ #cp -pr driver/2.6.27{,.orig}
+ #diff -pNaru5 driver/2.6.27{.orig,} > '0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch'
+ patch -Nbup0 -i "${srcdir}/0003-kernel-5.0.0-dgrp_mon_ops-access_ok.patch"
+
# Standardize name of RealPort
sed -e "s/RealPort/${_opt_RealPort}/gI" -i $(grep -lrF $'RealPort\nRealport' .)
# grep -ri realport . | grep -vF $'RealPort\nRealport'