mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
libceph: admit message frames only in CEPH_CON_S_OPEN state
Similar checks are performed for all control frames, but an early check for message frames was missing. process_message() is already set up to terminate the loop in case the state changes while con->ops->dispatch() handler is being executed. Cc: stable@vger.kernel.org Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Alex Markuze <amarkuze@redhat.com> Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
This commit is contained in:
@@ -2905,6 +2905,11 @@ static int __handle_control(struct ceph_connection *con, void *p)
|
||||
if (con->v2.in_desc.fd_tag != FRAME_TAG_MESSAGE)
|
||||
return process_control(con, p, end);
|
||||
|
||||
if (con->state != CEPH_CON_S_OPEN) {
|
||||
con->error_msg = "protocol error, unexpected message";
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = process_message_header(con, p, end);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user