Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2186

QuorumCnxManager#receiveConnection may crash with random input

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.6, 3.5.0
    • 3.4.7, 3.5.1, 3.6.0
    • server
    • None

    Description

      This will allocate an arbitrarily large byte buffer (and try to read it!):

          public boolean receiveConnection(Socket sock) {
              Long sid = null;
      ...
                      sid = din.readLong();
                      // next comes the #bytes in the remainder of the message                                                                             
                      int num_remaining_bytes = din.readInt();
                      byte[] b = new byte[num_remaining_bytes];
                      // remove the remainder of the message from din                                                                                      
                      int num_read = din.read(b);
      

      This will crash the QuorumCnxManager thread, so the cluster will keep going but future elections might fail to converge (ditto for leaving/joining members).

      Patch coming up in a bit.

      Attachments

        1. ZOOKEEPER-2186.patch
          13 kB
          Raúl Gutiérrez Segalés
        2. ZOOKEEPER-2186.patch
          12 kB
          Raúl Gutiérrez Segalés
        3. ZOOKEEPER-2186.patch
          9 kB
          Raúl Gutiérrez Segalés
        4. ZOOKEEPER-2186-v3.4.patch
          2 kB
          Raúl Gutiérrez Segalés

        Issue Links

          Activity

            People

              rgs Raúl Gutiérrez Segalés
              rgs Raúl Gutiérrez Segalés
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: