Bug 25616 - ipchains-restore incorrectly creates
Summary: ipchains-restore incorrectly creates
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: ipchains (Show other bugs)
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords: Security
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-02-02 04:17 UTC by Ben Liblit
Modified: 2007-04-18 16:31 UTC (History)
2 users (show)

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


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

Description Ben Liblit 2001-02-02 04:17:13 UTC
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-02 04:20:09 UTC
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.