summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-of-hidp_send_message.patch62
-rw-r--r--60-linux.hook1
-rw-r--r--PKGBUILD35
3 files changed, 77 insertions, 21 deletions
diff --git a/0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-of-hidp_send_message.patch b/0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-of-hidp_send_message.patch
new file mode 100644
index 0000000..f2bceca
--- /dev/null
+++ b/0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-of-hidp_send_message.patch
@@ -0,0 +1,62 @@
+From 0bee55974a73eed4a9b9c9e87000df34117e7f69 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 8b3a922bdad3..2cf83856f2e4 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/60-linux.hook b/60-linux.hook
index b33873c..584ce35 100644
--- a/60-linux.hook
+++ b/60-linux.hook
@@ -4,7 +4,6 @@ Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/modules/%KERNVER%/*
-Target = usr/lib/modules/%EXTRAMODULES%/*
[Action]
Description = Updating %PKGBASE% module dependencies...
diff --git a/PKGBUILD b/PKGBUILD
index 033cf8b..730e3cc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,7 +14,7 @@
pkgbase=linux
_majver=5.3
-_minver=5
+_minver=7
if [ "$_minver" == "0" ]; then
pkgver=${_majver}
else
@@ -34,6 +34,7 @@ options=('!strip')
source=(
https://www.kernel.org/pub/linux/kernel/v5.x/linux-$pkgver.tar.{xz,sign}
0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch
+ 0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-of-hidp_send_message.patch
graysky_bdver2-hotfix.patch
kernel_gcc_patch-${_gccpatchver}.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/${_gccpatchver}.tar.gz
ath9k-regdom-hack.patch
@@ -43,15 +44,16 @@ source=(
90-linux.hook # pacman hook for initramfs regeneration
linux.preset # standard config files for mkinitcpio ramdisk
)
-sha256sums=('80ed8c5cfc298fdbccbd69f8b919c12b11d8b54d8c20f08fc8c3b1840d1e53f0'
+sha256sums=('c6c9714e21531c825c306b107bc6f6c7bfa2d5270a14bad170f8de5a73d34802'
'SKIP'
'e862ecd2cb0b20e1859ec3e47616457a9a3acb111cd5a86094f9ed1dbd7f42ac'
+ '9b92add42581aeb427a0c2cffc584815f0e4223a1a6bc27802ccd77eaf6e4bec'
'c5405139aa0a90a6f68f6a13e066a2bd0600c970f9f525cd3aa114b044a7f73b'
'8c11086809864b5cef7d079f930bd40da8d0869c091965fa62e95de9a0fe13b5'
'e7ebf050c22bcec0028c0b3c79fd6d3913b0370ecc6a23dfe78ce475630cf503'
'0f81d6e4158b7beeb0eb514f1b9401f7e23699cb0f7b0d513e25dae1815daaeb'
'583a76bcfdebda1f1edb13d7eb7fea3ad72e86569d6572e15a98398253a7008f'
- 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
+ '452b8d4d71e1565ca91b1bebb280693549222ef51c47ba8964e411b2d461699c'
'75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65')
validpgpkeys=(
@@ -74,6 +76,7 @@ prepare() {
# Hotfixes
msg2 "Applying hotfixes"
patch -p1 -i ../0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch
+ patch -p1 -i ../0002-Bluetooth-hidp-Fix-assumptions-on-the-return-value-of-hidp_send_message.patch
# graysky gcc hotfixes
@@ -117,7 +120,7 @@ prepare() {
sed -i '/SUBLEVEL = 0/d' Makefile
fi
- make -s kernelrelease > ../version
+ make -s kernelrelease > version
# workaround for make -s kernelrelease not applying
# localversion to version when changed using menuconfig
@@ -126,13 +129,13 @@ prepare() {
cat "localversion.10-pkgrel" >> ../version.temp
cat "localversion.20-pkgname" >> ../version.temp
cat ../localversion >> ../version.temp
- cat ../version.temp | tr -d "\n" > ../version
+ cat ../version.temp | tr -d "\n" > version
# back up the config
# msg2 "Backing up config..."
# cp .config ${SRCDEST}/config.previous
- msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)"
+ msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
}
build() {
@@ -148,11 +151,11 @@ _package() {
backup=("etc/mkinitcpio.d/$pkgbase.preset")
install=linux.install
+ cd $_srcname
+
local kernver="$(<version)"
local modulesdir="$pkgdir/usr/lib/modules/$kernver"
- cd $_srcname
-
msg2 "Installing boot image..."
install -Dm644 "$(make -s image_name)" "$pkgdir/boot/vmlinuz-$pkgbase"
@@ -163,13 +166,6 @@ _package() {
mkdir -p "$modulesdir"
make INSTALL_MOD_PATH="$pkgdir/usr" modules_install
- # a place for external modules,
- # with version file for building modules and running depmod from hook
- local extramodules="extramodules$_kernelname"
- local extradir="$pkgdir/usr/lib/modules/$extramodules"
- install -Dt "$extradir" -m644 ../version
- ln -sr "$extradir" "$modulesdir/extramodules"
-
# remove build and source links
rm "$modulesdir"/{source,build}
@@ -178,7 +174,6 @@ _package() {
local subst="
s|%PKGBASE%|$pkgbase|g
s|%KERNVER%|$kernver|g
- s|%EXTRAMODULES%|$extramodules|g
"
# hack to allow specifying an initially nonexisting install file
@@ -200,12 +195,12 @@ _package() {
_package-headers() {
pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
- local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
-
cd $_srcname
+ local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
+
msg2 "Installing build files..."
- install -Dt "$builddir" -m644 Makefile .config Module.symvers System.map vmlinux
+ install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map localversion.* version vmlinux
install -Dt "$builddir/kernel" -m644 kernel/Makefile
install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
cp -t "$builddir" -a scripts
@@ -271,7 +266,7 @@ _package-headers() {
msg2 "Adding symlink..."
mkdir -p "$pkgdir/usr/src"
- ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase-$pkgver"
+ ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
msg2 "Fixing permissions..."
chmod -Rc u=rwX,go=rX "$pkgdir"