Skip to content

Commit a43a5cc

Browse files
jbeulichkonradwilk
authored andcommitted
xenbus_dev: add missing error check to watch handling
So far only the watch path was checked to be zero terminated, while the watch token was merely assumed to be. Signed-off-by: Jan Beulich <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
1 parent e4de866 commit a43a5cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/xen/xenbus/xenbus_dev_frontend.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)
369369
goto out;
370370
}
371371
token++;
372+
if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) {
373+
rc = -EILSEQ;
374+
goto out;
375+
}
372376

373377
if (msg_type == XS_WATCH) {
374378
watch = alloc_watch_adapter(path, token);

0 commit comments

Comments
 (0)