Closed
Bug 864248
Opened 12 years ago
Closed 11 years ago
Netd BandwidthController segmentation fault
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: albert, Assigned: albert)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
m1
:
review+
|
Details | Diff | Splinter Review |
In function BandwidthController::setCostlyAlert of netd/BandwidthController.cpp file, line 885:
asprintf(&alertQuotaCmd, ALERT_IPT_TEMPLATE, "-I", chainNameAndPos, bytes, alertName, alertName);
Having that: const char BandwidthController::ALERT_IPT_TEMPLATE[] = "%s %s
%s -m quota2 ! --quota %lld --name %s";
the asprintf throws a segmentation fault because bytes is long instead of
string.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #740229 -
Flags: review?(mvines)
Comment 2•12 years ago
|
||
Comment on attachment 740229 [details] [diff] [review]
Fix segmentation fault according to the needed rule of iptable
Review of attachment 740229 [details] [diff] [review]:
-----------------------------------------------------------------
::: BandwidthController.cpp
@@ +48,4 @@
> #include "oem_iptables_hook.h"
>
> /* Alphabetical */
> +const char BandwidthController::ALERT_IPT_TEMPLATE[] = "%s %s -m quota2 ! --quota %lld --name %s";
I see ALERT_IPT_TEMPLATE used in other asprintf()s in this file, so I think that removing the 3rd %s will break them. Would an alternate solution be to add an empty string, "", to the argument list on line 886 between the |chainNameAndPos| and |bytes| arguments?
Attachment #740229 -
Flags: review?(mvines)
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Michael Vines [:m1] [:evilmachines] from comment #2)
> Comment on attachment 740229 [details] [diff] [review]
> Fix segmentation fault according to the needed rule of iptable
>
> Review of attachment 740229 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: BandwidthController.cpp
> @@ +48,4 @@
> > #include "oem_iptables_hook.h"
> >
> > /* Alphabetical */
> > +const char BandwidthController::ALERT_IPT_TEMPLATE[] = "%s %s -m quota2 ! --quota %lld --name %s";
>
> I see ALERT_IPT_TEMPLATE used in other asprintf()s in this file, so I think
> that removing the 3rd %s will break them. Would an alternate solution be
> to add an empty string, "", to the argument list on line 886 between the
> |chainNameAndPos| and |bytes| arguments?
Add an empty string "" does not solve the problem because it causes a double space and later the string is parsed by blank spaces to split command and arguments. As a result, command exec fails.
To solve it I placed an empty string to the first parameter and then remove the first space.
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #740229 -
Attachment is obsolete: true
Attachment #742226 -
Flags: review?(mvines)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → acperez
Assignee | ||
Comment 5•12 years ago
|
||
memmove index was wrong in previous patch
Attachment #742226 -
Attachment is obsolete: true
Attachment #742226 -
Flags: review?(mvines)
Attachment #742996 -
Flags: review?(mvines)
Updated•12 years ago
|
Attachment #742996 -
Flags: review?(mvines) → review+
Comment 6•11 years ago
|
||
All bugs blocking bug 858005 are landed but this one, so we need this one to be landed in a branch, as it is required for Firefox OX 1.2. Or maybe you already have a new version of netd for Firefox OS 1.2?
Flags: needinfo?(mvines)
Comment 7•11 years ago
|
||
Thanks for the reminder. I've landed this in our ICS tree and should appear on CAF early next week at https://www.codeaurora.org/cgit/quic/la/platform/system/netd/log/?h=b2g_ics_1.2
It looks like JB MR2 netd is not affected.
Flags: needinfo?(mvines)
Assignee | ||
Comment 8•11 years ago
|
||
https://www.codeaurora.org/cgit/quic/la/platform/system/netd/log/?h=b2g_ics_1.2 returns Invalid branch: b2g_ics_1.2
Comment 9•11 years ago
|
||
Stay tuned, it's landed honest :)
It has yet to be pushed to CAF due to unrelated issues, might be more toward the latter half of the week before it appears (at which point that branch will become valid).
Assignee | ||
Comment 10•11 years ago
|
||
Fixed for hamachi
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•