Menu

#37 Memory bound violation at startup

v1.0_(example)
closed
None
1
2020-04-29
2019-11-08
Anonymous
No

type=ANOM_ABEND msg=audit(1573232368.186:128): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 pid=1686 comm="ncidd" reason="memory violation" sig=6

[root@router selinux]# rpm -qa nci*
ncid-1.7.2-1.orc7.x86_64
ncid-client-1.7.2-1.orc7.noarch
ncid-mysql-1.7.2-1.orc7.noarch
[root@router selinux]# rpm -qa glib*
glib-networking-2.56.1-1.el7.x86_64
glib2-devel-2.56.1-5.el7.x86_64
glibc-common-2.17-292.el7.x86_64
glibc-2.17-292.el7.x86_64
glibc-headers-2.17-292.el7.x86_64
glibc-devel-2.17-292.el7.x86_64
glib2-2.56.1-5.el7.x86_64
[root@router selinux]# rpm -qa centos*
centos-release-7-7.1908.0.el7.centos.x86_64
centos-logos-70.0.6-3.el7.centos.noarch
centos-indexhtml-7-9.el7.centos.noarch
[root@router selinux]#

Red Hat has been checking with '__fortify' as to bounds checking

[root@router ~]# grep cid /var/log/messages
Nov 8 11:59:28 router ncidd: *** buffer overflow detected ***: /usr/sbin/ncidd terminated
Nov 8 11:59:28 router ncidd: ======= Backtrace: =========
Nov 8 11:59:28 router ncidd: /lib64/libc.so.6(__fortify_fail+0x37)[0x7fad48d35527]
Nov 8 11:59:28 router ncidd: /lib64/libc.so.6(+0x1166a2)[0x7fad48d336a2]
Nov 8 11:59:28 router ncidd: /usr/sbin/ncidd[0x40def4]
Nov 8 11:59:28 router ncidd: /usr/sbin/ncidd[0x40e14c]
Nov 8 11:59:28 router ncidd: /usr/sbin/ncidd[0x40e1dc]
Nov 8 11:59:28 router ncidd: /usr/sbin/ncidd[0x4021f9]
Nov 8 11:59:28 router ncidd: /lib64/libc.so.6(__libc_start_main+0xf5)[0x7fad48c3f505]
Nov 8 11:59:28 router ncidd: /usr/sbin/ncidd[0x402f5f]
Nov 8 11:59:28 router ncidd: ======= Memory map: ========
Nov 8 11:59:28 router ncidd: 00400000-00416000 r-xp 00000000 fd:01 203179691 /usr/sbin/ncidd
Nov 8 11:59:28 router ncidd: 00615000-00616000 r--p 00015000 fd:01 203179691 /usr/sbin/ncidd
Nov 8 11:59:28 router ncidd: 00616000-00618000 rw-p 00016000 fd:01 203179691 /usr/sbin/ncidd
Nov 8 11:59:28 router ncidd: 00618000-00638000 rw-p 00000000 00:00 0
Nov 8 11:59:28 router ncidd: 00d01000-00d22000 rw-p 00000000 00:00 0 [heap]
Nov 8 11:59:28 router ncidd: 7fad48a07000-7fad48a1c000 r-xp 00000000 fd:01 201716196 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
Nov 8 11:59:28 router ncidd: 7fad48a1c000-7fad48c1b000 ---p 00015000 fd:01 201716196 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
Nov 8 11:59:28 router ncidd: 7fad48c1b000-7fad48c1c000 r--p 00014000 fd:01 201716196 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
Nov 8 11:59:28 router ncidd: 7fad48c1c000-7fad48c1d000 rw-p 00015000 fd:01 201716196 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
Nov 8 11:59:28 router ncidd: 7fad48c1d000-7fad48de0000 r-xp 00000000 fd:01 203016060 /usr/lib64/libc-2.17.so
Nov 8 11:59:28 router ncidd: 7fad48de0000-7fad48fe0000 ---p 001c3000 fd:01 203016060 /usr/lib64/libc-2.17.so
Nov 8 11:59:28 router ncidd: 7fad48fe0000-7fad48fe4000 r--p 001c3000 fd:01 203016060 /usr/lib64/libc-2.17.so
Nov 8 11:59:28 router ncidd: 7fad48fe4000-7fad48fe6000 rw-p 001c7000 fd:01 203016060 /usr/lib64/libc-2.17.so
Nov 8 11:59:28 router ncidd: 7fad48fe6000-7fad48feb000 rw-p 00000000 00:00 0
Nov 8 11:59:28 router ncidd: 7fad48feb000-7fad4900d000 r-xp 00000000 fd:01 203404892 /usr/lib64/ld-2.17.so
Nov 8 11:59:28 router ncidd: 7fad491f3000-7fad491f6000 rw-p 00000000 00:00 0
Nov 8 11:59:28 router ncidd: 7fad49208000-7fad4920c000 rw-p 00000000 00:00 0
Nov 8 11:59:28 router ncidd: 7fad4920c000-7fad4920d000 r--p 00021000 fd:01 203404892 /usr/lib64/ld-2.17.so
Nov 8 11:59:28 router ncidd: 7fad4920d000-7fad4920e000 rw-p 00022000 fd:01 203404892 /usr/lib64/ld-2.17.so
Nov 8 11:59:28 router ncidd: 7fad4920e000-7fad4920f000 rw-p 00000000 00:00 0
Nov 8 11:59:28 router ncidd: 7ffd9e56d000-7ffd9e58e000 rw-p 00000000 00:00 0 [stack]
Nov 8 11:59:28 router ncidd: 7ffd9e5ea000-7ffd9e5ec000 r-xp 00000000 00:00 0 [vdso]
Nov 8 11:59:28 router ncidd: ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Nov 8 11:59:28 router systemd: ncidd.service: control process exited, code=killed status=6
Nov 8 11:59:28 router systemd: Unit ncidd.service entered failed state.
Nov 8 11:59:28 router systemd: ncidd.service failed.

