Activity log for bug #1547060

Date Who What changed Old value New value Message
2016-02-18 15:20:26 stsp bug added bug
2016-04-21 12:34:21 Launchpad Janitor tgt (Ubuntu): status New Confirmed
2016-04-21 14:11:17 Jon Grimm tgt (Ubuntu): importance Undecided High
2016-04-21 14:11:49 Jon Grimm tgt (Ubuntu): assignee ChristianEhrhardt (paelzer)
2016-04-21 15:04:32 Christian Ehrhardt  tgt (Ubuntu): assignee ChristianEhrhardt (paelzer) Ryan Harper (raharper)
2016-04-21 15:51:08 Ryan Harper attachment added fix-errno-parsing.debdiff https://bugs.launchpad.net/ubuntu/+source/tgt/+bug/1547060/+attachment/4641602/+files/fix-errno-parsing.debdiff
2016-04-21 16:14:46 Ryan Harper bug watch added http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822160
2016-04-21 16:14:46 Ryan Harper bug task added tgt (Debian)
2016-04-21 16:24:21 Ubuntu Foundations Team Bug Bot tags patch
2016-04-21 16:24:34 Ubuntu Foundations Team Bug Bot bug added subscriber Ubuntu Sponsors Team
2016-04-21 18:10:59 Ryan Harper description tgt-1:1.0.62-1ubuntu2 # ./tgtd -d 1 -d argument value '1' invalid Try `tgtd --help' for more information. The following change should fix the problem: --- util.h.old 2015-12-02 03:27:15.000000000 +0300 +++ util.h 2016-02-18 18:04:08.749932076 +0300 @@ -148,7 +148,7 @@ unsigned long long ull_val; \ ull_val = strtoull(str, &ptr, 0); \ val = (typeof(val)) ull_val; \ - if (errno || ptr == str) \ + if (ull_val == ULONG_MAX || ptr == str) \ ret = EINVAL; \ else if (val != ull_val) \ ret = ERANGE; \ Here, the errno is checked incorrectly: you can't check errno unless the returned value allows you to. In case of strtoull(), errno should be checked only if ULONG_MAX is returned. I however can't test the fix properly because when compiled from source, the bug doesn't happen. The value of errno is unspecified, and it just happens to be 0 when I compile from sources. [Impact] * Users of tgt who wish to make use of the server command line options: -d,--debug , -t,--nr_iothreads, -C,--control-port will fail due to an option parsing error. This prevents users from exercising additional control of the tgtd, regressing the capabilities of tgtd. This affects the 1.0.63 release of tgt and is not yet fixed upstream. Patches have been sumitted. * Backporting fixes from upstream release is required to ensure users of tgtd can exercise all capabilities, including enabling debugging and other features previously available to tgt users. * The patch fixes a misuderstanding of the use of errno after calling the strtoull libc call. Errno is not set in all cases for strtoull so extra checks must be used to determine if the current value of errno is related to the strtoull call. [Test Case] * On a Xenial 16.04 system 1. lxd init 2. lxc launch ubuntu-daily:xenial x1 3. lxc exec x1 -- /bin/bash -c 'apt-get update && apt-get -y install tgt && tgtd -d1; echo $?' # On FAILURE: return code will be non-zero with the following output -d argument value '1' invalid Try `tgtd --help' for more information. 22 # After installing the newer tgt package, return code will be 0 [Regression Potential] * Unlikely any new regressions will take place as the current package prevents users from using portions of tgtd due to not being able to pass numeric values to tgtd options. [Other Info] * Debian Bug filed: - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822160 * Upstream request to accept patch - http://article.gmane.org/gmane.linux.stgt/535 [Original Description] tgt-1:1.0.62-1ubuntu2 # ./tgtd -d 1 -d argument value '1' invalid Try `tgtd --help' for more information. The following change should fix the problem: --- util.h.old 2015-12-02 03:27:15.000000000 +0300 +++ util.h 2016-02-18 18:04:08.749932076 +0300 @@ -148,7 +148,7 @@         unsigned long long ull_val; \         ull_val = strtoull(str, &ptr, 0); \         val = (typeof(val)) ull_val; \ - if (errno || ptr == str) \ + if (ull_val == ULONG_MAX || ptr == str) \                 ret = EINVAL; \         else if (val != ull_val) \                 ret = ERANGE; \ Here, the errno is checked incorrectly: you can't check errno unless the returned value allows you to. In case of strtoull(), errno should be checked only if ULONG_MAX is returned. I however can't test the fix properly because when compiled from source, the bug doesn't happen. The value of errno is unspecified, and it just happens to be 0 when I compile from sources.
2016-04-22 12:06:24 Bug Watch Updater tgt (Debian): status Unknown New
2016-04-24 06:28:16 Mathew Hodson tags patch patch xenial
2016-04-24 06:29:15 Mathew Hodson nominated for series Ubuntu Xenial
2016-04-24 06:29:22 Mathew Hodson tgt (Ubuntu): status Confirmed Triaged
2016-04-24 06:30:21 Mathew Hodson tags patch xenial patch regression-release xenial
2016-04-25 07:20:26 Daniel Holbach bug task added tgt (Ubuntu Xenial)
2016-04-25 07:21:49 Daniel Holbach tgt (Ubuntu Xenial): status New Fix Committed
2016-04-25 07:21:52 Daniel Holbach tgt (Ubuntu): status Triaged Fix Committed
2016-04-25 16:23:38 Mathew Hodson tgt (Ubuntu Xenial): importance Undecided High
2016-04-26 09:00:40 Martin Pitt bug added subscriber Ubuntu Stable Release Updates Team
2016-04-26 09:00:42 Martin Pitt bug added subscriber SRU Verification
2016-04-26 09:00:44 Martin Pitt tags patch regression-release xenial patch regression-release verification-needed xenial
2016-04-26 09:00:52 Martin Pitt removed subscriber Ubuntu Sponsors Team
2016-04-26 23:06:30 Launchpad Janitor tgt (Ubuntu): status Fix Committed Fix Released
2016-05-16 03:15:41 Roy Zuo tgt (Ubuntu): status Fix Released Confirmed
2016-05-16 03:15:53 Roy Zuo tgt (Ubuntu): status Confirmed Fix Released
2016-05-20 20:57:27 Jason Hobbs tags patch regression-release verification-needed xenial patch regression-release verification-done xenial
2016-05-23 06:58:31 Launchpad Janitor tgt (Ubuntu Xenial): status Fix Committed Fix Released
2016-05-23 06:58:36 Martin Pitt removed subscriber Ubuntu Stable Release Updates Team
2016-05-25 10:33:36 Bug Watch Updater tgt (Debian): status New Fix Released