Merge branch 'master' into staging
authorJakub Kądziołka <kuba@kadziolka.net>
Sat, 28 Mar 2020 23:38:13 +0000 (00:38 +0100)
committerJakub Kądziołka <kuba@kadziolka.net>
Sat, 28 Mar 2020 23:38:13 +0000 (00:38 +0100)
gnu/local.mk
gnu/packages/imagemagick.scm
gnu/packages/linux.scm
gnu/packages/patches/bluez-CVE-2020-0556.patch [deleted file]
gnu/packages/rust-apps.scm
guix/build-system/cargo.scm
guix/build/cargo-build-system.scm

index b8649b3..4a9a5e1 100644 (file)
@@ -770,7 +770,6 @@ dist_patch_DATA =                                           \
   %D%/packages/patches/binutils-loongson-workaround.patch      \
   %D%/packages/patches/blender-2.79-newer-ffmpeg.patch         \
   %D%/packages/patches/blender-2.79-python-3.7-fix.patch       \
-  %D%/packages/patches/bluez-CVE-2020-0556.patch               \
   %D%/packages/patches/byobu-writable-status.patch             \
   %D%/packages/patches/calibre-no-updates-dialog.patch         \
   %D%/packages/patches/calibre-remove-test-bs4.patch           \
index 3c1fe01..5287255 100644 (file)
                "0fcbcad95wn0q0pdfl0qgycm30f3a7xhskc0r5icldq6v6l4b3is"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags '("--with-frozenpaths" "--without-gcc-arch")
