Ignore:
Timestamp:
Mar 11, 2012, 6:19:02 PM (13 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.0 with CVE-2012-0870 security patch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/smbd/process.c

    r468 r693  
    10261026        int msg_type = CVAL(inbuf,0);
    10271027        uint16_t mid = SVAL(inbuf, smb_mid);
     1028        uint8_t wct = CVAL(inbuf, smb_wct);
    10281029
    10291030        chain_size = 0;
     
    10331034        if (msg_type != 0)
    10341035                return(reply_special(inbuf,outbuf)); 
     1036
     1037        /* Ensure we have at least wct words and 2 bytes of bcc. */
     1038        if (smb_size + wct*2 > size) {
     1039                DEBUG(0,("init_smb_request: invalid wct number %u (size %u)\n",
     1040                        (unsigned int)wct,
     1041                        (unsigned int)size));
     1042                exit_server_cleanly("Invalid SMB request");
     1043        }
     1044        /* Ensure bcc is correct. */
     1045        if (((uint8 *)smb_buf(inbuf)) + smb_buflen(inbuf) > inbuf + size) {
     1046                DEBUG(0,("init_smb_request: invalid bcc number %u "
     1047                        "(wct = %u, size %u)\n",
     1048                        (unsigned int)smb_buflen(inbuf),
     1049                        (unsigned int)wct,
     1050                        (unsigned int)size));
     1051                exit_server_cleanly("Invalid SMB request");
     1052        }
    10351053
    10361054        construct_reply_common(inbuf, outbuf);
     
    11621180        static int orig_size;
    11631181        int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0);
    1164         unsigned smb_off2 = SVAL(inbuf,smb_vwv1);
     1182        static unsigned smb_off2;
    11651183        char *inbuf2, *outbuf2;
    11661184        int outsize2;
     
    11811199                orig_outbuf = outbuf;
    11821200                orig_size = size;
    1183         }
     1201                smb_off2 = 0;
     1202        }
     1203
     1204        if (SVAL(inbuf,smb_vwv1) <= smb_off2) {
     1205                DEBUG(1, ("AndX offset not increasing\n"));
     1206                SCVAL(outbuf, smb_vwv0, 0xFF);
     1207                return outsize;
     1208        }
     1209        smb_off2 = SVAL(inbuf, smb_vwv1);
    11841210
    11851211        /* Validate smb_off2 */
Note: See TracChangeset for help on using the changeset viewer.