Skip to content

Commit

Permalink
xenbus_dev: add missing error check to watch handling
Browse files Browse the repository at this point in the history
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 <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Jan Beulich authored and Konrad Rzeszutek Wilk committed Feb 3, 2012
1 parent e4de866 commit a43a5cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/xen/xenbus/xenbus_dev_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)
goto out;
}
token++;
if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) {
rc = -EILSEQ;
goto out;
}

if (msg_type == XS_WATCH) {
watch = alloc_watch_adapter(path, token);
Expand Down

0 comments on commit a43a5cc

Please sign in to comment.