summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Devir2019-11-27 16:58:55 +1000
committerKyle Devir2019-11-27 16:58:55 +1000
commit06b880b4dd2da0f8a1339bb22ca6314b6e574e98 (patch)
tree5fa540a742464f762f88139cb26b56f1ddbeeed4
parent9e0f31fa333ea91a5c1c25b4a096a1a983b8a19a (diff)
downloadaur-06b880b4dd2da0f8a1339bb22ca6314b6e574e98.tar.gz
5.3.13.1-1
-rwxr-xr-x.SRCINFO30
-rw-r--r--4932fe6b8e63b92f8252591b5381423c01bac552.patch63
-rwxr-xr-xPKGBUILD82
-rw-r--r--config2
-rw-r--r--d938db454691d69590eb081db22c507c9ebca5f8.patch131
5 files changed, 228 insertions, 80 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8cc9900dd810..64f955ce19cf 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,29 +1,27 @@
pkgbase = linux-bcachefs-git
pkgdesc = Linux
- pkgver = v5.3.11.arch1.r859541.ae4815c57d21
+ pkgver = v5.3.13.arch1.r859600.e04bb6cd44cd
pkgrel = 1
url = https://github.com/koverstreet/bcachefs
arch = x86_64
license = GPL2
- makedepends = xmlto
- makedepends = kmod
- makedepends = inetutils
makedepends = bc
+ makedepends = kmod
makedepends = libelf
- makedepends = python-sphinx
- makedepends = python-sphinx_rtd_theme
- makedepends = graphviz
- makedepends = imagemagick
makedepends = git
options = !strip
source = git+https://github.com/koverstreet/bcachefs#branch=master
source = git+https://github.com/graysky2/kernel_gcc_patch
source = config
+ source = d938db454691d69590eb081db22c507c9ebca5f8.patch
+ source = 4932fe6b8e63b92f8252591b5381423c01bac552.patch
validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886
validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E
sha512sums = SKIP
sha512sums = SKIP
- sha512sums = beb2a30558f3e5cc6aa56c8ec908309c40cf9fae02151d16bb7c229dc4f20fe5c26def36a06d12464edf84c25dfa04c4e9490599ca53d388b7735846c81114b8
+ sha512sums = 9ce38cfa57475b74098229956a8b97a82bda8aeff831728542b4939e67c4af8e929c4cf8e27b0549829e5f011859369b2ab19b4fdfeb096afb339bc1bff8c622
+ sha512sums = 9ae28fd6b4099a44f2b45078383b172a974677863c622ffdecf095664524681b95a224fe8abbb1d0f3a3d7924f755908d3beb4c8c5d415068b101403c307f2d0
+ sha512sums = a7c5608f2478ea7f1f6a3ab0cf60d37715097fabdd19777603b385d2a0b0009e5da7fd9fc0ca0addee3f3fab8fff35f7e45696fd6b6c6bc8dc8fb366cbde5e0c
pkgname = linux-bcachefs-git
pkgdesc = The Linux kernel and modules ~ featuring Kent Overstreet's bcachefs filesystem
@@ -33,17 +31,11 @@ pkgname = linux-bcachefs-git
depends = bcachefs-tools-git
optdepends = crda: to set the correct wireless channels of your country
optdepends = linux-firmware: firmware images needed for some devices
- provides = linux-bcachefs-git=v5.3.11.arch1.r859541.ae4815c57d21
+ provides = linux-bcachefs-git=v5.3.13.arch1.r859600.e04bb6cd44cd
pkgname = linux-bcachefs-git-headers
pkgdesc = Header files and scripts for building modules for Linux kernel ~ featuring Kent Overstreet's bcachefs filesystem
- depends = linux-bcachefs-git=v5.3.11.arch1.r859541.ae4815c57d21
- provides = linux-bcachefs-git-headers=v5.3.11.arch1.r859541.ae4815c57d21
- provides = linux-headers=v5.3.11.arch1.r859541.ae4815c57d21
-
-pkgname = linux-bcachefs-git-docs
- pkgdesc = Kernel hacker's manual for the Linux kernel ~ featuring Kent Overstreet's bcachefs filesystem
- depends = linux-bcachefs-git=v5.3.11.arch1.r859541.ae4815c57d21
- provides = linux-bcachefs-git-docs=v5.3.11.arch1.r859541.ae4815c57d21
- provides = linux-docs=v5.3.11.arch1.r859541.ae4815c57d21
+ depends = linux-bcachefs-git=v5.3.13.arch1.r859600.e04bb6cd44cd
+ provides = linux-bcachefs-git-headers=v5.3.13.arch1.r859600.e04bb6cd44cd
+ provides = linux-headers=v5.3.13.arch1.r859600.e04bb6cd44cd
diff --git a/4932fe6b8e63b92f8252591b5381423c01bac552.patch b/4932fe6b8e63b92f8252591b5381423c01bac552.patch
new file mode 100644
index 000000000000..732f0c64194d
--- /dev/null
+++ b/4932fe6b8e63b92f8252591b5381423c01bac552.patch
@@ -0,0 +1,63 @@
+From 4932fe6b8e63b92f8252591b5381423c01bac552 Mon Sep 17 00:00:00 2001
+From: Dan Elkouby <streetwalkermc@gmail.com>
+Date: Fri, 6 Sep 2019 14:06:44 +0300
+Subject: Bluetooth: hidp: Fix assumptions on the return value of
+ hidp_send_message
+
+hidp_send_message was changed to return non-zero values on success,
+which some other bits did not expect. This caused spurious errors to be
+propagated through the stack, breaking some drivers, such as hid-sony
+for the Dualshock 4 in Bluetooth mode.
+
+As pointed out by Dan Carpenter, hid-microsoft directly relied on that
+assumption as well.
+
+Fixes: 48d9cc9d85dd ("Bluetooth: hidp: Let hidp_send_message return number of queued bytes")
+
+Signed-off-by: Dan Elkouby <streetwalkermc@gmail.com>
+Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
+Reviewed-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+---
+ drivers/hid/hid-microsoft.c | 2 +-
+ net/bluetooth/hidp/core.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c
+index 572b5789d20f..2d8b589201a4 100644
+--- a/drivers/hid/hid-microsoft.c
++++ b/drivers/hid/hid-microsoft.c
+@@ -303,7 +303,7 @@ static void ms_ff_worker(struct work_struct *work)
+ r->magnitude[MAGNITUDE_WEAK] = ms->weak; /* right actuator */
+
+ ret = hid_hw_output_report(hdev, (__u8 *)r, sizeof(*r));
+- if (ret)
++ if (ret < 0)
+ hid_warn(hdev, "failed to send FF report\n");
+ }
+
+diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
+index 8d889969ae7e..bef84b95e2c4 100644
+--- a/net/bluetooth/hidp/core.c
++++ b/net/bluetooth/hidp/core.c
+@@ -267,7 +267,7 @@ static int hidp_get_raw_report(struct hid_device *hid,
+ set_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
+ data[0] = report_number;
+ ret = hidp_send_ctrl_message(session, report_type, data, 1);
+- if (ret)
++ if (ret < 0)
+ goto err;
+
+ /* Wait for the return of the report. The returned report
+@@ -343,7 +343,7 @@ static int hidp_set_raw_report(struct hid_device *hid, unsigned char reportnum,
+ data[0] = reportnum;
+ set_bit(HIDP_WAITING_FOR_SEND_ACK, &session->flags);
+ ret = hidp_send_ctrl_message(session, report_type, data, count);
+- if (ret)
++ if (ret < 0)
+ goto err;
+
+ /* Wait for the ACK from the device. */
+--
+cgit v1.2.1-1-g437b
+
diff --git a/PKGBUILD b/PKGBUILD
index eb2f19a8b865..88641183d62f 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -59,23 +59,17 @@ _subarch=
_localmodcfg=
pkgbase=linux-bcachefs-git
-pkgver=v5.3.11.arch1.r859541.ae4815c57d21
+pkgver=v5.3.13.arch1.r859600.e04bb6cd44cd
pkgrel=1
pkgdesc="Linux"
-_srcver_tag=v5.3.11-arch1
+_srcver_tag=v5.3.13-arch1
url="https://github.com/koverstreet/bcachefs"
arch=(x86_64)
license=(GPL2)
makedepends=(
- xmlto
- kmod
- inetutils
bc
+ kmod
libelf
- python-sphinx
- python-sphinx_rtd_theme
- graphviz
- imagemagick
git
)
options=('!strip')
@@ -93,6 +87,8 @@ source=(
"git+$_repo_url#branch=master"
"git+$_repo_url_gcc_patch"
config # the main kernel config file
+ d938db454691d69590eb081db22c507c9ebca5f8.patch
+ 4932fe6b8e63b92f8252591b5381423c01bac552.patch
)
validpgpkeys=(
"ABAF11C65A2970B130ABE3C479BE3E4300411886" # Linus Torvalds
@@ -100,14 +96,16 @@ validpgpkeys=(
)
sha512sums=('SKIP'
'SKIP'
- 'beb2a30558f3e5cc6aa56c8ec908309c40cf9fae02151d16bb7c229dc4f20fe5c26def36a06d12464edf84c25dfa04c4e9490599ca53d388b7735846c81114b8')
+ '9ce38cfa57475b74098229956a8b97a82bda8aeff831728542b4939e67c4af8e929c4cf8e27b0549829e5f011859369b2ab19b4fdfeb096afb339bc1bff8c622'
+ '9ae28fd6b4099a44f2b45078383b172a974677863c622ffdecf095664524681b95a224fe8abbb1d0f3a3d7924f755908d3beb4c8c5d415068b101403c307f2d0'
+ 'a7c5608f2478ea7f1f6a3ab0cf60d37715097fabdd19777603b385d2a0b0009e5da7fd9fc0ca0addee3f3fab8fff35f7e45696fd6b6c6bc8dc8fb366cbde5e0c')
export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
pkgver() {
- cd "$_reponame"
+ cd $_reponame
printf "%s.r%s.%s" "${_srcver_tag//-/.}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
@@ -119,23 +117,23 @@ prepare() {
echo "-$pkgrel" > localversion.10-pkgrel
echo "${pkgbase#linux}" > localversion.20-pkgname
- msg2 "Adding patches from Linux upstream kernel repository..."
+ msg2 "Pull releases from Linux stable upstream repository..."
git remote add upstream_stable "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git" || true
- # git pull --no-edit -s recursive -X ours upstream_stable ${_srcver_tag//-arch*/}
git pull --no-edit upstream_stable ${_srcver_tag//-arch*/}
-
- # Revert broken commit for now, until bcachefs upstream fixes it
- # https://github.com/koverstreet/bcachefs/issues/74
- # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.2.1&id=c785529bebceeaf38db8ebf9b50ff3a173fb18c6
- # block: fix .bi_size overflow
- # git revert --no-edit c785529bebceeaf38db8ebf9b50ff3a173fb18c6
+ # git pull --no-edit -s recursive -X ours upstream_stable ${_srcver_tag//-arch*/}
- msg2 "Pull stable releases from Arch vanilla kernel repository..."
- git remote add arch_stable "https://git.archlinux.org/linux.git" || true
- git pull --no-edit arch_stable "$_srcver_tag"
+ # msg2 "Pull stable releases from Arch vanilla kernel repository..."
+ # git remote add arch_stable "https://git.archlinux.org/linux.git" || true
+ # git pull --no-edit arch_stable "$_srcver_tag"
+
+ msg2 "Patching with commit: 'ZEN: Add sysctl and CONFIG to disallow unprivileged CLONE_NEWUSER' ..."
+ patch -Np1 -i "$srcdir/d938db454691d69590eb081db22c507c9ebca5f8.patch"
+
+ msg2 "Patching with commit: 'Bluetooth: hidp: Fix assumptions on the return value of hidp_send_message' ..."
+ patch -Np1 -i "$srcdir/4932fe6b8e63b92f8252591b5381423c01bac552.patch"
# https://github.com/graysky2/kernel_gcc_patch
- msg2 "Patching to enabled additional gcc CPU optimizatons..."
+ msg2 "Patching with Graysky's additional gcc CPU optimizatons..."
patch -Np1 -i "$srcdir/$_reponame_gcc_patch/$_gcc_patch_name"
msg2 "Setting config..."
@@ -173,7 +171,7 @@ prepare() {
build() {
cd $_reponame
- make bzImage modules htmldocs
+ make bzImage modules
}
_package() {
@@ -295,45 +293,9 @@ _package-headers() {
chmod -Rc u=rwX,go=rX "$pkgdir"
}
-_package-docs() {
- pkgdesc="Kernel hacker's manual for the $pkgdesc kernel $_pkgdesc_extra"
- depends=("$pkgbase=$pkgver")
- provides=(
- "$pkgbase-docs=$pkgver"
- "linux-docs=$pkgver"
- )
-
- cd $_reponame
- local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
-
- msg2 "Installing documentation..."
- mkdir -p "$builddir"
- cp -t "$builddir" -a Documentation
-
- msg2 "Removing unneeded files..."
- rm -rv "$builddir"/Documentation/{,output/}.[^.]*
-
- msg2 "Moving HTML docs..."
- local src dst
- while read -rd '' src; do
- dst="$builddir/Documentation/${src#$builddir/Documentation/output/}"
- mkdir -p "${dst%/*}"
- mv "$src" "$dst"
- rmdir -p --ignore-fail-on-non-empty "${src%/*}"
- done < <(find "$builddir/Documentation/output" -type f -print0)
-
- msg2 "Adding symlink..."
- mkdir -p "$pkgdir/usr/share/doc"
- ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"
-
- msg2 "Fixing permissions..."
- chmod -Rc u=rwX,go=rX "$pkgdir"
-}
-
pkgname=(
"$pkgbase"
"$pkgbase-headers"
- "$pkgbase-docs"
)
for _p in "${pkgname[@]}"; do
eval "package_$_p() {
diff --git a/config b/config
index ea5ed6564487..dc178bc870e3 100644
--- a/config
+++ b/config
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 5.3.11-arch1 Kernel Configuration
+# Linux/x86 5.3.13-arch1 Kernel Configuration
#
#
diff --git a/d938db454691d69590eb081db22c507c9ebca5f8.patch b/d938db454691d69590eb081db22c507c9ebca5f8.patch
new file mode 100644
index 000000000000..a39f217888c0
--- /dev/null
+++ b/d938db454691d69590eb081db22c507c9ebca5f8.patch
@@ -0,0 +1,131 @@
+From d938db454691d69590eb081db22c507c9ebca5f8 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 16 Sep 2019 04:53:20 +0200
+Subject: ZEN: Add sysctl and CONFIG to disallow unprivileged CLONE_NEWUSER
+
+Our default behavior continues to match the vanilla kernel.
+---
+ init/Kconfig | 16 ++++++++++++++++
+ kernel/fork.c | 15 +++++++++++++++
+ kernel/sysctl.c | 12 ++++++++++++
+ kernel/user_namespace.c | 7 +++++++
+ 4 files changed, 50 insertions(+)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index bd7d650d4a99..658f9c052151 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -1091,6 +1091,22 @@ config USER_NS
+
+ If unsure, say N.
+
++config USER_NS_UNPRIVILEGED
++ bool "Allow unprivileged users to create namespaces"
++ default y
++ depends on USER_NS
++ help
++ When disabled, unprivileged users will not be able to create
++ new namespaces. Allowing users to create their own namespaces
++ has been part of several recent local privilege escalation
++ exploits, so if you need user namespaces but are
++ paranoid^Wsecurity-conscious you want to disable this.
++
++ This setting can be overridden at runtime via the
++ kernel.unprivileged_userns_clone sysctl.
++
++ If unsure, say Y.
++
+ config PID_NS
+ bool "PID Namespaces"
+ default y
+diff --git a/kernel/fork.c b/kernel/fork.c
+index 8bbd39585301..53f663bf0c5f 100644
+--- a/kernel/fork.c
++++ b/kernel/fork.c
+@@ -106,6 +106,11 @@
+
+ #define CREATE_TRACE_POINTS
+ #include <trace/events/task.h>
++#ifdef CONFIG_USER_NS
++extern int unprivileged_userns_clone;
++#else
++#define unprivileged_userns_clone 0
++#endif
+
+ /*
+ * Minimum number of threads to boot the kernel
+@@ -1788,6 +1793,10 @@ static __latent_entropy struct task_struct *copy_process(
+ if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS))
+ return ERR_PTR(-EINVAL);
+
++ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone)
++ if (!capable(CAP_SYS_ADMIN))
++ return ERR_PTR(-EPERM);
++
+ /*
+ * Thread groups must share signals as well, and detached threads
+ * can only be started up within the thread group.
+@@ -2850,6 +2859,12 @@ int ksys_unshare(unsigned long unshare_flags)
+ if (unshare_flags & CLONE_NEWNS)
+ unshare_flags |= CLONE_FS;
+
++ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) {
++ err = -EPERM;
++ if (!capable(CAP_SYS_ADMIN))
++ goto bad_unshare_out;
++ }
++
+ err = check_unshare_flags(unshare_flags);
+ if (err)
+ goto bad_unshare_out;
+diff --git a/kernel/sysctl.c b/kernel/sysctl.c
+index 078950d9605b..baead3605bbe 100644
+--- a/kernel/sysctl.c
++++ b/kernel/sysctl.c
+@@ -110,6 +110,9 @@ extern int core_uses_pid;
+ extern char core_pattern[];
+ extern unsigned int core_pipe_limit;
+ #endif
++#ifdef CONFIG_USER_NS
++extern int unprivileged_userns_clone;
++#endif
+ extern int pid_max;
+ extern int pid_max_min, pid_max_max;
+ extern int percpu_pagelist_fraction;
+@@ -545,6 +548,15 @@ static struct ctl_table kern_table[] = {
+ .proc_handler = proc_dointvec,
+ },
+ #endif
++#ifdef CONFIG_USER_NS
++ {
++ .procname = "unprivileged_userns_clone",
++ .data = &unprivileged_userns_clone,
++ .maxlen = sizeof(int),
++ .mode = 0644,
++ .proc_handler = proc_dointvec,
++ },
++#endif
+ #ifdef CONFIG_PROC_SYSCTL
+ {
+ .procname = "tainted",
+diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
+index 8eadadc478f9..c36ecd19562c 100644
+--- a/kernel/user_namespace.c
++++ b/kernel/user_namespace.c
+@@ -21,6 +21,13 @@
+ #include <linux/bsearch.h>
+ #include <linux/sort.h>
+
++/* sysctl */
++#ifdef CONFIG_USER_NS_UNPRIVILEGED
++int unprivileged_userns_clone = 1;
++#else
++int unprivileged_userns_clone;
++#endif
++
+ static struct kmem_cache *user_ns_cachep __read_mostly;
+ static DEFINE_MUTEX(userns_state_mutex);
+
+--
+cgit v1.2.1-1-g437b
+