From 9cc8b726581aaadf11ed77db6c90a8be42f54bd0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 21 Jan 2020 20:02:25 +0100 Subject: [PATCH] 4.9-stable patches added patches: cfg80211-check-for-set_wiphy_params.patch cw1200-fix-a-signedness-bug-in-cw1200_load_firmware.patch xen-blkfront-adjust-indentation-in-xlvbd_alloc_gendisk.patch --- .../cfg80211-check-for-set_wiphy_params.patch | 37 +++++++++++++ ...gnedness-bug-in-cw1200_load_firmware.patch | 39 ++++++++++++++ queue-4.9/series | 3 ++ ...t-indentation-in-xlvbd_alloc_gendisk.patch | 54 +++++++++++++++++++ 4 files changed, 133 insertions(+) create mode 100644 queue-4.9/cfg80211-check-for-set_wiphy_params.patch create mode 100644 queue-4.9/cw1200-fix-a-signedness-bug-in-cw1200_load_firmware.patch create mode 100644 queue-4.9/xen-blkfront-adjust-indentation-in-xlvbd_alloc_gendisk.patch diff --git a/queue-4.9/cfg80211-check-for-set_wiphy_params.patch b/queue-4.9/cfg80211-check-for-set_wiphy_params.patch new file mode 100644 index 00000000000..343a812b0f6 --- /dev/null +++ b/queue-4.9/cfg80211-check-for-set_wiphy_params.patch @@ -0,0 +1,37 @@ +From 24953de0a5e31dcca7e82c8a3c79abc2dfe8fb6e Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Mon, 13 Jan 2020 12:53:59 +0100 +Subject: cfg80211: check for set_wiphy_params + +From: Johannes Berg + +commit 24953de0a5e31dcca7e82c8a3c79abc2dfe8fb6e upstream. + +Check if set_wiphy_params is assigned and return an error if not, +some drivers (e.g. virt_wifi where syzbot reported it) don't have +it. + +Reported-by: syzbot+e8a797964a4180eb57d5@syzkaller.appspotmail.com +Reported-by: syzbot+34b582cf32c1db008f8e@syzkaller.appspotmail.com +Signed-off-by: Johannes Berg +Link: https://lore.kernel.org/r/20200113125358.ac07f276efff.Ibd85ee1b12e47b9efb00a2adc5cd3fac50da791a@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/wireless/rdev-ops.h | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/net/wireless/rdev-ops.h ++++ b/net/wireless/rdev-ops.h +@@ -525,6 +525,10 @@ static inline int + rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) + { + int ret; ++ ++ if (!rdev->ops->set_wiphy_params) ++ return -EOPNOTSUPP; ++ + trace_rdev_set_wiphy_params(&rdev->wiphy, changed); + ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); + trace_rdev_return_int(&rdev->wiphy, ret); diff --git a/queue-4.9/cw1200-fix-a-signedness-bug-in-cw1200_load_firmware.patch b/queue-4.9/cw1200-fix-a-signedness-bug-in-cw1200_load_firmware.patch new file mode 100644 index 00000000000..32f6ce49d93 --- /dev/null +++ b/queue-4.9/cw1200-fix-a-signedness-bug-in-cw1200_load_firmware.patch @@ -0,0 +1,39 @@ +From 4a50d454502f1401171ff061a5424583f91266db Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Tue, 1 Oct 2019 14:45:01 +0300 +Subject: cw1200: Fix a signedness bug in cw1200_load_firmware() + +From: Dan Carpenter + +commit 4a50d454502f1401171ff061a5424583f91266db upstream. + +The "priv->hw_type" is an enum and in this context GCC will treat it +as an unsigned int so the error handling will never trigger. + +Fixes: a910e4a94f69 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets") +Signed-off-by: Dan Carpenter +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/st/cw1200/fwio.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/st/cw1200/fwio.c ++++ b/drivers/net/wireless/st/cw1200/fwio.c +@@ -323,12 +323,12 @@ int cw1200_load_firmware(struct cw1200_c + goto out; + } + +- priv->hw_type = cw1200_get_hw_type(val32, &major_revision); +- if (priv->hw_type < 0) { ++ ret = cw1200_get_hw_type(val32, &major_revision); ++ if (ret < 0) { + pr_err("Can't deduce hardware type.\n"); +- ret = -ENOTSUPP; + goto out; + } ++ priv->hw_type = ret; + + /* Set DPLL Reg value, and read back to confirm writes work */ + ret = cw1200_reg_write_32(priv, ST90TDS_TSET_GEN_R_W_REG_ID, diff --git a/queue-4.9/series b/queue-4.9/series index 559d75357dc..d28a818b30f 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -84,3 +84,6 @@ net-wan-fsl_ucc_hdlc-fix-out-of-bounds-write-on-array-utdm_info.patch r8152-add-missing-endpoint-sanity-check.patch tcp-fix-marked-lost-packets-not-being-retransmitted.patch net-usb-lan78xx-limit-size-of-local-tso-packets.patch +xen-blkfront-adjust-indentation-in-xlvbd_alloc_gendisk.patch +cw1200-fix-a-signedness-bug-in-cw1200_load_firmware.patch +cfg80211-check-for-set_wiphy_params.patch diff --git a/queue-4.9/xen-blkfront-adjust-indentation-in-xlvbd_alloc_gendisk.patch b/queue-4.9/xen-blkfront-adjust-indentation-in-xlvbd_alloc_gendisk.patch new file mode 100644 index 00000000000..45774076ac6 --- /dev/null +++ b/queue-4.9/xen-blkfront-adjust-indentation-in-xlvbd_alloc_gendisk.patch @@ -0,0 +1,54 @@ +From 589b72894f53124a39d1bb3c0cecaf9dcabac417 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Mon, 9 Dec 2019 13:14:44 -0700 +Subject: xen/blkfront: Adjust indentation in xlvbd_alloc_gendisk +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nathan Chancellor + +commit 589b72894f53124a39d1bb3c0cecaf9dcabac417 upstream. + +Clang warns: + +../drivers/block/xen-blkfront.c:1117:4: warning: misleading indentation; +statement is not part of the previous 'if' [-Wmisleading-indentation] + nr_parts = PARTS_PER_DISK; + ^ +../drivers/block/xen-blkfront.c:1115:3: note: previous statement is here + if (err) + ^ + +This is because there is a space at the beginning of this line; remove +it so that the indentation is consistent according to the Linux kernel +coding style and clang no longer warns. + +While we are here, the previous line has some trailing whitespace; clean +that up as well. + +Fixes: c80a420995e7 ("xen-blkfront: handle Xen major numbers other than XENVBD") +Link: https://github.com/ClangBuiltLinux/linux/issues/791 +Signed-off-by: Nathan Chancellor +Reviewed-by: Juergen Gross +Acked-by: Roger Pau Monné +Signed-off-by: Juergen Gross +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/xen-blkfront.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/block/xen-blkfront.c ++++ b/drivers/block/xen-blkfront.c +@@ -1104,8 +1104,8 @@ static int xlvbd_alloc_gendisk(blkif_sec + if (!VDEV_IS_EXTENDED(info->vdevice)) { + err = xen_translate_vdev(info->vdevice, &minor, &offset); + if (err) +- return err; +- nr_parts = PARTS_PER_DISK; ++ return err; ++ nr_parts = PARTS_PER_DISK; + } else { + minor = BLKIF_MINOR_EXT(info->vdevice); + nr_parts = PARTS_PER_EXT_DISK; -- 2.47.3