Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: evdi

evdi (1.6.0+dfsg-1ubuntu3) focal; urgency=medium * Linux 5.4 compatibility (LP: #1848586) - debian/patches/0007-Fix-FTBFS-5.4.patch -- Paolo Pisati <paolo.pisati@canonical.com> Tue, 12 Nov 2019 10:08:47 +0000 evdi (1.6.0+dfsg-1ubuntu2) eoan; urgency=medium * Apply 3 upstream fixes to bugs found with static analysis (LP: #1833590) - 4a18c38b70e7 ("Fix potiential null pointer dereference when initializing pointer fb) - 7e840df07930 ("Free evdi->cursor before freeing evdi") - 41afcc551def ("Don't dereference pointer state if it is null") -- Colin Ian King <colin.king@canonical.com> Thu, 20 Jun 2019 18:04:22 +0100 evdi (1.6.0+dfsg-1ubuntu1) eoan; urgency=medium * Add v5.1 and v5.2 kernel compat fixes (LP: #1830043) - Adjust for post 5.0 kernels (upstream commit 979f7bc2089138aed) - Linux 5.2: use drm_fb_helper_fill_info, replaces the now deprecated drm_fb_helper_fill_{var|info} -- Colin Ian King <colin.king@canonical.com> Wed, 5 Jun 2019 09:31:31 +0100

Modifications :
  1. Download patch debian/patches/0002-Adjust-for-post-5.0-kernels.patch

    --- 1.6.0+dfsg-1/debian/patches/0002-Adjust-for-post-5.0-kernels.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.6.0+dfsg-1ubuntu3/debian/patches/0002-Adjust-for-post-5.0-kernels.patch 2019-06-05 08:17:20.000000000 +0000 @@ -0,0 +1,98 @@ +From 979f7bc2089138aede11becc239d715c47e2734f Mon Sep 17 00:00:00 2001 +From: Dawid Kurek <dawid.kurek@displaylink.com> +Date: Fri, 15 Mar 2019 09:06:08 +0100 +Subject: [PATCH] Adjust for post 5.0 kernels + +--- + module/evdi_connector.c | 4 ++++ + module/evdi_drv.h | 8 +++++--- + module/evdi_gem.c | 6 +++++- + module/evdi_main.c | 4 ++++ + module/evdi_painter.c | 4 ++++ + 5 files changed, 22 insertions(+), 4 deletions(-) + +diff --git a/module/evdi_connector.c b/module/evdi_connector.c +index dab866c..a99d3a4 100644 +--- a/module/evdi_connector.c ++++ b/module/evdi_connector.c +@@ -19,6 +19,10 @@ + #include <linux/version.h> + #include "evdi_drv.h" + ++#if KERNEL_VERSION(5, 1, 0) <= LINUX_VERSION_CODE ++#include <drm/drm_probe_helper.h> ++#endif ++ + /* + * dummy connector to just get EDID, + * all EVDI appear to have a DVI-D +diff --git a/module/evdi_drv.h b/module/evdi_drv.h +index b313f3c..cbce3fa 100644 +--- a/module/evdi_drv.h ++++ b/module/evdi_drv.h +@@ -119,10 +119,12 @@ int evdi_gem_vmap(struct evdi_gem_object *obj); + void evdi_gem_vunmap(struct evdi_gem_object *obj); + int evdi_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); + +-#if KERNEL_VERSION(4, 11, 0) > LINUX_VERSION_CODE +-int evdi_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); +-#else ++#if KERNEL_VERSION(4, 17, 0) <= LINUX_VERSION_CODE ++vm_fault_t evdi_gem_fault(struct vm_fault *vmf); ++#elif KERNEL_VERSION(4, 11, 0) <= LINUX_VERSION_CODE + int evdi_gem_fault(struct vm_fault *vmf); ++#else ++int evdi_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); + #endif + + bool evdi_painter_is_connected(struct evdi_device *evdi); +diff --git a/module/evdi_gem.c b/module/evdi_gem.c +index be35e3e..0c9bb51 100644 +--- a/module/evdi_gem.c ++++ b/module/evdi_gem.c +@@ -115,7 +115,11 @@ int evdi_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) + return ret; + } + +-#if KERNEL_VERSION(4, 11, 0) <= LINUX_VERSION_CODE ++#if KERNEL_VERSION(4, 17, 0) <= LINUX_VERSION_CODE ++vm_fault_t evdi_gem_fault(struct vm_fault *vmf) ++{ ++ struct vm_area_struct *vma = vmf->vma; ++#elif KERNEL_VERSION(4, 11, 0) <= LINUX_VERSION_CODE + int evdi_gem_fault(struct vm_fault *vmf) + { + struct vm_area_struct *vma = vmf->vma; +diff --git a/module/evdi_main.c b/module/evdi_main.c +index 603ac4d..431c3cf 100644 +--- a/module/evdi_main.c ++++ b/module/evdi_main.c +@@ -16,6 +16,10 @@ + #include "evdi_drv.h" + #include "evdi_cursor.h" + ++#if KERNEL_VERSION(5, 1, 0) <= LINUX_VERSION_CODE ++#include <drm/drm_probe_helper.h> ++#endif ++ + int evdi_driver_setup(struct drm_device *dev) + { + struct platform_device *platdev = NULL; +diff --git a/module/evdi_painter.c b/module/evdi_painter.c +index 89dc83b..a97f83e 100644 +--- a/module/evdi_painter.c ++++ b/module/evdi_painter.c +@@ -18,6 +18,10 @@ + #include <linux/mutex.h> + #include <linux/compiler.h> + ++#if KERNEL_VERSION(5, 1, 0) <= LINUX_VERSION_CODE ++#include <drm/drm_probe_helper.h> ++#endif ++ + #if KERNEL_VERSION(4, 12, 0) > LINUX_VERSION_CODE + static inline void drm_framebuffer_put(struct drm_framebuffer *fb) + { +-- +2.20.1 +
  2. Download patch debian/control

    --- 1.6.0+dfsg-1/debian/control 2019-02-25 09:53:00.000000000 +0000 +++ 1.6.0+dfsg-1ubuntu3/debian/control 2019-06-05 08:31:31.000000000 +0000 @@ -1,7 +1,8 @@ Source: evdi Section: misc Priority: optional -Maintainer: Hanno Stock <opensource@hanno-stock.de> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Hanno Stock <opensource@hanno-stock.de> Build-Depends: debhelper (>= 11), dkms, dh-exec, libdrm-dev Standards-Version: 4.3.0 Homepage: https://github.com/DisplayLink/evdi
  3. Download patch debian/patches/0007-Fix-FTBFS-5.4.patch

    --- 1.6.0+dfsg-1/debian/patches/0007-Fix-FTBFS-5.4.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.6.0+dfsg-1ubuntu3/debian/patches/0007-Fix-FTBFS-5.4.patch 2019-11-12 10:08:47.000000000 +0000 @@ -0,0 +1,114 @@ +Description: Fix FTBFS with kernel 5.4 +Author: Paolo Pisati <paolo.pisati@canonical.com> +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1848586 + +--- a/module/evdi_drv.h ++++ b/module/evdi_drv.h +@@ -20,7 +20,11 @@ + #include <drm/drm_crtc_helper.h> + #include <drm/drm_rect.h> + #include <drm/drm_gem.h> ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) ++#include <linux/dma-resv.h> ++#else + #include <linux/reservation.h> ++#endif + #include "evdi_debug.h" + + #define DRIVER_NAME "evdi" +@@ -51,8 +55,13 @@ + struct page **pages; + void *vmapping; + struct sg_table *sg; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) ++ struct dma_resv *resv; ++ struct dma_resv _resv; ++#else + struct reservation_object *resv; + struct reservation_object _resv; ++#endif + }; + + #define to_evdi_bo(x) container_of(x, struct evdi_gem_object, base) +@@ -112,8 +121,11 @@ + + struct drm_gem_object *evdi_gem_prime_import(struct drm_device *dev, + struct dma_buf *dma_buf); +-struct dma_buf *evdi_gem_prime_export(struct drm_device *dev, +- struct drm_gem_object *obj, int flags); ++struct dma_buf *evdi_gem_prime_export( ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) ++ struct drm_device *dev, ++#endif ++ struct drm_gem_object *obj, int flags); + + int evdi_gem_vmap(struct evdi_gem_object *obj); + void evdi_gem_vunmap(struct evdi_gem_object *obj); +--- a/module/evdi_drv.c ++++ b/module/evdi_drv.c +@@ -81,8 +81,11 @@ + } + + static struct drm_driver driver = { +- .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME +- | DRIVER_ATOMIC, ++ .driver_features = DRIVER_MODESET | DRIVER_GEM ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) ++ | DRIVER_PRIME ++#endif ++ | DRIVER_ATOMIC, + #if KERNEL_VERSION(4, 12, 0) > LINUX_VERSION_CODE + .load = evdi_driver_load, + #endif +--- a/module/evdi_gem.c ++++ b/module/evdi_gem.c +@@ -61,7 +61,11 @@ + return NULL; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) + reservation_object_init(&obj->_resv); ++#else ++ dma_resv_init(&obj->_resv); ++#endif + obj->resv = &obj->_resv; + + return obj; +@@ -255,7 +259,11 @@ + if (gem_obj->dev->vma_offset_manager) + drm_gem_free_mmap_offset(gem_obj); + +- reservation_object_fini(&obj->_resv); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) ++ reservation_object_init(&obj->_resv); ++#else ++ dma_resv_init(&obj->_resv); ++#endif + obj->resv = NULL; + } + +@@ -569,8 +577,11 @@ + return ERR_PTR(ret); + } + +-struct dma_buf *evdi_gem_prime_export(__maybe_unused struct drm_device *dev, +- struct drm_gem_object *obj, int flags) ++struct dma_buf *evdi_gem_prime_export( ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) ++ __maybe_unused struct drm_device *dev, ++#endif ++ struct drm_gem_object *obj, int flags) + { + struct evdi_gem_object *evdi_obj = to_evdi_bo(obj); + struct dma_buf_export_info exp_info = { +@@ -582,7 +593,9 @@ + .priv = obj + }; + +-#if KERNEL_VERSION(4, 9, 0) <= LINUX_VERSION_CODE ++#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE ++ return drm_gem_dmabuf_export(obj->dev, &exp_info); ++#elif KERNEL_VERSION(4, 9, 0) <= LINUX_VERSION_CODE + return drm_gem_dmabuf_export(dev, &exp_info); + #else + return dma_buf_export(&exp_info);
  4. Download patch debian/patches/series

    --- 1.6.0+dfsg-1/debian/patches/series 2019-02-25 09:53:00.000000000 +0000 +++ 1.6.0+dfsg-1ubuntu3/debian/patches/series 2019-11-12 10:08:47.000000000 +0000 @@ -1 +1,7 @@ 0001-Make-library-Makefile-respect-LDFLAGS.patch +0002-Adjust-for-post-5.0-kernels.patch +0003-Linux-5.2-use-drm_fb_helper_fill_info.patch +0004-Don-t-dereference-pointer-state-if-it-is-null.patch +0005-Free-evdi-cursor-before-freeing-evdi.patch +0006-Fix-potiential-null-pointer-dereference-when-initial.patch +0007-Fix-FTBFS-5.4.patch
  5. Download patch debian/patches/0003-Linux-5.2-use-drm_fb_helper_fill_info.patch

    --- 1.6.0+dfsg-1/debian/patches/0003-Linux-5.2-use-drm_fb_helper_fill_info.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.6.0+dfsg-1ubuntu3/debian/patches/0003-Linux-5.2-use-drm_fb_helper_fill_info.patch 2019-06-05 08:18:06.000000000 +0000 @@ -0,0 +1,37 @@ +From 2390fd352fdcf4693279e14f1338c3000c9e5c29 Mon Sep 17 00:00:00 2001 +From: Colin Ian King <colin.king@canonical.com> +Date: Wed, 5 Jun 2019 09:05:22 +0100 +Subject: [PATCH] Linux 5.2: use drm_fb_helper_fill_info + +Linux commit 168b85e9b223 ("drm/fb-helper: Unexport fill_{var,info}") +unexported drm_fb_helper_fill_fix and drm_fb_helper_fill_var, so +now use the new helper drm_fb_helper_fill_info instead. + +Signed-off-by: Colin Ian King <colin.king@canonical.com> +--- + module/evdi_fb.c | 5 +++++ + 1 file changed, 5 insertions(+) + +Index: evdi-1.6.0+dfsg/module/evdi_fb.c +=================================================================== +--- evdi-1.6.0+dfsg.orig/module/evdi_fb.c ++++ evdi-1.6.0+dfsg/module/evdi_fb.c +@@ -439,6 +439,8 @@ static int evdifb_create(struct drm_fb_h + + efbdev->fb_ops = evdifb_ops; + info->fbops = &efbdev->fb_ops; ++ ++#if KERNEL_VERSION(5, 2, 0) > LINUX_VERSION_CODE + #if KERNEL_VERSION(4, 11, 0) > LINUX_VERSION_CODE + drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); + #else +@@ -446,6 +448,9 @@ static int evdifb_create(struct drm_fb_h + #endif + drm_fb_helper_fill_var(info, &efbdev->helper, sizes->fb_width, + sizes->fb_height); ++#else ++ drm_fb_helper_fill_info(info, &efbdev->helper, sizes); ++#endif + + ret = fb_alloc_cmap(&info->cmap, 256, 0); + if (ret) {
  6. Download patch debian/patches/0006-Fix-potiential-null-pointer-dereference-when-initial.patch

    --- 1.6.0+dfsg-1/debian/patches/0006-Fix-potiential-null-pointer-dereference-when-initial.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.6.0+dfsg-1ubuntu3/debian/patches/0006-Fix-potiential-null-pointer-dereference-when-initial.patch 2019-06-20 17:04:22.000000000 +0000 @@ -0,0 +1,51 @@ +From 4a18c38b70e7b59ff2693b36a99d1dca6d34b474 Mon Sep 17 00:00:00 2001 +From: Colin Ian King <colin.king@canonical.com> +Date: Wed, 12 Jun 2019 11:15:30 +0100 +Subject: [PATCH] Fix potiential null pointer dereference when initializing + pointer fb +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +There is a sanity check at the end of evdi_painter_mode_changed_notify +to see if pointer 'painter' is null. This implies it is null at the +start of the function, in which case the assignment of fb using +fb = &painter->scanout_fb->base will be performing a null pointer +dereference. Fix this by sanity checking if pointer is null to start +with and bail out early if it is. + +Addresses-Coverity: ("Dereference before null check") +Signed-off-by: Colin Ian King <colin.king@canonical.com> +--- + module/evdi_painter.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +Index: evdi-1.6.0+dfsg/module/evdi_painter.c +=================================================================== +--- evdi-1.6.0+dfsg.orig/module/evdi_painter.c ++++ evdi-1.6.0+dfsg/module/evdi_painter.c +@@ -585,10 +585,14 @@ void evdi_painter_mode_changed_notify(st + struct drm_display_mode *new_mode) + { + struct evdi_painter *painter = evdi->painter; +- struct drm_framebuffer *fb = &painter->scanout_fb->base; ++ struct drm_framebuffer *fb; + int bits_per_pixel; + uint32_t pixel_format; + ++ if (painter == NULL) ++ return; ++ ++ fb = &painter->scanout_fb->base; + if (fb == NULL) + return; + +@@ -609,8 +613,7 @@ void evdi_painter_mode_changed_notify(st + new_mode, + bits_per_pixel, + pixel_format); +- if (painter) +- painter->needs_full_modeset = false; ++ painter->needs_full_modeset = false; + } + + static int
  7. Download patch debian/patches/0005-Free-evdi-cursor-before-freeing-evdi.patch

    --- 1.6.0+dfsg-1/debian/patches/0005-Free-evdi-cursor-before-freeing-evdi.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.6.0+dfsg-1ubuntu3/debian/patches/0005-Free-evdi-cursor-before-freeing-evdi.patch 2019-06-20 17:04:22.000000000 +0000 @@ -0,0 +1,35 @@ +From 7e840df079303ed54dcd27bb641471f11df753a8 Mon Sep 17 00:00:00 2001 +From: Colin Ian King <colin.king@canonical.com> +Date: Wed, 12 Jun 2019 11:10:43 +0100 +Subject: [PATCH] Free evdi->cursor before freeing evdi +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Currently evdi is freed and then evdi->cursor is freed, fix +this by swapping the order to avoid dereferencing a freed pointer. + +Addresses-Coverity: ("Use after free") +Signed-off-by: Colin Ian King <colin.king@canonical.com> +--- + module/evdi_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/module/evdi_main.c b/module/evdi_main.c +index 431c3cf..9f8990b 100644 +--- a/module/evdi_main.c ++++ b/module/evdi_main.c +@@ -67,10 +67,10 @@ err_fb: + evdi_fbdev_cleanup(dev); + #endif /* CONFIG_FB */ + err: +- kfree(evdi); + EVDI_ERROR("%d\n", ret); + if (evdi->cursor) + evdi_cursor_free(evdi->cursor); ++ kfree(evdi); + return ret; + } + +-- +2.20.1 +
  8. Download patch debian/patches/0004-Don-t-dereference-pointer-state-if-it-is-null.patch

    --- 1.6.0+dfsg-1/debian/patches/0004-Don-t-dereference-pointer-state-if-it-is-null.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.6.0+dfsg-1ubuntu3/debian/patches/0004-Don-t-dereference-pointer-state-if-it-is-null.patch 2019-06-20 17:04:22.000000000 +0000 @@ -0,0 +1,40 @@ +From 41afcc551def7b2d909ecfb7697800fedb493813 Mon Sep 17 00:00:00 2001 +From: Colin Ian King <colin.king@canonical.com> +Date: Wed, 12 Jun 2019 11:05:48 +0100 +Subject: [PATCH] Don't dereference pointer state if it is null +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +An earlier check on the pointer 'state' implies it could be null +and the calls drm_atomic_state_put/drm_atomic_state_free can +dereference it causing a null pointer dereference if it is null. +Add a null check to state so that we avoid the null dereferences. + +Issue found by static analysis checking with Coverity. + +Addreses-Coverity: ("Dereference after null check") +Signed-off-by: Colin Ian King <colin.king@canonical.com> +--- + module/evdi_fb.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +Index: evdi-1.6.0+dfsg/module/evdi_fb.c +=================================================================== +--- evdi-1.6.0+dfsg.orig/module/evdi_fb.c ++++ evdi-1.6.0+dfsg/module/evdi_fb.c +@@ -309,11 +309,13 @@ out: + #endif + } + ++ if (state) { + #if KERNEL_VERSION(4, 10, 0) <= LINUX_VERSION_CODE +- drm_atomic_state_put(state); ++ drm_atomic_state_put(state); + #else +- drm_atomic_state_free(state); ++ drm_atomic_state_free(state); + #endif ++ } + + drm_modeset_drop_locks(&ctx); + drm_modeset_acquire_fini(&ctx);
  1. evdi