This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 474381 - iptstate -s -S <source> -D <dest> segfaults
iptstate -s -S <source> -D <dest> segfaults
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: iptstate (Show other bugs)
5.2
All Linux
low Severity high
: rc
: ---
Assigned To: Thomas Woerner
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-03 11:01 EST by Peter Bieringer
Modified: 2013-04-12 15:59 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-16 04:25:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Peter Bieringer 2008-12-03 11:01:58 EST
Description of problem:

iptstate segfaults in case of use of "-s" and "-S" and "-D"

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

How reproducible:
Always


Steps to Reproduce:
# iptstate -s -S 1.2.3.4 -D 5.6.7.8
IP Tables State Top -- Sort by: SrcIP
Segmentation fault

  
Actual results:
Segfault

Expected results:
No segfault


Additional info:

last lines of strace:

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f79000
read(4, "# /etc/protocols:\n# $Id: protoco"..., 4096) = 4096
close(4)                                = 0
munmap(0xb7f79000, 4096)                = 0
read(3, "", 8191)                       = 0
close(3)                                = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 3), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f79000
write(1, "IP Tables State Top -- Sort by: "..., 38IP Tables State Top -- Sort by: SrcIP
) = 38
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Comment 1 Phil Knirsch 2008-12-22 09:01:20 EST
Seems as if -s isn't correctly checked for a valid ip-address.

Proposing for RHEL-5.4 and granting Devel ACK.

Thanks & regards, Phil
Comment 2 Peter Bieringer 2008-12-22 09:15:01 EST
"-s" (non-capital) means single shot, I'm using this as input for special parsing of the state table (easier than /proc/net/nf_conntrack)

Without "-s", -S and -D works fine, looks like a test case is missing...
Comment 3 Phil Knirsch 2008-12-22 11:00:37 EST
Ah yes, was looking at the wrong manpage, sorry.

A quick check revealed that iptstate seems to be still using ncurses output functions for the single shot run, but i suspect it isn't initializing the ncurses environment properly. Should still be an easy fix.

Thanks & regards, Phil
Comment 4 Peter Bieringer 2008-12-22 11:04:17 EST
Note, using "-s" without "-D" or "-S" will not segfault...
Comment 5 RHEL Product and Program Management 2009-03-26 13:03:53 EDT
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 8 Thomas Woerner 2009-11-11 03:32:48 EST
In single-run mode curses is not used, but one function call is printw instead of printf, which is used for formatted output in a curses window. This leads to the problem.
Comment 12 errata-xmlrpc 2009-12-16 04:25:35 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1676.html

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