Bug 131848 - iptables has a couple out of bounds accesses
iptables has a couple out of bounds accesses
Product: Fedora
Classification: Fedora
Component: iptables (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
Depends On:
Blocks: FC3Target FC4Target
  Show dependency treegraph
Reported: 2004-09-05 12:09 EDT by Steve Grubb
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-18 11:48:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch that addresses the oob accesses (1.81 KB, patch)
2004-09-05 12:10 EDT, Steve Grubb
no flags Details | Diff

  None (edit)
Description Steve Grubb 2004-09-05 12:09:18 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.4.2)

Description of problem:
There are a couple out of bounds accesses in iptables REJECT and rpcs
extensions. They would print garbage, core dump the program, or act
badly. The net effect could be bad if it choked - leaving a table in
an unknown state.

I will attach a patch that fixes it.

Version-Release number of selected component (if applicable):

How reproducible:
Didn't try

Steps to Reproduce:
1. Found in code review.

Additional info:
Comment 1 Steve Grubb 2004-09-05 12:10:44 EDT
Created attachment 103490 [details]
Patch that addresses the oob accesses
Comment 2 Thomas Woerner 2004-09-16 12:03:55 EDT
The second part of the patch is accepted by the netfilter core team,
but the first part is not.

I will apply the second part, but not the first.
Comment 3 Steve Grubb 2004-09-16 12:23:58 EDT
What's wrong with the first part? 

Here's the core of the problem:

for (i=0; i<sizeof(reject_table)/sizeof(struct reject_names); i++) { 
              if (reject_table[i].with == reject->with)
printf("reject-with %s ", reject_table[i].name);

What if the break is never hit and i > the last legal entry. The
unconditional printf will index beyond the reject_table.
Comment 4 Thomas Woerner 2005-03-18 11:48:57 EST
Fixed in rawhide in rpm iptables-1.3.0-2 or newer.

Note You need to log in before you can comment on or make changes to this bug.