[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] Problems in negotiating modern handshake



Wouter,

Yes, but that would need to be handled in serveconnection() anyway (and
it is now, in git HEAD).

Indeed, it was two different problems.

I can't see GIT HEAD from here, but are you also checking for
oversize names? That's a remote DoS too (specify -1 as the name
length).

I don't think you want to return here, or if you have found the
server, you don't send the flags and the 124 bytes of zeroes (the bit
marked "common"), etc.

Actually, you do. negotiate() is called once more, in mainloop(),
unconditionally. At that point, negotiate() skips the first block of
'common' code (due to client and client->modern being set), and the
first block of 'modern' code (due to client being set), but continues at
the second block of 'common' code. By not returning at that position,
the 'client' variable in serveloop never gets anything assigned in the
case of the modern socket.

I couldn't see the flags actually being sent as anything other than
a zero. Perhaps I broke something else. I will recheck.

--
Alex Bligh



Reply to: