[Samba] multiple smb commands (some non AndX) in one packet - Samba

This is a discussion on [Samba] multiple smb commands (some non AndX) in one packet - Samba ; Does samba server handle multiple smb commands (not necessarily andx commands) within one packet? If a client were to send commands such as 0x2f, 0x32, 0x32 in one packet instead of three separate packets, does samba server handle it i.e. ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: [Samba] multiple smb commands (some non AndX) in one packet

  1. [Samba] multiple smb commands (some non AndX) in one packet

    Does samba server handle multiple smb commands (not necessarily andx commands)
    within one packet? If a client were to send commands such as 0x2f, 0x32, 0x32
    in one packet instead of three separate packets, does samba server
    handle it i.e.
    respond to each of the three requests?
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


  2. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Wed, Jun 04, 2008 at 01:36:20PM -0500, Shirish Pargaonkar wrote:
    > Does samba server handle multiple smb commands (not necessarily andx commands)
    > within one packet? If a client were to send commands such as 0x2f, 0x32, 0x32
    > in one packet instead of three separate packets, does samba server
    > handle it i.e.
    > respond to each of the three requests?


    Yes, we should do that. Of course there are earlier
    bugs in the implementation but I believe as of our
    latest code (3.0.30 and 3.2rc's) we handle this
    correctly.

    Jeremy.
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


  3. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Wed, Jun 04, 2008 at 11:42:30AM -0700, Jeremy Allison wrote:
    > On Wed, Jun 04, 2008 at 01:36:20PM -0500, Shirish Pargaonkar wrote:
    > > Does samba server handle multiple smb commands (not necessarily andx commands)
    > > within one packet? If a client were to send commands such as 0x2f, 0x32, 0x32
    > > in one packet instead of three separate packets, does samba server
    > > handle it i.e.
    > > respond to each of the three requests?

    >
    > Yes, we should do that. Of course there are earlier
    > bugs in the implementation but I believe as of our
    > latest code (3.0.30 and 3.2rc's) we handle this
    > correctly.


    Isn't it that we only have to take special care of the andX
    type requests? For the other ones we should not even notice
    that there are multiple requests in a TCP packet. 0x2f is
    writeX, this might require special handling, but the fact
    that 0x32 (trans2) is followed by something else in the same
    frame shouldn't be noticed by smbd at all.

    Or are you doing something special magic to wrap these into
    the same netbios-level message (no idea how this should
    work...)? :-)

    Volker

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (GNU/Linux)

    iD8DBQFIRuW4UzqjrWwMRl0RApfxAJ9Mlmhiswxfqc6lkFL8/FBtWm9TiACdFOHD
    1nnJoNWWRBPgYy7j4s4sdCg=
    =Q5lx
    -----END PGP SIGNATURE-----


  4. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Wed, Jun 04, 2008 at 08:58:00PM +0200, Volker Lendecke wrote:
    > On Wed, Jun 04, 2008 at 11:42:30AM -0700, Jeremy Allison wrote:
    > > On Wed, Jun 04, 2008 at 01:36:20PM -0500, Shirish Pargaonkar wrote:
    > > > Does samba server handle multiple smb commands (not necessarily andx commands)
    > > > within one packet? If a client were to send commands such as 0x2f, 0x32, 0x32
    > > > in one packet instead of three separate packets, does samba server
    > > > handle it i.e.
    > > > respond to each of the three requests?

    > >
    > > Yes, we should do that. Of course there are earlier
    > > bugs in the implementation but I believe as of our
    > > latest code (3.0.30 and 3.2rc's) we handle this
    > > correctly.

    >
    > Isn't it that we only have to take special care of the andX
    > type requests? For the other ones we should not even notice
    > that there are multiple requests in a TCP packet. 0x2f is
    > writeX, this might require special handling, but the fact
    > that 0x32 (trans2) is followed by something else in the same
    > frame shouldn't be noticed by smbd at all.
    >
    > Or are you doing something special magic to wrap these into
    > the same netbios-level message (no idea how this should
    > work...)? :-)


    I think he's talking about multiple commands in the
    same SMB frame, not TCP frame. At least that's how
    I answered him :-). I was assuming the andX commands.

    Jeremy.
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


  5. Re: [Samba] multiple smb commands (some non AndX) in one packet

    No, I am talking about multiple smb commands in the same tcp frame and
    not necessarily andx commands.
    I see a tcp frame with multiple smb commands going over to Windows XP
    server and the server either responds to the first command and ignores rest
    or does not respond and cifs client reconnects thinking server is not
    responding.
    I see the same problem with samba server (cifs client reconnecting after logging
    server does not respond or No response for/to cmd), just that I have not been
    able to capture the wireshark trace successfully (unpredictable timing and
    too much traffic, wireshark dropping packets etc.).

    cifs client does not do this (bundling multiple smb commands) conciously,
    I think tcp does club them together and if tcp is doing that, I do not know why
    and how to prevent it and if it can't be prevented, would be nice if
    samba server
    can tackle them.


    On 6/4/08, Volker Lendecke wrote:
    > On Wed, Jun 04, 2008 at 11:42:30AM -0700, Jeremy Allison wrote:
    > > On Wed, Jun 04, 2008 at 01:36:20PM -0500, Shirish Pargaonkar wrote:
    > > > Does samba server handle multiple smb commands (not necessarily andx commands)
    > > > within one packet? If a client were to send commands such as 0x2f, 0x32, 0x32
    > > > in one packet instead of three separate packets, does samba server
    > > > handle it i.e.
    > > > respond to each of the three requests?

    > >
    > > Yes, we should do that. Of course there are earlier
    > > bugs in the implementation but I believe as of our
    > > latest code (3.0.30 and 3.2rc's) we handle this
    > > correctly.

    >
    > Isn't it that we only have to take special care of the andX
    > type requests? For the other ones we should not even notice
    > that there are multiple requests in a TCP packet. 0x2f is
    > writeX, this might require special handling, but the fact
    > that 0x32 (trans2) is followed by something else in the same
    > frame shouldn't be noticed by smbd at all.
    >
    > Or are you doing something special magic to wrap these into
    > the same netbios-level message (no idea how this should
    > work...)? :-)
    >
    > Volker
    >
    >

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


  6. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Wed, Jun 04, 2008 at 02:20:45PM -0500, Shirish Pargaonkar wrote:
    > No, I am talking about multiple smb commands in the same tcp frame and
    > not necessarily andx commands.
    > I see a tcp frame with multiple smb commands going over to Windows XP
    > server and the server either responds to the first command and ignores rest
    > or does not respond and cifs client reconnects thinking server is not
    > responding.
    > I see the same problem with samba server (cifs client
    > reconnecting after logging
    > server does not respond or No response for/to cmd), just that I have not been
    > able to capture the wireshark trace successfully (unpredictable timing and
    > too much traffic, wireshark dropping packets etc.).
    >
    > cifs client does not do this (bundling multiple smb
    > commands) conciously, I think tcp does club them together
    > and if tcp is doing that, I do not know why and how to
    > prevent it and if it can't be prevented, would be nice if
    > samba server can tackle them.


    This sounds like a *very* weird bug in either the client
    framing or XP. If the client does correct smb framing, i.e.
    the 4-byte length header, Samba should really not have a
    problem with it. And I very much doubt that XP has a bug
    here.

    What client is that?

    Volker

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (GNU/Linux)

    iD8DBQFIRu5SUzqjrWwMRl0RApZSAJ93OMNPLJg9luCvscITZn 5L8xubVACfWjLP
    k0M2KdEJJ1ff++xoW1cNrhQ=
    =IOaL
    -----END PGP SIGNATURE-----


  7. Re: [Samba] multiple smb commands (some non AndX) in one packet

    cifs.ko.
    You mean 4-byte header FF 53 4D 42?
    In another recreate, tcp frame has two smb requests,
    close (0x4) and locking andx (0x24) each with this four byte header.



    On 6/4/08, Volker Lendecke wrote:
    > On Wed, Jun 04, 2008 at 02:20:45PM -0500, Shirish Pargaonkar wrote:
    > > No, I am talking about multiple smb commands in the same tcp frame and
    > > not necessarily andx commands.
    > > I see a tcp frame with multiple smb commands going over to Windows XP
    > > server and the server either responds to the first command and ignores rest
    > > or does not respond and cifs client reconnects thinking server is not
    > > responding.
    > > I see the same problem with samba server (cifs client
    > > reconnecting after logging
    > > server does not respond or No response for/to cmd), just that I have not been
    > > able to capture the wireshark trace successfully (unpredictable timing and
    > > too much traffic, wireshark dropping packets etc.).
    > >
    > > cifs client does not do this (bundling multiple smb
    > > commands) conciously, I think tcp does club them together
    > > and if tcp is doing that, I do not know why and how to
    > > prevent it and if it can't be prevented, would be nice if
    > > samba server can tackle them.

    >
    > This sounds like a *very* weird bug in either the client
    > framing or XP. If the client does correct smb framing, i.e.
    > the 4-byte length header, Samba should really not have a
    > problem with it. And I very much doubt that XP has a bug
    > here.
    >
    > What client is that?
    >
    > Volker
    >
    >

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


  8. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Wed, Jun 04, 2008 at 03:28:31PM -0500, Shirish Pargaonkar wrote:
    > cifs.ko.
    > You mean 4-byte header FF 53 4D 42?
    > In another recreate, tcp frame has two smb requests,
    > close (0x4) and locking andx (0x24) each with this four byte header.


    Wait a second -- XP chokes on something that the Linux
    cifsfs sends??? How can you reproduce this?

    Volker

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (GNU/Linux)

    iD8DBQFIR4jiUzqjrWwMRl0RAkFIAJkBQEEdG23cp1NLqWvN1E beT+5MZwCfRVlu
    BBHbRul/XQ+fIIvEBuQSaUs=
    =/2HP
    -----END PGP SIGNATURE-----


  9. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Thu, Jun 5, 2008 at 1:34 AM, Volker Lendecke
    wrote:
    > On Wed, Jun 04, 2008 at 03:28:31PM -0500, Shirish Pargaonkar wrote:
    >> cifs.ko.
    >> You mean 4-byte header FF 53 4D 42?
    >> In another recreate, tcp frame has two smb requests,
    >> close (0x4) and locking andx (0x24) each with this four byte header.

    >
    > Wait a second -- XP chokes on something that the Linux
    > cifsfs sends??? How can you reproduce this?
    >
    > Volker
    >




    Mounted a share and ran this command

    fsstress -d /mnt -l 0 -n 1000 -p 10 -r

    I also took out the code in connect.c where it sets send and receive
    buffer sizes
    of a socket to 200K and 140K respectively (thus letting tcp auto-tuning take
    care of socket buffer sizes).

    if ((*csocket)->sk->sk_sndbuf < (200 * 1024))
    (*csocket)->sk->sk_sndbuf = 200 * 1024;
    if ((*csocket)->sk->sk_rcvbuf < (140 * 1024))
    (*csocket)->sk->sk_rcvbuf = 140 * 1024;

    You will start getting messages like server not responding and No
    response to/for cmd
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


  10. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Thu, Jun 05, 2008 at 07:29:49AM -0500, Shirish Pargaonkar wrote:
    > Mounted a share and ran this command
    >
    > fsstress -d /mnt -l 0 -n 1000 -p 10 -r


    google points at quite a few sites when asking it for
    "fsstress". What particular tool is that?

    And, this is definitely a cifsfs bug.

    Volker

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (GNU/Linux)

    iD8DBQFIR/DoUzqjrWwMRl0RAilWAJwLwPoJtNj/fTRQSwEfGG3Fmcv+iACglLqe
    OQ3LnH4C74/aw1fIyr7I5IA=
    =rbE9
    -----END PGP SIGNATURE-----


  11. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Thu, Jun 5, 2008 at 8:58 AM, Volker Lendecke
    wrote:
    > On Thu, Jun 05, 2008 at 07:29:49AM -0500, Shirish Pargaonkar wrote:
    >> Mounted a share and ran this command
    >>
    >> fsstress -d /mnt -l 0 -n 1000 -p 10 -r

    >
    > google points at quite a few sites when asking it for
    > "fsstress". What particular tool is that?
    >
    > And, this is definitely a cifsfs bug.
    >
    > Volker
    >


    I downloaded ltp-full-20080131.tgz few months back and built it and using
    network/nfs/nfs_fsstress/fsstress.

    I just recreated the problem a while ago against XP server, this time there were
    single commands per tcp packet. So I think the problem is server at some point
    just does not respond to cifs client in time (for whatever reasons)
    for cifs client to
    decide to reconnect declaring server not responding.

    I suspect the same for samba server. In case of samba server, I had turned on
    log level to 3 to see whether any messages are logged by samba server as to why
    it is not responding to cifs client smb requests but found nothing
    significant in the
    log file that was generated.
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


  12. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Thu, Jun 05, 2008 at 10:09:24AM -0500, Shirish Pargaonkar wrote:
    > I downloaded ltp-full-20080131.tgz few months back and
    > built it and using network/nfs/nfs_fsstress/fsstress.


    Ok, this might give Steve French something tasty for the
    weekend :-)

    > I just recreated the problem a while ago against XP
    > server, this time there were single commands per tcp
    > packet. So I think the problem is server at some point
    > just does not respond to cifs client in time (for whatever
    > reasons) for cifs client to decide to reconnect declaring
    > server not responding.


    The question is -- is theres still traffic going back and
    forth, or is everything stalled? If there's still traffic,
    it might be necessary to fix the timeout handling of the
    individual smb inside cifsfs to look at whether the server
    is alive vs an individual timeout. Much like what Windows
    does with the SMBecho requests.

    > I suspect the same for samba server. In case of samba
    > server, I had turned on log level to 3 to see whether any
    > messages are logged by samba server as to why it is not
    > responding to cifs client smb requests but found nothing
    > significant in the log file that was generated.


    A sniff of this might still be very valuable, even if it is
    huge.

    Volker

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (GNU/Linux)

    iD8DBQFISAUbUzqjrWwMRl0RAp/VAJ477eG1yUfjEoFwPj/tlxynREmdSQCfXq7z
    CI3kNFw0KLfRDDm2gAaVzck=
    =oFYz
    -----END PGP SIGNATURE-----


  13. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On 6/5/08, Volker Lendecke wrote:
    > On Thu, Jun 05, 2008 at 10:09:24AM -0500, Shirish Pargaonkar wrote:
    > > I downloaded ltp-full-20080131.tgz few months back and
    > > built it and using network/nfs/nfs_fsstress/fsstress.

    >
    > Ok, this might give Steve French something tasty for the
    > weekend :-)
    >
    > > I just recreated the problem a while ago against XP
    > > server, this time there were single commands per tcp
    > > packet. So I think the problem is server at some point
    > > just does not respond to cifs client in time (for whatever
    > > reasons) for cifs client to decide to reconnect declaring
    > > server not responding.

    >
    > The question is -- is theres still traffic going back and
    > forth, or is everything stalled? If there's still traffic,
    > it might be necessary to fix the timeout handling of the
    > individual smb inside cifsfs to look at whether the server
    > is alive vs an individual timeout. Much like what Windows
    > does with the SMBecho requests.
    >
    > > I suspect the same for samba server. In case of samba
    > > server, I had turned on log level to 3 to see whether any
    > > messages are logged by samba server as to why it is not
    > > responding to cifs client smb requests but found nothing
    > > significant in the log file that was generated.

    >
    > A sniff of this might still be very valuable, even if it is
    > huge.
    >
    > Volker
    >
    >


    I can't attach a 301MB samba server log file. Is there a way I can
    upload the file at some location?

    As far as cifs, it tries to send some commands but does not get a reply for
    a long time and times out, so everything is stalled.

    Regards,

    Shirish
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


  14. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Thu, Jun 05, 2008 at 01:09:15PM -0500, Shirish Pargaonkar wrote:

    > I can't attach a 301MB samba server log file. Is there a way I can
    > upload the file at some location?
    >
    > As far as cifs, it tries to send some commands but does not get a reply for
    > a long time and times out, so everything is stalled.


    Well, maybe 10MB before the reconnect, bzip2 -9 and you can
    send it directly to me :-)

    Volker

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (GNU/Linux)

    iD8DBQFISPsnUzqjrWwMRl0RAkTuAKCOTqKuWfpFTY1g+HDYN2 pH3NiALwCglrMb
    1m0DN13W9JunP1NwuRvals8=
    =1uLk
    -----END PGP SIGNATURE-----


  15. Re: [Samba] multiple smb commands (some non AndX) in one packet

    On Fri, Jun 6, 2008 at 1:54 AM, Volker Lendecke
    wrote:
    > Well, maybe 10MB before the reconnect, bzip2 -9 and you can
    > send it directly to me :-)


    rzip often compresses log files better than bzip2...
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba


+ Reply to Thread