A signal can interrupt a SendReceive call which result in incoming
responses to the call being ignored. This is a problem for calls such as
open which results in the successful response being ignored. This
results in an open file resource on the server.
The patch looks into responses which were cancelled after being sent and
in case of successful open closes the open fids.
For this patch, the check is only done in SendReceive2()
RH-bz: 1403319
Signed-off-by: Sachin Prabhu <email address hidden>
Reviewed-by: Pavel Shilovsky <email address hidden>
Cc: Stable <email address hidden>
(cherry-picked from commit 38bd49064a1ecb67baad33598e3d824448ab11ec)
Signed-off-by: Thadeu Lima de Souza Cascardo <email address hidden>
Signed-off-by: Thadeu Lima de Souza Cascardo <email address hidden>
8c98c5d...
by
Sachin Prabhu <email address hidden>
Call echo service immediately after socket reconnect
Commit 4fcd1813e640 ("Fix reconnect to not defer smb3 session reconnect
long after socket reconnect") changes the behaviour of the SMB2 echo
service and causes it to renegotiate after a socket reconnect. However
under default settings, the echo service could take up to 120 seconds to
be scheduled.
The patch forces the echo service to be called immediately resulting a
negotiate call being made immediately on reconnect.
Signed-off-by: Sachin Prabhu <email address hidden>
Reviewed-by: Pavel Shilovsky <email address hidden>
Signed-off-by: Steve French <email address hidden>
(cherry picked from commit b8c600120fc87d53642476f48c8055b38d6e14c7)
Signed-off-by: Thadeu Lima de Souza Cascardo <email address hidden>
The recent changes that added SMB3 encryption support introduced
a possible use after free in the demultiplex thread. When we
process an encrypted packed we obtain a pointer to SMB session
but do not obtain a reference. This can possibly lead to a situation
when this session was freed before we copy a decryption key from
there. Fix this by obtaining a copy of the key rather than a pointer
to the session under a spinlock.
Signed-off-by: Pavel Shilovsky <email address hidden>
Signed-off-by: Steve French <email address hidden>
(cherry picked from commit 61cfac6f267dabcf2740a7ec8a0295833b28b5f5)
Signed-off-by: Joseph Salisbury <email address hidden>
This allows users to inforce encryption for SMB3 shares if a server
supports it.
Signed-off-by: Pavel Shilovsky <email address hidden>
(backport from commit ae6f8dd4d0c87bfb72da9d9b56342adf53e69c31)
Signed-off-by: Joseph Salisbury <email address hidden>
[cascardo: fixup of conflict with 06e7bc1427cfb2fe4d2ac84305afb79dbb0b42f3]
Signed-off-by: Thadeu Lima de Souza Cascardo <email address hidden>
Allow to decrypt transformed packets that are bigger than the big
buffer size. In particular it is used for read responses that can
only exceed the big buffer size.
Signed-off-by: Pavel Shilovsky <email address hidden>
(cherry picked from commit c42a6abe3012832a68a371dabe17c2ced97e62ad)
Signed-off-by: Joseph Salisbury <email address hidden>
Since we have two different types of reads (pagecache and direct)
we need to process such responses differently after decryption of
a packet. The change allows to specify a callback that copies a read
payload data into preallocated pages.
Signed-off-by: Pavel Shilovsky <email address hidden>
(cherry picked from commit d70b9104b1ca586f73aaf59426756cec3325a40e)
Signed-off-by: Joseph Salisbury <email address hidden>
We need to process read responses differently because the data
should go directly into preallocated pages. This can be done
by specifying a mid handle callback.
Signed-off-by: Pavel Shilovsky <email address hidden>
(cherry picked from commit 9b7c18a2d4b798963ea80f6769701dcc4c24b55e)
Signed-off-by: Joseph Salisbury <email address hidden>