Skip to contentSkip to conversation

iproute2: lib/utils.c bug fixes

PATCH Superseded Mr Dash Four 6 participants 18 messages Apr 12, 2013

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iproute2: lib/utils.c bug fixes

This patch fixes the following 3 bugs in get_u32/get_u64 functions:

1. On 32-bit systems, get_u32 could not detect an overflow. get_u32(&l, "4294967296", 10) always returned 4294967295 (ULONG_MAX on 32-bit systems).

2. get_u64(&ll, "4294967295", 10) was returning an error where it shouldn't have (4294967295 is perfectly legitimate value for unsigned long long).

3. get_u64 couldn't detect an overflow errors (arg > ULLONG_MAX)

---
 lib/utils.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
lib/utils.c +6 -2
index 5bcdbcf..aeee8f1 100644
@@ -149,10 +149,12 @@ int get_u64(__u64 *val, const char *arg, int base)
 	unsigned long long res;
 	char *ptr;
 
+	errno = 0;
+
 	if (!arg || !*arg)
 		return -1;
 	res = strtoull(arg, &ptr, base);
-	if (!ptr || ptr == arg || *ptr || res == 0xFFFFFFFFULL)
+	if (!ptr || ptr == arg || *ptr || (res == ULLONG_MAX && errno == ERANGE))
  		return -1;
  	*val = res;
  	return 0;
@@ -163,10 +165,12 @@ int get_u32(__u32 *val, const char *arg, int base)
 	unsigned long res;
 	char *ptr;
 
+	errno = 0;
+
 	if (!arg || !*arg)
 		return -1;
 	res = strtoul(arg, &ptr, base);
-	if (!ptr || ptr == arg || *ptr || res > 0xFFFFFFFFUL)
+	if (!ptr || ptr == arg || *ptr || res > 0xFFFFFFFFUL || errno == ERANGE)
 		return -1;
 	*val = res;
 	return 0;
#1 lore raw
Quoted 6 lines · On Fri, 12 Apr 2013 03:30:45 +0100 Mr Dash Four <[email protected]>…

This patch fixes the following 3 bugs in get_u32/get_u64 functions:

1. On 32-bit systems, get_u32 could not detect an overflow. get_u32(&l, "4294967296", 10) always returned 4294967295 (ULONG_MAX on 32-bit systems).

Quoted 7 lines

2. get_u64(&ll, "4294967295", 10) was returning an error where it shouldn't have (4294967295 is perfectly legitimate value for unsigned long long).

3. get_u64 couldn't detect an overflow errors (arg > ULLONG_MAX)

I don't demand Developer Certificate of Origin on iproute2 patches. But if you are going to include it then you must use your real name, no pseudonyms. See kernel/Documentation/SubmittingPatches.

#2 lore raw
Quoted 14 lines · Stephen Hemminger
Quoted 10 lines · On Fri, 12 Apr 2013 03:30:45 +0100 Mr Dash Four <[email protected]>…

This patch fixes the following 3 bugs in get_u32/get_u64 functions:

1. On 32-bit systems, get_u32 could not detect an overflow. get_u32(&l, "4294967296", 10) always returned 4294967295 (ULONG_MAX on 32-bit systems).

2. get_u64(&ll, "4294967295", 10) was returning an error where it shouldn't have (4294967295 is perfectly legitimate value for unsigned long long).

Quoted 9 lines
Quoted 4 lines

3. get_u64 couldn't detect an overflow errors (arg > ULLONG_MAX)

I don't demand Developer Certificate of Origin on iproute2 patches. But if you are going to include it then you must use your real name, no pseudonyms. See kernel/Documentation/SubmittingPatches.

1. You may or may not be aware that this isn't my first-and-only contribution to the Linux/Netfilter/Security/Audit/kernel/any_other_Linux_development_project_you_care_to_mention tree in which I used my name above.
2. How do you know that Dash Four isn't my name and is a "pseudonym" (do you consider the name "Dotcom" not to be a real name too, simply because in your, quite narrow-minded, understanding of the world this name "looks a bit strange, therefore it must be a pseudonym")?
3. The above text you were kind enough to point me to, is with regards to kernel submissions. My patch does not alter the kernel tree in any way whatsoever (but even if it has, see 1. above).

#3 lore raw
Quoted 4 lines · Mr Dash Four

