pcp
[Top] [All Lists]

pcp updates - yippee secure socket connections work

To: pcp@xxxxxxxxxxx
Subject: pcp updates - yippee secure socket connections work
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Thu, 18 Apr 2013 15:55:04 +1000
Delivered-to: pcp@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
Re. the chronologically last commit in this batch (first one in the list below)

I expect to hear the sound of sandals hitting the ground over this one ... a 
"miracle" does go close to describing what it took to find and fix this one.

Since this is ONLY at the core of EVERYTHING in PCP, it would be a good idea to 
have as may knowing eyes look at this particular change as possible and be 
ruthless in your reviewing.

I have a clean (NO failures) QA run on one host with these changes ... I'll get 
more QA coverage overnight.

Changes committed to git://oss.sgi.com/kenj/pcp.git dev

 qa/.gitignore                |    1 
 qa/008                       |   20 ++
 qa/008.out.bozo+sdc          |   59 ++++++++
 qa/024                       |    3 
 qa/199                       |    7 
 qa/200                       |   20 ++
 qa/200.out                   |   23 +++
 qa/200.out.1                 |   38 +++++
 qa/200.out.2                 |   61 ++++++++
 qa/273                       |    1 
 qa/287.out.x86_64            |  312 +++++++++++++++++++++----------------------
 qa/297                       |    1 
 qa/348                       |    2 
 qa/439                       |    3 
 qa/455                       |   23 +++
 qa/587                       |    2 
 qa/643                       |    2 
 qa/712                       |    3 
 qa/group                     |    2 
 src/include/pcp/impl.h       |    2 
 src/libpcp/src/auxconnect.c  |   10 +
 src/libpcp/src/ipc.c         |    2 
 src/libpcp/src/nss_connect.c |   27 +++
 src/libpcp/src/pdu.c         |  312 +++++++++++++++++++++++++------------------
 src/pmcd/src/dopdus.c        |    2 
 src/pmdbg/pmdbg.c            |    4 
 26 files changed, 631 insertions(+), 311 deletions(-)

commit 08dd0c7d176b824d8528e849910bd75df25c9e37
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 15:32:43 2013 +1000

    libpcp - killer bug in PCP PDU layer exposed by secure sockets
    
    One of the long-standing assumptions in the PCP PDU layer, is
    that since we only ever write PDUs with a fixed sized header
    plus a variable amount of data, on the receiver side an atomic
    read()/recv() requesting the header size (or a whole word and
    word-aligned part thereof) will return _all_ of the requested data,
    else it is treated as an PM_ERR_IPC error and the show is over.
    
    For regular sockets (pmcd/pmproxy/pmda/client connections) and files
    (PCP archives) this assumption has stood the test of time across more
    TCP/IP implementations than you could hit with a big stick.
    
    But with secure sockets lurking under the covers and the various
    and assorted handshake, encyption and compression games in play,
    the assumption no longer stands and we have seen requests for 4,
    8, 12 bytes returning data of length 1, 5, 7, ... bytes followed
    by the remainder of the data in one or more subesquent recv()s
    (so returning a shorter than expected buffer it is _not_ the end
    of the data stream).
    
    This commit re-engineers the _entire_ PDU assembly logic in
    pduread() to match the brave new world reality.
    
    With this change, secure socket connections from clients to pmcd
    and/or pmproxy are working for me, and all of QA is passing on
    at least one host so far.

commit c9df92432930c3978a8fd9f1fe1809f6495f9dba
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 15:29:49 2013 +1000

    qa/199,348,587,643 - maintain pmcd configuration state
    
    For tests that Install and/or Remove PMDAs, it is important
    that they leave the pmcd configuration, PMDA configuration and
    PMNS configuration in the same state as they were before the
    test was run.

commit 2c7c14593e03dfa2e0ead02376d021368a76df78
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 15:24:18 2013 +1000

    qa/712 - undo debug changes

