clamavj icon indicating copy to clipboard operation
clamavj copied to clipboard

Timing issues

Open toby78 opened this issue 8 years ago • 0 comments

Using the following tcp dump:

tcpdump not port 2287 and not port 80 and not port 443 and not port 8080 and not port 3306 and not port 53 -i any -X -s0 -n and not arp

we discovered, that there can be different delayes between the last package being sent and the returned status from clamav daemon:

E.g. in this example - nothing happened for 4 seconds until stream OK was sent...


        0x3ef0:  d644 299b ce8f 75b3 3a17 eead 0126 d844  .D)...u.:....&.D
        0x3f00:  723b 7f42 b8ad e5b0 6474 dc9d 531f 8df4  r;.B....dt..S...
        0x3f10:  9127 539b 200d ce84 41de da14 5371 009c  .'S.....A...Sq..
        0x3f20:  6b19 c894 a718 0fa6 1370 661f 842f 1281  k........pf../..
        0x3f30:  5ce0 9da2 aa6e 0e04 504d 254c dff7 7015  \....n..PM%L..p.
        0x3f40:  b861 15e3 5a7c b29c 7efb ae86 16a0 cd7b  .a..Z|..~......{
        0x3f50:  e7fd 507b 3478 133f 02a5 84d1 2d71 1f88  ..P{4x.?....-q..
        0x3f60:  4eee fe78 69e5 b735 80f3 96b0 2568 a3ee  N..xi..5....%h..
        0x3f70:  a451 dcfd 7198 bd4c 7b4c 43fe 618a 5436  .Q..q..L{LC.a.T6
        0x3f80:  c566 3aca db06 0687 b170 f9cc c6e2 4cc2  .f:......p....L.
        0x3f90:  0b39 e499 449c 4e16 c624 40d5 300d 97c8  [email protected]...
        0x3fa0:  6bba 310b 9cee fbbe bdaa dfc6 8c03 45c9  k.1...........E.
        0x3fb0:  0373 e0aa ae1f 5130 40b9 8846 59a7 73bd  [email protected].
        0x3fc0:  500f 575f aa5c 060c 5c99 3694 372f f6a2  P.W_.\..\.6.7/..
        0x3fd0:  bdc7 6222 bbbf 5238 83b2 18f4 6b7d 5761  ..b"..R8....k}Wa
        0x3fe0:  9496 b957 8ed1 70b3 9c70 b48b 86f3 bac6  ...W..p..p......
        0x3ff0:  7a4b 541d 924f 24bd 6aac 8d83 b02b 84a3  zKT..O$.j....+..
        0x4000:  1e66 7107 80dc c184 6e7e 3138 f0d6 5ca4  .fq.....n~18..\.
        0x4010:  7cf8 140b 1f25 f82c 9510 76b4 4fee 2663  |....%.,..v.O.&c
        0x4020:  d6b5 99d6 639a ab05 5d8d 71d0 dd21 afca  ....c...].q..!..
        0x4030:  1923 0c20                                .#..
16:05:53.451347 IP 81.24.70.152.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 548
        0x0000:  4500 0240 50c7 0000 4011 9036 5118 4698  E..@[email protected].
        0x0010:  ffff ffff 0043 0044 022c d1e2 0201 0600  .....C.D.,......
        0x0020:  3a0e 4357 0000 0000 0000 0000 0000 0000  :.CW............
        0x0030:  0000 0000 0000 0000 001e b808 ac3b 0000  .............;..
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0060:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0070:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0080:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0090:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00a0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00b0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00c0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00e0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0100:  0000 0000 0000 0000 6382 5363 3501 0636  ........c.Sc5..6
        0x0110:  0451 1846 98ff 0000 0000 0000 0000 0000  .Q.F............
        0x0120:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0130:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0140:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0150:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0160:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0170:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0180:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0190:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01a0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01b0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01c0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01d0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01e0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0200:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0210:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0220:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0230:  0000 0000 0000 0000 0000 0000 0000 0000  ................
16:05:53.845258 IP 127.0.0.1.38346 > 127.0.0.1.9321: Flags [F.], seq 112433199, ack 1, win 257, options [nop,nop,TS val 2223325 ecr 2223079], length 0
        0x0000:  4500 0034 4faf 4000 4006 ed12 7f00 0001  E..4O.@.@.......
        0x0010:  7f00 0001 95ca 2469 edbc 758d 48d9 4c0a  ......$i..u.H.L.
        0x0020:  8011 0101 fe28 0000 0101 080a 0021 ecdd  .....(.......!..
        0x0030:  0021 ebe7                                .!..
16:05:53.883041 IP 127.0.0.1.9321 > 127.0.0.1.38346: Flags [.], ack 112433200, win 2048, options [nop,nop,TS val 2223335 ecr 2223325], length 0
        0x0000:  4500 0034 c068 4000 4006 7c59 7f00 0001  E..4.h@.@.|Y....
        0x0010:  7f00 0001 2469 95ca 48d9 4c0a edbc 758e  ....$i..H.L...u.
        0x0020:  8010 0800 fe28 0000 0101 080a 0021 ece7  .....(.......!..
        0x0030:  0021 ecdd                                .!..
16:05:57.433426 IP 81.24.70.169.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1e:b8:08:ac:3b, length 259
        0x0000:  4500 011f 0000 4000 4011 a20d 5118 46a9  E.....@[email protected].
        0x0010:  ffff ffff 0044 0043 010b 9fb2 0101 0600  .....D.C........
        0x0020:  3a0e 4357 0b00 0000 0000 0000 0000 0000  :.CW............
        0x0030:  0000 0000 0000 0000 001e b808 ac3b 0000  .............;..
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0060:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0070:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0080:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0090:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00a0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00b0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00c0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00e0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0100:  0000 0000 0000 0000 6382 5363 3501 0332  ........c.Sc5..2
        0x0110:  0451 1846 a937 0701 0203 060c 0f1c ff    .Q.F.7.........
16:05:59.451183 IP 81.24.70.152.67 > 255.255.255.255.68: BOOTP/DHCP, Reply, length 548
        0x0000:  4500 0240 1901 0000 4011 c7fc 5118 4698  E..@[email protected].
        0x0010:  ffff ffff 0043 0044 022c d1e2 0201 0600  .....C.D.,......
        0x0020:  3a0e 4357 0000 0000 0000 0000 0000 0000  :.CW............
        0x0030:  0000 0000 0000 0000 001e b808 ac3b 0000  .............;..
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0060:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0070:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0080:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0090:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00a0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00b0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00c0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00d0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00e0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x00f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0100:  0000 0000 0000 0000 6382 5363 3501 0636  ........c.Sc5..6
        0x0110:  0451 1846 98ff 0000 0000 0000 0000 0000  .Q.F............
        0x0120:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0130:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0140:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0150:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0160:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0170:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0180:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0190:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01a0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01b0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01c0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01d0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01e0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x01f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0200:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0210:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0220:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0230:  0000 0000 0000 0000 0000 0000 0000 0000  ................
16:06:03.999155 IP 127.0.0.1.9321 > 127.0.0.1.38346: Flags [P.], seq 1:12, ack 112433200, win 2048, options [nop,nop,TS val 2225864 ecr 2223325], length 11
        0x0000:  4500 003f c069 4000 4006 7c4d 7f00 0001  E..?.i@.@.|M....
        0x0010:  7f00 0001 2469 95ca 48d9 4c0a edbc 758e  ....$i..H.L...u.
        0x0020:  8018 0800 fe33 0000 0101 080a 0021 f6c8  .....3.......!..
        0x0030:  0021 ecdd 7374 7265 616d 3a20 4f4b 00    .!..stream:.OK.

This leads to an error in:

   stream = file.getStream();
    ScanResult scan = clamScan.scan(stream);

    if (!scan.getStatus().equals(ScanResult.Status.PASSED)) {
    }

...as the Status was not PASSED - although it passed - just 4 seconds later.

Maybe we need to have an additional timeout for "idle" connections?

toby78 avatar May 23 '16 14:05 toby78