Skip to content

Commit b096d97

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: block asynchronous requests when making a delay on session setup
ksmbd make a delay of 5 seconds on session setup to avoid dictionary attacks. But the 5 seconds delay can be bypassed by using asynchronous requests. This patch block all requests on current connection when making a delay on sesstion setup failure. Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-20482 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent ea174a9 commit b096d97

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/ksmbd/smb2pdu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,8 +1840,11 @@ int smb2_sess_setup(struct ksmbd_work *work)
18401840

18411841
sess->last_active = jiffies;
18421842
sess->state = SMB2_SESSION_EXPIRED;
1843-
if (try_delay)
1843+
if (try_delay) {
1844+
ksmbd_conn_set_need_reconnect(conn);
18441845
ssleep(5);
1846+
ksmbd_conn_set_need_negotiate(conn);
1847+
}
18451848
}
18461849
}
18471850

0 commit comments

Comments
 (0)