This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 25616 - ipchains-restore incorrectly creates
ipchains-restore incorrectly creates
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: ipchains (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
David Lawrence
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-02-01 23:17 EST by Ben Liblit
Modified: 2007-04-18 12:31 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-02-06 11:48:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
suggested fix; same as in original report, but without screwey line wrapping (300 bytes, patch)
2001-02-01 23:20 EST, Ben Liblit
no flags Details | Diff

  None (edit)
Description Ben Liblit 2001-02-01 23:17:13 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.1 i686)


The "ipchains-restore" script automatically creates chains mentioned as
rule targets.  Built-in targets, however, are not created as chains.  These
include REJECT, DENY, ACCEPT, REDIRECT, and MASQ.

That list *should* also include RETURN, but it does not.  If a rule uses
the built-in RETURN target, ipchains-restore will instead create an empty
RETURN chain.

Once that happens, will matched packets use the built-in RETURN target or
will they go to this bogus RETURN chain?  I'm not sure.  If the later, then
this bug has the potential to seriously compromise sites' packet filtering
security policies.

Reproducible: Always
Steps to Reproduce:
As root, run the following commands:

    # ipchains -A input -j RETURN
    # service ipchains save
    # service ipchains restore

Actual Results:  Diagnostic output:  "Auto-creating chain RETURN".

Running "ipchains -L" confirms the incorrect creation of a RETURN chain.

Expected Results:  No diagnostic output, and no creation of a RETURN
chain.  Rules with target RETURN use the built-in RETURN target, not a
chain named RETURN.

The following patch fixes the problem in the obvious manner:

--- ipchains-restore-bad	Thu Feb  1 19:03:18 2001
+++ ipchains-restore	Thu Feb  1 19:03:32 2001
@@ -53,6 +53,7 @@
 		ACCEPT) ;;
 		REDIRECT) ;;
 		MASQ) ;;
+		RETURN) ;;
 		*) $IPCHAINS -N $arg 2>/dev/null >/dev/null && if [ $VERBOSE ]; then
echo Auto-creating chain $arg; fi
 	    esac
 	    return
Comment 1 Ben Liblit 2001-02-01 23:20:09 EST
Created attachment 8699 [details]
suggested fix; same as in original report, but without screwey line wrapping

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