* libxt_rateest: fix segfault
@ 2008-12-08 17:24 Jan Engelhardt
2008-12-09 14:05 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2008-12-08 17:24 UTC (permalink / raw)
To: kaber; +Cc: Netfilter Developer Mailing List
commit 48c13b071a7f37ea57f93312c2547d5512b78f3e
Author: Jan Engelhardt <jengelh@medozas.de>
Date: Mon Dec 8 18:23:12 2008 +0100
libxt_rateest: fix segfault
When running `ip6tables -m rateest` without any other arguments,
rateest did segfault.
---
extensions/libxt_rateest.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/extensions/libxt_rateest.c b/extensions/libxt_rateest.c
index ebea437..f0dd577 100644
--- a/extensions/libxt_rateest.c
+++ b/extensions/libxt_rateest.c
@@ -306,7 +306,7 @@ rateest_final_check(unsigned int flags)
{
struct xt_rateest_match_info *info = rateest_info;
- if (!(info->flags & XT_RATEEST_MATCH_REL))
+ if (info != NULL && !(info->flags & XT_RATEEST_MATCH_REL))
info->flags |= XT_RATEEST_MATCH_ABS;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: libxt_rateest: fix segfault
2008-12-08 17:24 libxt_rateest: fix segfault Jan Engelhardt
@ 2008-12-09 14:05 ` Patrick McHardy
2008-12-24 19:15 ` Jan Engelhardt
0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2008-12-09 14:05 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Netfilter Developer Mailing List
Jan Engelhardt wrote:
> commit 48c13b071a7f37ea57f93312c2547d5512b78f3e
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date: Mon Dec 8 18:23:12 2008 +0100
>
> libxt_rateest: fix segfault
>
> When running `ip6tables -m rateest` without any other arguments,
> rateest did segfault.
> ---
> extensions/libxt_rateest.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/extensions/libxt_rateest.c b/extensions/libxt_rateest.c
> index ebea437..f0dd577 100644
> --- a/extensions/libxt_rateest.c
> +++ b/extensions/libxt_rateest.c
> @@ -306,7 +306,7 @@ rateest_final_check(unsigned int flags)
> {
> struct xt_rateest_match_info *info = rateest_info;
>
> - if (!(info->flags & XT_RATEEST_MATCH_REL))
> + if (info != NULL && !(info->flags & XT_RATEEST_MATCH_REL))
> info->flags |= XT_RATEEST_MATCH_ABS;
I think we should print an error message instead. The kernel will
refuse it anyways.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libxt_rateest: fix segfault
2008-12-09 14:05 ` Patrick McHardy
@ 2008-12-24 19:15 ` Jan Engelhardt
2008-12-30 11:05 ` Pablo Neira Ayuso
0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2008-12-24 19:15 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Netfilter Developer Mailing List
On Tuesday 2008-12-09 15:05, Patrick McHardy wrote:
> Jan Engelhardt wrote:
>> When running `ip6tables -m rateest` without any other arguments,
>> rateest did segfault.
>> ---
>> extensions/libxt_rateest.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/extensions/libxt_rateest.c b/extensions/libxt_rateest.c
>> index ebea437..f0dd577 100644
>> --- a/extensions/libxt_rateest.c
>> +++ b/extensions/libxt_rateest.c
>> @@ -306,7 +306,7 @@ rateest_final_check(unsigned int flags)
>> {
>> struct xt_rateest_match_info *info = rateest_info;
>>
>> - if (!(info->flags & XT_RATEEST_MATCH_REL))
>> + if (info != NULL && !(info->flags & XT_RATEEST_MATCH_REL))
>> info->flags |= XT_RATEEST_MATCH_ABS;
>
> I think we should print an error message instead. The kernel will
> refuse it anyways.
parent cea9f71f5618250a38acb21c31fbbf93a752f7d4
commit e2ac8eed9cd24bfabedb931c854ab7e0c9de5fd1
Author: Jan Engelhardt <jengelh@medozas.de>
Date: Wed Dec 24 20:15:44 2008 +0100
rateest: guard against segfault
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
extensions/libxt_rateest.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/extensions/libxt_rateest.c b/extensions/libxt_rateest.c
index ebea437..333239d 100644
--- a/extensions/libxt_rateest.c
+++ b/extensions/libxt_rateest.c
@@ -306,6 +306,9 @@ rateest_final_check(unsigned int flags)
{
struct xt_rateest_match_info *info = rateest_info;
+ if (info == NULL)
+ exit_error(PARAMETER_PROBLEM, "rateest match: "
+ "you need to specify some flags");
if (!(info->flags & XT_RATEEST_MATCH_REL))
info->flags |= XT_RATEEST_MATCH_ABS;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: libxt_rateest: fix segfault
2008-12-24 19:15 ` Jan Engelhardt
@ 2008-12-30 11:05 ` Pablo Neira Ayuso
0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2008-12-30 11:05 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Patrick McHardy, Netfilter Developer Mailing List
Jan Engelhardt wrote:
> parent cea9f71f5618250a38acb21c31fbbf93a752f7d4
> commit e2ac8eed9cd24bfabedb931c854ab7e0c9de5fd1
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date: Wed Dec 24 20:15:44 2008 +0100
>
> rateest: guard against segfault
Applied. Thanks Jan.
--
"Los honestos son inadaptados sociales" -- Les Luthiers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-30 11:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-08 17:24 libxt_rateest: fix segfault Jan Engelhardt
2008-12-09 14:05 ` Patrick McHardy
2008-12-24 19:15 ` Jan Engelhardt
2008-12-30 11:05 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).