2. How do you know that Dash Four isn't my name and is a "pseudonym" (do you consider the name "Dotcom" not to be a real name too, simply because in your, quite narrow-minded, understanding of the world this name "looks a bit strange, therefore it must be a pseudonym")?

WOW, I can not believe this rant against Stephen.

Is question was polite, your answer is definitely not.

Is "Mr" part of your name ?

My name is "Eric Dumazet", not "Mr Eric Dumazet" or "Mr Sublime President Eric Dumazet"

#4 lore raw
Quoted 8 lines · Eric Dumazet
Quoted 2 lines · Mr Dash Four

2. How do you know that Dash Four isn't my name and is a "pseudonym" (do you consider the name "Dotcom" not to be a real name too, simply because in your, quite narrow-minded, understanding of the world this name "looks a bit strange, therefore it must be a pseudonym")?

WOW, I can not believe this rant against Stephen.

It wasn't a rant at all, quite on the contrary (if it is perceived as such, my apologies, that was not the intention).

Quoted 2 lines

Is question was polite, your answer is definitely not.

The blanked assumption that I use a pseudonym, simply because "Dash Four looks a bit strange" wasn't very polite either.

Quoted 2 lines

Is "Mr" part of your name ?

It is as far as I am concerned (Mr = Mister, which is indicative of my gender).

Quoted 1 line

My name is "Eric Dumazet", not "Mr Eric Dumazet"

Right, so if I am unfamiliar with the common pool of French names (which, I presume, is where yours comes from), can I call you Miss Eric Dumazet then? The title (Mr) is included for those confused souls out there (*Mr* Hemminger included) who are not sure as to what my gender is, that's all.

Quoted 2 lines

or "Mr Sublime President Eric Dumazet"

And you don't find the above response patronising to say the least?

#5 lore raw
Quoted 5 lines · Mr Dash Four
Quoted 2 lines

Is "Mr" part of your name ?

It is as far as I am concerned (Mr = Mister, which is indicative of my gender).

We don't care of genders or titles.

We do believe men and women can equally code and submit patches the same. And of course some human beings are neither man or woman.

#6 lore raw
Quoted 6 lines · Eric Dumazet
Quoted 3 lines · Mr Dash Four
Quoted 3 lines

Is "Mr" part of your name ?

Quoted 9 lines
Quoted 3 lines

It is as far as I am concerned (Mr = Mister, which is indicative of my gender).

We don't care of genders or titles.

We do believe men and women can equally code and submit patches the same. And of course some human beings are neither man or woman.

Absolutely, and I haven't disputed that, nor did I state that "only men" or "only women" can submit patches to this list.

I am including my title as part of the name (like some others do - like "Dr", "Prof" etc) for the reasons I indicated in my previous reply. Besides, I used the word "indicative" in my response above, so I am not saying with 100% certainty what my gender or sexual belief/orientation is - one way or another.

Now that we cleared this little nugget, can we move along please as the netdev forum isn't the appropriate place to discuss genders, name titles or sexual orientation - something I had no intention of doing (apologies to all who had to put up with this little diversion), but I felt I was dragged into this by your good self and Mr Hemminger. Thank you.

#7 lore raw
Quoted 5 lines · Mr Dash Four

Now that we cleared this little nugget, can we move along please as the netdev forum isn't the appropriate place to discuss genders, name titles or sexual orientation - something I had no intention of doing (apologies to all who had to put up with this little diversion), but I felt I was dragged into this by your good self and Mr Hemminger. Thank you.

