From: Greg Kroah-Hartman Date: Wed, 3 Jun 2015 00:57:27 +0000 (+0900) Subject: 3.10-stable patches X-Git-Tag: v3.10.80~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=214848dc109b13d46454115c0be95fb78b780cc5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: fs-omfs-add-null-terminator-in-the-end-up-the-token-list.patch hwmon-ntc_thermistor-ensure-iio-channel-is-of-type-iio_voltage.patch lguest-fix-out-by-one-error-in-address-checking.patch libceph-request-a-new-osdmap-if-lingering-request-maps-to-no-osd.patch --- diff --git a/queue-3.10/fs-omfs-add-null-terminator-in-the-end-up-the-token-list.patch b/queue-3.10/fs-omfs-add-null-terminator-in-the-end-up-the-token-list.patch new file mode 100644 index 00000000000..a6927db602f --- /dev/null +++ b/queue-3.10/fs-omfs-add-null-terminator-in-the-end-up-the-token-list.patch @@ -0,0 +1,45 @@ +From dcbff39da3d815f08750552fdd04f96b51751129 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 28 May 2015 15:44:29 -0700 +Subject: fs, omfs: add NULL terminator in the end up the token list + +From: Sasha Levin + +commit dcbff39da3d815f08750552fdd04f96b51751129 upstream. + +match_token() expects a NULL terminator at the end of the token list so +that it would know where to stop. Not having one causes it to overrun +to invalid memory. + +In practice, passing a mount option that omfs didn't recognize would +sometimes panic the system. + +Signed-off-by: Sasha Levin +Signed-off-by: Bob Copeland +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/omfs/inode.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/omfs/inode.c ++++ b/fs/omfs/inode.c +@@ -361,7 +361,7 @@ nomem: + } + + enum { +- Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask ++ Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask, Opt_err + }; + + static const match_table_t tokens = { +@@ -370,6 +370,7 @@ static const match_table_t tokens = { + {Opt_umask, "umask=%o"}, + {Opt_dmask, "dmask=%o"}, + {Opt_fmask, "fmask=%o"}, ++ {Opt_err, NULL}, + }; + + static int parse_options(char *options, struct omfs_sb_info *sbi) diff --git a/queue-3.10/hwmon-ntc_thermistor-ensure-iio-channel-is-of-type-iio_voltage.patch b/queue-3.10/hwmon-ntc_thermistor-ensure-iio-channel-is-of-type-iio_voltage.patch new file mode 100644 index 00000000000..bb78405f63a --- /dev/null +++ b/queue-3.10/hwmon-ntc_thermistor-ensure-iio-channel-is-of-type-iio_voltage.patch @@ -0,0 +1,48 @@ +From adba657533bdd255f7b78bc8a324091f46b294cd Mon Sep 17 00:00:00 2001 +From: Chris Lesiak +Date: Tue, 26 May 2015 15:40:44 -0500 +Subject: hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE + +From: Chris Lesiak + +commit adba657533bdd255f7b78bc8a324091f46b294cd upstream. + +When configured via device tree, the associated iio device needs to be +measuring voltage for the conversion to resistance to be correct. +Return -EINVAL if that is not the case. + +Signed-off-by: Chris Lesiak +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/ntc_thermistor.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/hwmon/ntc_thermistor.c ++++ b/drivers/hwmon/ntc_thermistor.c +@@ -181,8 +181,10 @@ static struct ntc_thermistor_platform_da + ntc_thermistor_parse_dt(struct platform_device *pdev) + { + struct iio_channel *chan; ++ enum iio_chan_type type; + struct device_node *np = pdev->dev.of_node; + struct ntc_thermistor_platform_data *pdata; ++ int ret; + + if (!np) + return NULL; +@@ -195,6 +197,13 @@ ntc_thermistor_parse_dt(struct platform_ + if (IS_ERR(chan)) + return ERR_CAST(chan); + ++ ret = iio_get_channel_type(chan, &type); ++ if (ret < 0) ++ return ERR_PTR(ret); ++ ++ if (type != IIO_VOLTAGE) ++ return ERR_PTR(-EINVAL); ++ + if (of_property_read_u32(np, "pullup-uv", &pdata->pullup_uv)) + return ERR_PTR(-ENODEV); + if (of_property_read_u32(np, "pullup-ohm", &pdata->pullup_ohm)) diff --git a/queue-3.10/lguest-fix-out-by-one-error-in-address-checking.patch b/queue-3.10/lguest-fix-out-by-one-error-in-address-checking.patch new file mode 100644 index 00000000000..0c53d115b60 --- /dev/null +++ b/queue-3.10/lguest-fix-out-by-one-error-in-address-checking.patch @@ -0,0 +1,33 @@ +From 83a35114d0e4583e6b0ca39502e68b6a92e2910c Mon Sep 17 00:00:00 2001 +From: Rusty Russell +Date: Wed, 27 May 2015 10:59:26 +0930 +Subject: lguest: fix out-by-one error in address checking. + +From: Rusty Russell + +commit 83a35114d0e4583e6b0ca39502e68b6a92e2910c upstream. + +This bug has been there since day 1; addresses in the top guest physical +page weren't considered valid. You could map that page (the check in +check_gpte() is correct), but if a guest tried to put a pagetable there +we'd check that address manually when walking it, and kill the guest. + +Signed-off-by: Rusty Russell +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/lguest/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/lguest/core.c ++++ b/drivers/lguest/core.c +@@ -176,7 +176,7 @@ static void unmap_switcher(void) + bool lguest_address_ok(const struct lguest *lg, + unsigned long addr, unsigned long len) + { +- return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr); ++ return addr+len <= lg->pfn_limit * PAGE_SIZE && (addr+len >= addr); + } + + /* diff --git a/queue-3.10/libceph-request-a-new-osdmap-if-lingering-request-maps-to-no-osd.patch b/queue-3.10/libceph-request-a-new-osdmap-if-lingering-request-maps-to-no-osd.patch new file mode 100644 index 00000000000..13e7a0a7cd3 --- /dev/null +++ b/queue-3.10/libceph-request-a-new-osdmap-if-lingering-request-maps-to-no-osd.patch @@ -0,0 +1,94 @@ +From b0494532214bdfbf241e94fabab5dd46f7b82631 Mon Sep 17 00:00:00 2001 +From: Ilya Dryomov +Date: Mon, 11 May 2015 17:53:10 +0300 +Subject: libceph: request a new osdmap if lingering request maps to no osd + +From: Ilya Dryomov + +commit b0494532214bdfbf241e94fabab5dd46f7b82631 upstream. + +This commit does two things. First, if there are any homeless +lingering requests, we now request a new osdmap even if the osdmap that +is being processed brought no changes, i.e. if a given lingering +request turned homeless in one of the previous epochs and remained +homeless in the current epoch. Not doing so leaves us with a stale +osdmap and as a result we may miss our window for reestablishing the +watch and lose notifies. + +MON=1 OSD=1: + + # cat linger-needmap.sh + #!/bin/bash + rbd create --size 1 test + DEV=$(rbd map test) + ceph osd out 0 + rbd map dne/dne # obtain a new osdmap as a side effect (!) + sleep 1 + ceph osd in 0 + rbd resize --size 2 test + # rbd info test | grep size -> 2M + # blockdev --getsize $DEV -> 1M + +N.B.: Not obtaining a new osdmap in between "osd out" and "osd in" +above is enough to make it miss that resize notify, but that is a +bug^Wlimitation of ceph watch/notify v1. + +Second, homeless lingering requests are now kicked just like those +lingering requests whose mapping has changed. This is mainly to +recognize that a homeless lingering request makes no sense and to +preserve the invariant that a registered lingering request is not +sitting on any of r_req_lru_item lists. This spares us a WARN_ON, +which commit ba9d114ec557 ("libceph: clear r_req_lru_item in +__unregister_linger_request()") tried to fix the _wrong_ way. + +Signed-off-by: Ilya Dryomov +Reviewed-by: Sage Weil +Signed-off-by: Greg Kroah-Hartman + +--- + net/ceph/osd_client.c | 31 ++++++++++++++++++++----------- + 1 file changed, 20 insertions(+), 11 deletions(-) + +--- a/net/ceph/osd_client.c ++++ b/net/ceph/osd_client.c +@@ -1702,20 +1702,29 @@ static void kick_requests(struct ceph_os + err = __map_request(osdc, req, + force_resend || force_resend_writes); + dout("__map_request returned %d\n", err); +- if (err == 0) +- continue; /* no change and no osd was specified */ + if (err < 0) + continue; /* hrm! */ +- if (req->r_osd == NULL) { +- dout("tid %llu maps to no valid osd\n", req->r_tid); +- needmap++; /* request a newer map */ +- continue; +- } ++ if (req->r_osd == NULL || err > 0) { ++ if (req->r_osd == NULL) { ++ dout("lingering %p tid %llu maps to no osd\n", ++ req, req->r_tid); ++ /* ++ * A homeless lingering request makes ++ * no sense, as it's job is to keep ++ * a particular OSD connection open. ++ * Request a newer map and kick the ++ * request, knowing that it won't be ++ * resent until we actually get a map ++ * that can tell us where to send it. ++ */ ++ needmap++; ++ } + +- dout("kicking lingering %p tid %llu osd%d\n", req, req->r_tid, +- req->r_osd ? req->r_osd->o_osd : -1); +- __register_request(osdc, req); +- __unregister_linger_request(osdc, req); ++ dout("kicking lingering %p tid %llu osd%d\n", req, ++ req->r_tid, req->r_osd ? req->r_osd->o_osd : -1); ++ __register_request(osdc, req); ++ __unregister_linger_request(osdc, req); ++ } + } + reset_changed_osds(osdc); + mutex_unlock(&osdc->request_mutex); diff --git a/queue-3.10/series b/queue-3.10/series index dd92501deb3..adff3f3d68c 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -6,3 +6,7 @@ staging-rtl8192e-llvmlinux-remove-unused-inline-prototype.patch kernel-use-the-gnu89-standard-explicitly.patch net-socket-fix-the-wrong-returns-for-recvmsg-and-sendmsg.patch kvm-mmu-fix-cr4.smep-1-cr0.wp-0-with-shadow-pages.patch +fs-omfs-add-null-terminator-in-the-end-up-the-token-list.patch +lguest-fix-out-by-one-error-in-address-checking.patch +libceph-request-a-new-osdmap-if-lingering-request-maps-to-no-osd.patch +hwmon-ntc_thermistor-ensure-iio-channel-is-of-type-iio_voltage.patch