commit 4ed4298c0f7aea41a8b70434ae494b7973f7b49c
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 15:21:26 2013 +1000

    libpcp - __pmRecv additional diagnostics
    
    We have multiple flavours of __pmRecv() that might be used, so
    add diagnostics to identify which flavour and low-level details
    of packets received (under the conjuncted control of DBG_TRACE_PDU
    and DBG_TRACE_DESPERATE).

commit a8e123efaa14758dea24b004104dad3882f23a08
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 15:17:05 2013 +1000

    pmcd - add flags field of credentials exchange to diag

commit 172e443a2410531a7fcf41f464833832f954b67e
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 14:53:20 2013 +1000

    libpcp/ipc.c - hide noisy diagnostic behind DBG_TRACE_DESPERATE
    
    The DBG_TRACE_CONTEXT diagnostic
        __pmDataIPC: fd=<n>, data=<addr>(sz=<k>)
    is generated a _lot_, and is not all that helpful amongst the other
    -Dcontext diagnostics, so hide this one behind the (new) conjuncted
    DBG_TRACE_DESPERATE flag.
    
    -Dcontext,desperate will make it appear again if needed.

commit 9036f208d27e2c331db29933524b15cb50f012eb
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 14:44:31 2013 +1000

    Diagnostics - add DBG_TRACE_DESPERATE support
    
    One level of additional verbosity control in the diagnostics.
    
    Set from the command line with one or more flags, e.g -D pdu,desperate
    and execution is guarded by a predictate like
        if ((pmDebug & DBG_TRACE_PDU) && (pmDebug & DBG_TRACE_DESPERATE))
    
    The intention is that only the desperate developer would (a) add
    diagnositics under the conjuncted DBG_TRACE_DESPERATE control,
    (b) be interested in the output from these diagnostics.
    
    For example uses in libpcp, see the subsequent commits to pdu.c and ipc.c.

commit e2d1042b3da0a9197337678ae0030ebb82bc4b3c
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 14:42:43 2013 +1000

    qa/group - test 193 belongs in the pdu group

commit b225ceb1ac8251d41f27f4eddb34d00e006df08c
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 14:41:09 2013 +1000

    qa/439 - filter refinement
    
    Treat "TCP connection reset by peer" as equivalent to "Connection refused"
    for this test.

commit 4c20cd69d2114ae0b1fdcb06f4dea72630fa9654
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 14:39:13 2013 +1000

    qa/455 - rsyslog pmda testing
    
    A couple of changes needed here:
    a) maintain pmcd configuration state ... if the PMDA is installed
       before this test runs, make sure it is installed after the test
       has been run, else if the PMDA is NOT installed before this
       this test runs, make sure it is NOT installed after the test
       has been run
    b) add a small amount of checking for the named pipe creation
       ($PCP_LOG_DIR/rsyslog/stats) to avoid a race between the Install
       and the QA test that can leave the QA test hanging on the write
       to the named pipe.

commit 2de4cef4382f368b36ddb232529b16eed47c6e33
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 11:17:19 2013 +1000

    qa/297 - filter out __pmConnect diag added in PCP 3.7.2

commit 0c7f69d1d374e8c603f2f6c763fbe8aff10cd860
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 11:05:26 2013 +1000

    Revert "qa/287 - slightly different floating point precision for x86_64"
    
    This reverts commit 8704c97674c69da4ac7704b61dd7978d5a6fb4e3.

commit 473e4ac9e19b35863fb31c0ab37fc6fec74cdc25
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 11:03:07 2013 +1000

    qa/273 - filter out __pmConnect diag added in PCP 3.7.2

commit 14f5d6e60b50f95d77983b70c3753664981eded3
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 10:59:17 2013 +1000

    qa/200 - handle new __pmConnect diag added in PCP 3.7.2

commit b548b989bd80702156691f6f8ce8e241b9ae71ec
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 10:49:22 2013 +1000

    qa/024 - filter out __pmConnect diag added in PCP 3.7.2

commit cf7e2d5bed688669ee95e5d18390e5b0e007a665
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Thu Apr 18 10:25:31 2013 +1000

    qa/008 - fix disk non-determinism for host bozo

<Prev in Thread] Current Thread [Next in Thread>