From: Chandradhar Kumar <chandradhar.2003@gmail.com>
To: Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org
Cc: Chandradhar Kumar <chandradhar.2003@gmail.com>,
syzbot+693652ded53d3eb9cb91@syzkaller.appspotmail.com,
Greg Kroah-Hartman <gregkh@google.com>
Subject: [PATCH] greybus: operation: fix OOB Read in gb_svc_request_handler
Date: Fri, 6 Nov 2026 15:13:00 +0530 [thread overview]
Message-ID: <20261106094303.55158-1-chandradhar.2003@gmail.com> (raw)
gb_connection_recv() verifies that the received buffer length is at
least sizeof(header) and size >= msg_size but it does not check the
msg_size (from header.size) which can be less than sizeof(header),
that can cause an out-of-bound Read in gb_svc_request_handler().
Check msg_size < sizeof(header) before proceeding with header type.
Fixes: 564c72b1c6f7 ("greybus: operation: fix unaligned memory accesses in receive path")
Reported-by: syzbot+693652ded53d3eb9cb91@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=693652ded53d3eb9cb91
Signed-off-by: Chandradhar Kumar <chandradhar.2003@gmail.com>
---
drivers/greybus/operation.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/greybus/operation.c b/drivers/greybus/operation.c
index 7e12ffb2dd60..9afe97731ad8 100644
--- a/drivers/greybus/operation.c
+++ b/drivers/greybus/operation.c
@@ -1056,6 +1056,12 @@ void gb_connection_recv(struct gb_connection *connection,
return; /* XXX Should still complete operation */
}
+ if (msg_size < sizeof(header)) {
+ dev_err_ratelimited(dev, "%s: header size is too short\n",
+ connection->name);
+ return;
+ }
+
if (header.type & GB_MESSAGE_TYPE_RESPONSE) {
gb_connection_recv_response(connection, &header, data,
msg_size);
--
2.56.0
reply other threads:[~2026-11-06 9:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261106094303.55158-1-chandradhar.2003@gmail.com \
--to=chandradhar.2003@gmail.com \
--cc=elder@kernel.org \
--cc=gregkh@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+693652ded53d3eb9cb91@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®