Discussion

  • Anonymous

    Anonymous - 2019-11-08

    it appears I should have logged into SF first -- R P Herrold herrold@owlriver.com

     
  • R P Herrold

    R P Herrold - 2019-11-08

    and once logged in, ... I can subscribe to the ticket

     
  • Ed Attfield

    Ed Attfield - 2019-11-08

    The traceback doesn't give me very much information except that it was running ncidd 1.7.2 and was stopped by a run-time array bound checker.

    I'm going to give you the hated "Can you try the latest version" answer, because we did a lot of work last year for 1.9 to remove the array bounds errors.

    Ideally, for me to be able to fix anything you find, could you download and compile the latest source files? 1.10.1 is here and instructions are in the User Manual .

     
  • R P Herrold

    R P Herrold - 2019-11-11

    no problem ... I shall update, and retain debugging symbols

     
  • R P Herrold

    R P Herrold - 2019-11-12

    and the update

    C
    [root@router yum.repos.d]# grep ncidd /var/log/messages
    Nov 12 12:35:10 router ncidd: *** buffer overflow detected ***: /usr/sbin/ncidd terminated
    Nov 12 12:35:10 router ncidd: ======= Backtrace: =========
    Nov 12 12:35:10 router ncidd: /lib64/libc.so.6(__fortify_fail+0x37)[0x7fb225d4c527]
    Nov 12 12:35:10 router ncidd: /lib64/libc.so.6(+0x1166a2)[0x7fb225d4a6a2]
    Nov 12 12:35:10 router ncidd: /usr/sbin/ncidd[0x40c946]
    Nov 12 12:35:10 router ncidd: /usr/sbin/ncidd[0x40cd0f]
    Nov 12 12:35:10 router ncidd: /usr/sbin/ncidd[0x40cdb1]
    Nov 12 12:35:10 router ncidd: /usr/sbin/ncidd[0x4023d1]
    Nov 12 12:35:10 router ncidd: /lib64/libc.so.6(__libc_start_main+0xf5)[0x7fb225c56505]
    Nov 12 12:35:10 router ncidd: /usr/sbin/ncidd[0x402d5a]
    Nov 12 12:35:10 router ncidd: ======= Memory map: ========
    Nov 12 12:35:10 router ncidd: 00400000-00417000 r-xp 00000000 fd:01 203108781 /usr/sbin/ncidd
    Nov 12 12:35:10 router ncidd: 00616000-00617000 r--p 00016000 fd:01 203108781 /usr/sbin/ncidd
    Nov 12 12:35:10 router ncidd: 00617000-00619000 rw-p 00017000 fd:01 203108781 /usr/sbin/ncidd
    Nov 12 12:35:10 router ncidd: 00619000-0063d000 rw-p 00000000 00:00 0
    Nov 12 12:35:10 router ncidd: 01b41000-01b62000 rw-p 00000000 00:00 0 [heap]
    Nov 12 12:35:10 router ncidd: 7fb225802000-7fb225817000 r-xp 00000000 fd:01 201716196 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
    Nov 12 12:35:10 router ncidd: 7fb225817000-7fb225a16000 ---p 00015000 fd:01 201716196 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
    Nov 12 12:35:10 router ncidd: 7fb225a16000-7fb225a17000 r--p 00014000 fd:01 201716196 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
    Nov 12 12:35:10 router ncidd: 7fb225a17000-7fb225a18000 rw-p 00015000 fd:01 201716196 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
    Nov 12 12:35:10 router ncidd: 7fb225a18000-7fb225a2f000 r-xp 00000000 fd:01 202028990 /usr/lib64/libpthread-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb225a2f000-7fb225c2e000 ---p 00017000 fd:01 202028990 /usr/lib64/libpthread-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb225c2e000-7fb225c2f000 r--p 00016000 fd:01 202028990 /usr/lib64/libpthread-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb225c2f000-7fb225c30000 rw-p 00017000 fd:01 202028990 /usr/lib64/libpthread-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb225c30000-7fb225c34000 rw-p 00000000 00:00 0
    Nov 12 12:35:10 router ncidd: 7fb225c34000-7fb225df7000 r-xp 00000000 fd:01 203016060 /usr/lib64/libc-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb225df7000-7fb225ff7000 ---p 001c3000 fd:01 203016060 /usr/lib64/libc-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb225ff7000-7fb225ffb000 r--p 001c3000 fd:01 203016060 /usr/lib64/libc-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb225ffb000-7fb225ffd000 rw-p 001c7000 fd:01 203016060 /usr/lib64/libc-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb225ffd000-7fb226002000 rw-p 00000000 00:00 0
    Nov 12 12:35:10 router ncidd: 7fb226002000-7fb226062000 r-xp 00000000 fd:01 201764958 /usr/lib64/libpcre.so.1.2.0
    Nov 12 12:35:10 router ncidd: 7fb226062000-7fb226262000 ---p 00060000 fd:01 201764958 /usr/lib64/libpcre.so.1.2.0
    Nov 12 12:35:10 router ncidd: 7fb226262000-7fb226263000 r--p 00060000 fd:01 201764958 /usr/lib64/libpcre.so.1.2.0
    Nov 12 12:35:10 router ncidd: 7fb226263000-7fb226264000 rw-p 00061000 fd:01 201764958 /usr/lib64/libpcre.so.1.2.0
    Nov 12 12:35:10 router ncidd: 7fb226264000-7fb226286000 r-xp 00000000 fd:01 203404892 /usr/lib64/ld-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb22646b000-7fb22646f000 rw-p 00000000 00:00 0
    Nov 12 12:35:10 router ncidd: 7fb226481000-7fb226485000 rw-p 00000000 00:00 0
    Nov 12 12:35:10 router ncidd: 7fb226485000-7fb226486000 r--p 00021000 fd:01 203404892 /usr/lib64/ld-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb226486000-7fb226487000 rw-p 00022000 fd:01 203404892 /usr/lib64/ld-2.17.so
    Nov 12 12:35:10 router ncidd: 7fb226487000-7fb226488000 rw-p 00000000 00:00 0
    Nov 12 12:35:10 router ncidd: 7fff421b2000-7fff421d3000 rw-p 00000000 00:00 0 [stack]
    Nov 12 12:35:10 router ncidd: 7fff421d4000-7fff421d6000 r-xp 00000000 00:00 0 [vdso]
    Nov 12 12:35:10 router ncidd: ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
    Nov 12 12:35:10 router systemd: ncidd.service: control process exited, code=killed status=6
    Nov 12 12:35:10 router systemd: Unit ncidd.service entered failed state.
    Nov 12 12:35:10 router systemd: ncidd.service failed.
    [root@router yum.repos.d]#

    I thought I had the ncidd debuginfo installed, but some symbols are not resolved ... investigating

    -- Russ

     
  • R P Herrold

    R P Herrold - 2019-11-12

    [root@router ~]# ncidd -V
    ncidd [router.owlriver.net:3333] (NCID) 1.10.1
    API: 1.8 Feature Set 1 2 3 4 5
    [root@router ~]#

     
  • Ed Attfield

    Ed Attfield - 2019-11-12

    The top level Makefile has a -O2 option in it that seems to mess things up for me.
    Try removing it, and use make clobber before building again.

     
  • R P Herrold

    R P Herrold - 2019-11-13

    Found it -- it was an over-long entry in the Aliasses file, which the progrem had accepted a few days ago:

    ]
    [root@router ncid]# ncidd -D
    Started: 11/13/2019 10:08:48
    Server: ncidd (NCID) 1.10.1
    API: 1.8 Feature Set 1 2 3 4 5
    Sysname: Linux
    Nodename: router.owlriver.net
    Machine: x86_64
    Release: 3.10.0-1062.4.1.el7.x86_64
    Version: #1 SMP Fri Oct 18 17:15:30 UTC 2019
    Command line: ncidd
    -D
    Logfile: /var/log/ncidd.log
    Processed config file: /etc/ncid/ncidd.conf
    Verbose level: 1
    cidinput = 0
    Configured to send 'cidlog' to clients.
    Configured to send 'cidinfo' to clients.
    Helper tools:
    /usr/bin/cidupdate
    /usr/bin/ncidutil
    Using simple expressions for alias/blacklist/whitelist entries

    Begin: Loading alias, blacklist and whitelist files [10:08:48]
    /etc/ncid/ncidd.alias: Line 308; word is too long: forged CID Name - B of A -- HU after I proceed in call
    *** buffer overflow detected ***: ncidd terminated
    ======= Backtrace: =========
    /lib64/libc.so.6(__fortify_fail+0x37)[0x7fbb9ab51527]
    /lib64/libc.so.6(+0x1166a2)[0x7fbb9ab4f6a2]
    ncidd[0x40c946]
    ncidd[0x40cd0f]
    ... etc etc

     
  • R P Herrold

    R P Herrold - 2019-11-13

    I commented out the offending line, and ... it starts

    9
    alias NAME * = "cold call amacon alexa network" if "16144260646" # Fri Oct

    alias NAME * = "forged CID Name - B of A -- HU after I proceed in call" if "148

    alias NAME * = "spam health call" if "15052970343" # Wed Oct 30 16:29:06 201

    No modified files, so no updates needed.
    [root@router ncid]# ncidd -D
    Started: 11/13/2019 10:09:27
    Server: ncidd (NCID) 1.10.1
    API: 1.8 Feature Set 1 2 3 4 5
    Sysname: Linux
    Nodename: router.owlriver.net
    Machine: x86_64
    Release: 3.10.0-1062.4.1.el7.x86_64
    Version: #1 SMP Fri Oct 18 17:15:30 UTC 2019
    Command line: ncidd
    -D
    Logfile: /var/log/ncidd.log
    Processed config file: /etc/ncid/ncidd.conf
    Verbose level: 1
    cidinput = 0
    Configured to send 'cidlog' to clients.
    Configured to send 'cidinfo' to clients.
    Helper tools:
    /usr/bin/cidupdate
    /usr/bin/ncidutil
    Using simple expressions for alias/blacklist/whitelist entries

    Begin: Loading alias, blacklist and whitelist files [10:09:27]
    Processed alias file: /etc/ncid/ncidd.alias
    Alias Table:
    Number of Entries: 220
    Processed blacklist file: /etc/ncid/ncidd.blacklist
    Blacklist Table:
    Number of Entries: 18
    Processed whitelist file: /etc/ncid/ncidd.whitelist
    Whitelist Table:
    Number of Entries: 0
    Leading 1 in call & alias/blacklist/whitelist not ignored
    End: Loaded alias, blacklist and whitelist files [10:09:27]

    Created CID logfile: /var/log/cidcall.log
    CID logfile maximum size: 110000 bytes
    Data logfile: /var/log/ciddata.log
    Maximum number of clients/gateways: 50
    Telephone Line Identifier: 6954
    Hostname & Port: router.owlriver.net:3333
    TTY port opened: /dev/ttyACM0
    TTY port speed: 115200
    TTY lock file: /var/lock/lockdev/LCK..ttyACM0
    TTY port control signals enabled
    TTY port initialized in ICANON mode.
    Checking Modem Capabilities...
    TTY port changed to RAW mode.
    Modem Initialized
    Modem Identifier: CX93001-EIS_V0.2013-V92
    Modem country code: B5 United States
    Modem ACTIVE PROFILE:
    B1 E1 L2 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0
    S00:0 S01:0 S02:43 S03:13 S04:10 S05:8 S06:2 S07:50 S08:1 S09:6
    S10:14 S11:85 S12:50 S18:0 S25:5 S26:1 S36:7 S38:20 S46:138 S48:7
    S95:0
    Modem supports Data Mode
    Modem supports FAX Mode 1
    Modem supports FAX Mode 2
    Modem supports VOICE Mode
    TTY port changed to ICANON mode.
    TTY port changed to RAW mode.
    Modem initialized.
    Modem set for CallerID.
    TTY port changed to ICANON mode.
    Modem detected
    Modem used for Caller ID
    Does not handle modem calls without Caller ID
    Caller ID from a modem and optional gateways
    Modem also used to dial number
    Dial Modem: 6954
    Dial Timeout: 5 seconds
    LineIDS: 6954
    Debug Mode
    Not using PID file, there was no '-P' option.
    End of startup: 11/13/2019 10:09:28

     
  • R P Herrold

    R P Herrold - 2019-11-13

    So theminimal fix xeems to be to strlen each entry in the alises file, and when not commented, and not over-long, to accept it. When overlong, to emit a WARN and discard it

     
  • Ed Attfield

    Ed Attfield - 2019-11-13

    I should have thought to ask for ncidd.log earlier, and saved you some time.

    There are four places in blacklist and alias parsing for 1.10.1 where this error occurs. I noticed and fixed only one of them recently for 1.11. I will fix the rest.

    We recently discussed having longer/unlimited aliases, and I said it could be done, but I was talked out of it. The current limit is 50 bytes.

     
  • John L. Chmielewski

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     type=ANOM_ABEND msg=audit(1573232368.186:128): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 pid=1686 comm="ncidd" reason="memory violation" sig=6
    
     [root@router selinux]# rpm -qa nci\*
    
    • assigned_to: Ed Attfield
     
  • Ed Attfield

    Ed Attfield - 2020-04-29
     
  • Ed Attfield

    Ed Attfield - 2020-04-29

    ncidd 1.11 does correctly truncate the alias at 50 characters without crashing.

     
  • Ed Attfield

    Ed Attfield - 2020-04-29
    • status: open --> closed
     
  • Ed Attfield

    Ed Attfield - 2020-04-29

    ncidd 1.11 does correctly truncate the alias at 50 characters without crashing.

     

Anonymous
Anonymous

Add attachments
Cancel