diff options
| author | Ilya Dryomov <idryomov@gmail.com> | 2026-03-08 17:57:23 +0100 |
|---|---|---|
| committer | Ilya Dryomov <idryomov@gmail.com> | 2026-03-10 12:15:46 +0100 |
| commit | a5a373705081d7cc6363e16990e2361b0b362314 (patch) | |
| tree | deb86409b509cee83537cf97ea601e1bed6045f6 /net | |
| parent | 69fb5d91bba44ecf7eb80530b85fa4fb028921d5 (diff) | |
| download | linux-next-a5a373705081d7cc6363e16990e2361b0b362314.tar.gz linux-next-a5a373705081d7cc6363e16990e2361b0b362314.zip | |
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>
Diffstat (limited to 'net')
| -rw-r--r-- | net/ceph/messenger_v2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ceph/messenger_v2.c b/net/ceph/messenger_v2.c index ed618435d33a..c4ddf7911f7d 100644 --- a/net/ceph/messenger_v2.c +++ b/net/ceph/messenger_v2.c @@ -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; |