Next time you submit a patch, think about how you can avoid this useless discussions by choosing an appropriate signature. (And no, I don't suggest you change your name !)

And this is not a diversion, since I remember you had the same problems in the past. You perfectly know your signature is not very good, and you play with this. I can tell you its not funny.

#8 lore raw
Quoted 10 lines · Eric Dumazet
Quoted 2 lines · Mr Dash Four

Now that we cleared this little nugget, can we move along please as the netdev forum isn't the appropriate place to discuss genders, name titles or sexual orientation - something I had no intention of doing (apologies to all who had to put up with this little diversion), but I felt I was dragged into this by your good self and Mr Hemminger. Thank you.

Next time you submit a patch, think about how you can avoid this useless discussions by choosing an appropriate signature. (And no, I don't suggest you change your name !)

Care to enlighten me what your definition of "appropriate signature" is exactly? I am expecting that your answer would include the appropriate guidelines used on this mailing list and *not* your personal opinion as, in this particular case, this is, or should be, irrelevant.

Quoted 2 lines

And this is not a diversion, since I remember you had the same problems in the past.

Similar to above - care to point out (in terms of links to previous ML archives posts and so on) what "problems" did I, allegedly, have had in the past with patch submissions? Because, to my recollection, I did *not* have any such problems. If you can't point me to any such references, then I'd assume that you are simply on a smear trip with an agenda.

Quoted 3 lines

You perfectly know your signature is not very good, and you
play with this. I can tell you its not funny.

I don't "play" with my signature - I have been using it since I started contributing to open source projects and that signature never changed.

I would also like to know what do you find that it is "not very good" in my signature and what particular patch submission guidelines am I breaking with using it? Again, I am expecting that you will refer to the relevant guidelines for patch submissions approved on this list when forming your response and will extricate any personal bias or opinion.

Just to repeat again, so that it is clear - as far as my "signature" goes, I am not aware of any issues I have allegedly had in the past with patch submissions, so if you care to point out what these were, please do so. If not, kindly move on. Thank you.

#9 lore raw
In reply to Eric Dumazet
Quoted 4 lines · Eric Dumazet
Quoted 2 lines · Mr Dash Four
Quoted 2 lines

Is "Mr" part of your name ?

Quoted 8 lines
Quoted 3 lines

It is as far as I am concerned (Mr = Mister, which is indicative of my gender).

We don't care of genders or titles.

We do believe men and women can equally code and submit patches the same. And of course some human beings are neither man or woman.

Actually, I don't think you even have to be human to submit patches. It is often an advantage, though.

Bjørn

#10 lore raw
In reply to Mr Dash Four
Quoted 26 lines · On Fri, 12 Apr 2013 14:49:17 +0100 Mr Dash Four <[email protected]>…
Quoted 14 lines · Stephen Hemminger
Quoted 10 lines · On Fri, 12 Apr 2013 03:30:45 +0100 Mr Dash Four <[email protected]>…

This patch fixes the following 3 bugs in get_u32/get_u64 functions:

1. On 32-bit systems, get_u32 could not detect an overflow. get_u32(&l, "4294967296", 10) always returned 4294967295 (ULONG_MAX on 32-bit systems).

2. get_u64(&ll, "4294967295", 10) was returning an error where it shouldn't have (4294967295 is perfectly legitimate value for unsigned long long).

Quoted 9 lines
Quoted 4 lines

3. get_u64 couldn't detect an overflow errors (arg > ULLONG_MAX)

I don't demand Developer Certificate of Origin on iproute2 patches. But if you are going to include it then you must use your real name, no pseudonyms. See kernel/Documentation/SubmittingPatches.

Quoted 11 lines

1. You may or may not be aware that this isn't my first-and-only
contribution to the Linux/Netfilter/Security/Audit/kernel/any_other_Linux_development_project_you_care_to_mention tree in which I used my name above.
2. How do you know that Dash Four isn't my name and is a "pseudonym" (do
you consider the name "Dotcom" not to be a real name too, simply because
in your, quite narrow-minded, understanding of the world this name
"looks a bit strange, therefore it must be a pseudonym")?
3. The above text you were kind enough to point me to, is with regards
to kernel submissions. My patch does not alter the kernel tree in any
way whatsoever (but even if it has, see 1. above).

The issue is that "Signed-off-by" has a legal meaning as defined in the kernel SubmittingPatches

<quote>

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.

then you just add a line saying

using your real name (sorry, no pseudonyms or anonymous contributions.) </quote>

It was introduced during the SCO pre-trial paranoia phase to deal with the possibility of somebody putting something into kernel, then claiming it as proprietary.

By putting on Signed-off-by: you are making a legal statement. Either resubmit without the Signed-off-by, or give a real name.

#11 lore raw
Quoted 74 lines · Stephen Hemminger
Quoted 22 lines · On Fri, 12 Apr 2013 14:49:17 +0100 Mr Dash Four <[email protected]>…
Quoted 20 lines · Stephen Hemminger
Quoted 15 lines · On Fri, 12 Apr 2013 03:30:45 +0100 Mr Dash Four <[email protected]>…

This patch fixes the following 3 bugs in get_u32/get_u64 functions:

1. On 32-bit systems, get_u32 could not detect an overflow. get_u32(&l, "4294967296", 10) always returned 4294967295 (ULONG_MAX on 32-bit systems).

2. get_u64(&ll, "4294967295", 10) was returning an error where it shouldn't have (4294967295 is perfectly legitimate value for unsigned long long).

3. get_u64 couldn't detect an overflow errors (arg > ULLONG_MAX)

Quoted 9 lines
Quoted 5 lines

I don't demand Developer Certificate of Origin on iproute2 patches. But if you are going to include it then you must use your real name, no pseudonyms. See kernel/Documentation/SubmittingPatches.

1. You may or may not be aware that this isn't my first-and-only contribution to the Linux/Netfilter/Security/Audit/kernel/any_other_Linux_development_project_you_care_to_mention tree in which I used my name above.
2. How do you know that Dash Four isn't my name and is a "pseudonym" (do you consider the name "Dotcom" not to be a real name too, simply because in your, quite narrow-minded, understanding of the world this name "looks a bit strange, therefore it must be a pseudonym")?
3. The above text you were kind enough to point me to, is with regards to kernel submissions. My patch does not alter the kernel tree in any way whatsoever (but even if it has, see 1. above).

The issue is that "Signed-off-by" has a legal meaning as defined in the kernel SubmittingPatches

<quote>

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.

then you just add a line saying

using your real name (sorry, no pseudonyms or anonymous contributions.) </quote>

Quoted 7 lines

It was introduced during the SCO pre-trial paranoia phase to deal with the possibility of somebody putting something into kernel, then claiming it as proprietary.

By putting on Signed-off-by: you are making a legal statement. Either resubmit without the Signed-off-by, or give a real name.

I am well-aware of what you just posted, as indicated in my initial response you were kind enough to quote above. I would appreciate it if you could address the points (1-3) I've made in response to that if you disagree, or comment on the content of the actual submission if you don't, so we can all move on. Thank you.

maintainer
#12 lore raw
In reply to Mr Dash Four

The self-rightousness with which people operating under pseudonyms or names that do not meet the requirements of the developers certificate of origin react when they are confronted directly about this issue I find truly appalling.

It's pretty pointless to wet yourself in public over this issue rather than just comply with our requirements if you want to submit changes that actually get applied.

But if you don't want to play along, that's fine, because if the issue is important enough there's a thousand or so other developers right behind you willing to fix or implement it too.

We have enough developer resources that people behaving in an anti-social manner about issues like this simply don't matter.

I know what you're doing, you're just trying to make a point, but at the expense of everyone else's time. That makes you a troll at best, and an asshole at worst.

Thanks.

#13 lore raw
Quoted 5 lines · David Miller

The self-rightousness with which people operating under pseudonyms or names that do not meet the requirements of the developers certificate of origin react when they are confronted directly about this issue I find truly appalling.

I assume this was aimed at me, in which case I'll ask again - on what basis you or Stephen have determined that I do not comply with these terms (this is a genuine question, not a wind up - just in case you or anybody else start making assumptions!)?

Quoted 4 lines

It's pretty pointless to wet yourself in public over this issue rather than just comply with our requirements if you want to submit changes that actually get applied.

I am not "wetting myself" over anything. Again though, where (or in what part of my submission) do you think that I have not complied with these requirements?

Quoted 11 lines

But if you don't want to play along, that's fine, because if the issue is important enough there's a thousand or so other developers right behind you willing to fix or implement it too.

We have enough developer resources that people behaving in an anti-social manner about issues like this simply don't matter.

I know what you're doing, you're just trying to make a point, but at the expense of everyone else's time. That makes you a troll at best, and an asshole at worst.

I find the above comments uncalled for at best, particularly coming from someone in your position. "troll", "asshole"?

maintainer
#14 lore raw

From: Mr Dash Four <[email protected]>
Date: Fri, 12 Apr 2013 18:58:40 +0100

Quoted 3 lines

I am not "wetting myself" over anything. Again though, where (or in what part of my submission) do you think that I have not complied with these requirements?

I'm not falling into this troll trap, sorry. I am under no obligation whatsoever to answer the questions you specifically choose in order to steer the conversation in the direction that you want it to go.

You are wasting everyone's time with this, your patch could have been re-implemented several times over with the resources that have been devoured into this thread.

#15 lore raw
In reply to Mr Dash Four
Quoted 10 lines · Mr Dash Four
Quoted 5 lines · David Miller

The self-rightousness with which people operating under pseudonyms or names that do not meet the requirements of the developers certificate of origin react when they are confronted directly about this issue I find truly appalling.

I assume this was aimed at me, in which case I'll ask again - on what basis you or Stephen have determined that I do not comply with these terms (this is a genuine question, not a wind up - just in case you or anybody else start making assumptions!)?

Please don't play a cat and mouse game with the folks around here. Is your submission signed off with your *real* name? This is a simple requirement for patch submissions. Why do you let the people reviewing and perhaps committing your patch guess? Just clarify it in one sentence. If it is not your real name it does violate the policy. It is that simple.

Thanks,

Hannes

#16 lore raw
Quoted 10 lines · Hannes Frederic Sowa
Quoted 8 lines · Mr Dash Four
Quoted 6 lines · David Miller

The self-rightousness with which people operating under pseudonyms or names that do not meet the requirements of the developers certificate of origin react when they are confronted directly about this issue I find truly appalling.

Quoted 5 lines
Quoted 2 lines

I assume this was aimed at me, in which case I'll ask again - on what basis you or Stephen have determined that I do not comply with these terms (this is a genuine question, not a wind up - just in case you or anybody else start making assumptions!)?

Please don't play a cat and mouse game with the folks around here. Is your submission signed off with your *real* name?

*Yes* - I thought that was pretty obvious.

Stephen determined that for whatever reason the name appearing in the Signed-By tag "is a bit strange", so it must either be made up or a pseudonym and I took issue with this.

Quoted 1 line

This is a simple requirement for patch submissions.

Which is fair enough, I suppose.

Quoted 2 lines

Why do you let the people reviewing and perhaps committing your patch guess? Just clarify it in one sentence.

I am not sure I understand that question, but my patch submission is simply to correct 3 bugs in the current iproute2 tree - there is no other (ulterior) motive behind it. I am letting people reviewing (or committing) that patch as they are the (current/rightful) maintainers of this project (iproute2). This (the reason for issuing the patch and the subsequent request to review it) was made, I think pretty clear, in the patch submission heading.

Quoted 2 lines

If it is not your real name it does violate the policy. It is that simple.

I was perfectly aware of that before making that submission - as I already pointed out in one of my previous posts, this isn't my first submission (in the kernel tree as well as in other open-source projects) and I hope it won't be the last.

#17 lore raw
Quoted 14 lines · Mr Dash Four
Quoted 2 lines · Hannes Frederic Sowa

Please don't play a cat and mouse game with the folks around here. Is your submission signed off with your *real* name?

*Yes* - I thought that was pretty obvious.

Stephen determined that for whatever reason the name appearing in the Signed-By tag "is a bit strange", so it must either be made up or a pseudonym and I took issue with this.

Quoted 1 line

This is a simple requirement for patch submissions.

Which is fair enough, I suppose.

Quoted 2 lines

Why do you let the people reviewing and perhaps committing your patch guess? Just clarify it in one sentence.

Quoted 7 lines

I am not sure I understand that question, but my patch submission is simply to correct 3 bugs in the current iproute2 tree - there is no other (ulterior) motive behind it. I am letting people reviewing (or committing) that patch as they are the (current/rightful) maintainers of this project (iproute2). This (the reason for issuing the patch and the subsequent request to review it) was made, I think pretty clear, in the patch submission heading.

These were rhetoric questions. After your (in my opionion harsh) answer to Stephen I had doubts, too. Especially your first argument to Stephen's mail (that you already submitted changes with this signature) was void (or should have been the second or third argument). IMHO this inflamed the situation.

Quoted 6 lines
Quoted 2 lines

If it is not your real name it does violate the policy. It is that simple.

I was perfectly aware of that before making that submission - as I already pointed out in one of my previous posts, this isn't my first submission (in the kernel tree as well as in other open-source projects) and I hope it won't be the last.

I hope so. ;)

I think I clarified up my mail and will leave this discussion now, too.

Thanks,

Hannes