+     `(#:configure-flags '("--with-frozenpaths" "--without-gcc-arch"
+
+                           ;; Do not embed the build date in binaries.
+                           "--enable-reproducible-build")
+
        ;; FIXME: The test suite succeeded before version 6.9.6-2.
        ;; Try enabling it again with newer releases.
        #:tests? #f
index 8fec335..1c23489 100644 (file)
@@ -4094,8 +4094,7 @@ Bluetooth audio output devices like headphones or loudspeakers.")
 (define-public bluez
   (package
     (name "bluez")
-    (replacement bluez/fixed)
-    (version "5.53")
+    (version "5.54")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -4103,7 +4102,7 @@ Bluetooth audio output devices like headphones or loudspeakers.")
                     version ".tar.xz"))
               (sha256
                (base32
-                "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
+                "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
@@ -4160,14 +4159,6 @@ Bluetooth audio output devices like headphones or loudspeakers.")
 is flexible, efficient and uses a modular implementation.")
     (license license:gpl2+)))
 
-(define bluez/fixed
-  (package
-    (inherit bluez)
-    (source (origin
-              (inherit (package-source bluez))
-              (patches (append (origin-patches (package-source bluez))
-                               (search-patches "bluez-CVE-2020-0556.patch")))))))
-
 (define-public fuse-exfat
   (package
     (name "fuse-exfat")
diff --git a/gnu/packages/patches/bluez-CVE-2020-0556.patch b/gnu/packages/patches/bluez-CVE-2020-0556.patch
deleted file mode 100644 (file)
index 7c34459..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-Fix CVE-2020-0556:
-
-https://lore.kernel.org/linux-bluetooth/20200310023516.209146-1-alainm@chromium.org/
-https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00352.html
-http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-0556
-
-Patches copied from upstream source repository:
-
-https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=3cccdbab2324086588df4ccf5f892fb3ce1f1787
-https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=8cdbd3b09f29da29374e2f83369df24228da0ad1
-
-From 3cccdbab2324086588df4ccf5f892fb3ce1f1787 Mon Sep 17 00:00:00 2001
-From: Alain Michaud <alainm@chromium.org>
-Date: Tue, 10 Mar 2020 02:35:18 +0000
-Subject: [PATCH] HID accepts bonded device connections only.
-
-This change adds a configuration for platforms to choose a more secure
-posture for the HID profile.  While some older mice are known to not
-support pairing or encryption, some platform may choose a more secure
-posture by requiring the device to be bonded  and require the
-connection to be encrypted when bonding is required.
-
-Reference:
-https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00352.html
----
- profiles/input/device.c   | 23 ++++++++++++++++++++++-
- profiles/input/device.h   |  1 +
- profiles/input/input.conf |  8 ++++++++
- profiles/input/manager.c  | 13 ++++++++++++-
- 4 files changed, 43 insertions(+), 2 deletions(-)
-
-diff --git a/profiles/input/device.c b/profiles/input/device.c
-index 2cb3811c8..d89da2d7c 100644
---- a/profiles/input/device.c
-+++ b/profiles/input/device.c
-@@ -92,6 +92,7 @@ struct input_device {
- static int idle_timeout = 0;
- static bool uhid_enabled = false;
-+static bool classic_bonded_only = false;
- void input_set_idle_timeout(int timeout)
- {
-@@ -103,6 +104,11 @@ void input_enable_userspace_hid(bool state)
-       uhid_enabled = state;
- }
-+void input_set_classic_bonded_only(bool state)
-+{
-+      classic_bonded_only = state;
-+}
-+
- static void input_device_enter_reconnect_mode(struct input_device *idev);
- static int connection_disconnect(struct input_device *idev, uint32_t flags);
-@@ -970,8 +976,18 @@ static int hidp_add_connection(struct input_device *idev)
-       if (device_name_known(idev->device))
-               device_get_name(idev->device, req->name, sizeof(req->name));
-+      /* Make sure the device is bonded if required */
-+      if (classic_bonded_only && !device_is_bonded(idev->device,
-+                              btd_device_get_bdaddr_type(idev->device))) {
-+              error("Rejected connection from !bonded device %s", dst_addr);
-+              goto cleanup;
-+      }
-+
-       /* Encryption is mandatory for keyboards */
--      if (req->subclass & 0x40) {
-+      /* Some platforms may choose to require encryption for all devices */
-+      /* Note that this only matters for pre 2.1 devices as otherwise the */
-+      /* device is encrypted by default by the lower layers */
-+      if (classic_bonded_only || req->subclass & 0x40) {
-               if (!bt_io_set(idev->intr_io, &gerr,
-                                       BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
-                                       BT_IO_OPT_INVALID)) {
-@@ -1203,6 +1219,11 @@ static void input_device_enter_reconnect_mode(struct input_device *idev)
-       DBG("path=%s reconnect_mode=%s", idev->path,
-                               reconnect_mode_to_string(idev->reconnect_mode));
-+      /* Make sure the device is bonded if required */
-+      if (classic_bonded_only && !device_is_bonded(idev->device,
-+                              btd_device_get_bdaddr_type(idev->device)))
-+              return;
-+
-       /* Only attempt an auto-reconnect when the device is required to
-        * accept reconnections from the host.
-        */
-diff --git a/profiles/input/device.h b/profiles/input/device.h
-index 51a9aee18..3044db673 100644
---- a/profiles/input/device.h
-+++ b/profiles/input/device.h
-@@ -29,6 +29,7 @@ struct input_conn;
- void input_set_idle_timeout(int timeout);
- void input_enable_userspace_hid(bool state);
-+void input_set_classic_bonded_only(bool state);
- int input_device_register(struct btd_service *service);
- void input_device_unregister(struct btd_service *service);
-diff --git a/profiles/input/input.conf b/profiles/input/input.conf
-index 3e1d65aae..166aff4a4 100644
---- a/profiles/input/input.conf
-+++ b/profiles/input/input.conf
-@@ -11,3 +11,11 @@
- # Enable HID protocol handling in userspace input profile
- # Defaults to false (HIDP handled in HIDP kernel module)
- #UserspaceHID=true
-+
-+# Limit HID connections to bonded devices
-+# The HID Profile does not specify that devices must be bonded, however some
-+# platforms may want to make sure that input connections only come from bonded
-+# device connections. Several older mice have been known for not supporting
-+# pairing/encryption.
-+# Defaults to false to maximize device compatibility.
-+#ClassicBondedOnly=true
-diff --git a/profiles/input/manager.c b/profiles/input/manager.c
-index 1d31b0652..5cd27b839 100644
---- a/profiles/input/manager.c
-+++ b/profiles/input/manager.c
-@@ -96,7 +96,7 @@ static int input_init(void)
-       config = load_config_file(CONFIGDIR "/input.conf");
-       if (config) {
-               int idle_timeout;
--              gboolean uhid_enabled;
-+              gboolean uhid_enabled, classic_bonded_only;
-               idle_timeout = g_key_file_get_integer(config, "General",
-                                                       "IdleTimeout", &err);
-@@ -114,6 +114,17 @@ static int input_init(void)
-                       input_enable_userspace_hid(uhid_enabled);
-               } else
-                       g_clear_error(&err);
-+
-+              classic_bonded_only = g_key_file_get_boolean(config, "General",
-+                                              "ClassicBondedOnly", &err);
-+
-+              if (!err) {
-+                      DBG("input.conf: ClassicBondedOnly=%s",
-+                                      classic_bonded_only ? "true" : "false");
-+                      input_set_classic_bonded_only(classic_bonded_only);
-+              } else
-+                      g_clear_error(&err);
-+
-       }
-       btd_profile_register(&input_profile);
--- 
-2.25.1
-
-From 8cdbd3b09f29da29374e2f83369df24228da0ad1 Mon Sep 17 00:00:00 2001
-From: Alain Michaud <alainm@chromium.org>
-Date: Tue, 10 Mar 2020 02:35:16 +0000
-Subject: [PATCH] HOGP must only accept data from bonded devices.
-
-HOGP 1.0 Section 6.1 establishes that the HOGP must require bonding.
-
-Reference:
-https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00352.htm
----
- profiles/input/hog.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/profiles/input/hog.c b/profiles/input/hog.c
-index 83c017dcb..dfac68921 100644
---- a/profiles/input/hog.c
-+++ b/profiles/input/hog.c
-@@ -186,6 +186,10 @@ static int hog_accept(struct btd_service *service)
-                       return -EINVAL;
-       }
-+      /* HOGP 1.0 Section 6.1 requires bonding */
-+      if (!device_is_bonded(device, btd_device_get_bdaddr_type(device)))
-+              return -ECONNREFUSED;
-+
-       /* TODO: Replace GAttrib with bt_gatt_client */
-       bt_hog_attach(dev->hog, attrib);
--- 
-2.25.1
-
index af51c0f..2c718a1 100644 (file)
@@ -244,18 +244,8 @@ provides defaults for 80% of the use cases.")
                 (install-file manpage (string-append
                                         (assoc-ref outputs "out")
                                         "/share/man/man1"))))
-             #t))
-         (replace 'install
-           ;; Adapted from (guix build cargo-build-system). The flags need to
-           ;; be passed to `cargo install' too, as otherwise it will build
-           ;; another binary, without the features.
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (mkdir-p out)
-               (setenv "CARGO_TARGET_DIR" "./target")
-               (invoke "cargo" "install" "--path" "." "--root" out
-                       "--features" "pcre2")))))
-       #:cargo-build-flags '("--release" "--features" "pcre2")))
+             #t)))
+       #:features '("pcre2")))
     (native-inputs
      `(("asciidoc" ,asciidoc)
        ("pcre2" ,pcre2)
index 1e8b3a5..6c8edf6 100644 (file)
@@ -4,6 +4,7 @@
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -76,6 +77,7 @@ to NAME and VERSION."
                       (vendor-dir "guix-vendor")
                       (cargo-build-flags ''("--release"))
                       (cargo-test-flags ''("--release"))
+                      (features ''())
                       (skip-build? #f)
                       (phases '(@ (guix build cargo-build-system)
                                   %standard-phases))
@@ -104,6 +106,7 @@ to NAME and VERSION."
                     #:vendor-dir ,vendor-dir
                     #:cargo-build-flags ,cargo-build-flags
                     #:cargo-test-flags ,cargo-test-flags
+                    #:features ,features
                     #:skip-build? ,skip-build?
                     #:tests? ,(and tests? (not skip-build?))
                     #:phases ,phases
index 0721989..95e8dd7 100644 (file)
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -140,11 +141,14 @@ directory = '" port)
 
 (define* (build #:key
                 skip-build?
+                features
                 (cargo-build-flags '("--release"))
                 #:allow-other-keys)
   "Build a given Cargo package."
   (or skip-build?
-      (apply invoke `("cargo" "build" ,@cargo-build-flags))))
+      (apply invoke "cargo" "build"
+             "--features" (string-join features)
+             cargo-build-flags)))
 
 (define* (check #:key
                 tests?
@@ -152,10 +156,10 @@ directory = '" port)
                 #:allow-other-keys)
   "Run tests for a given Cargo package."
   (if tests?
-      (apply invoke `("cargo" "test" ,@cargo-test-flags))
+      (apply invoke "cargo" "test" cargo-test-flags)
       #t))
 
-(define* (install #:key inputs outputs skip-build? #:allow-other-keys)
+(define* (install #:key inputs outputs skip-build? features #:allow-other-keys)
   "Install a given Cargo package."
   (let* ((out (assoc-ref outputs "out")))
     (mkdir-p out)
@@ -168,7 +172,8 @@ directory = '" port)
     ;; otherwise cargo will raise an error.
     (or skip-build?
         (not (has-executable-target?))
-        (invoke "cargo" "install" "--path" "." "--root" out))))
+        (invoke "cargo" "install" "--path" "." "--root" out
+                "--features" (string-join features)))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases