Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84886
b: refs/heads/master
c: 02ed16b
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and David Teigland committed Feb 4, 2008
1 parent 5b5a021 commit 9a4b293
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4007685c6e6b5c92a07f27cd754bcca394168af2
refs/heads/master: 02ed16b64dc5b7a4f78476bdb64da9bbf88d84b3
7 changes: 7 additions & 0 deletions trunk/fs/dlm/rcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static void make_config(struct dlm_ls *ls, struct rcom_config *rf)
static int check_config(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
{
struct rcom_config *rf = (struct rcom_config *) rc->rc_buf;
size_t conf_size = sizeof(struct dlm_rcom) + sizeof(struct rcom_config);

if ((rc->rc_header.h_version & 0xFFFF0000) != DLM_HEADER_MAJOR) {
log_error(ls, "version mismatch: %x nodeid %d: %x",
Expand All @@ -93,6 +94,12 @@ static int check_config(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
return -EPROTO;
}

if (rc->rc_header.h_length < conf_size) {
log_error(ls, "config too short: %d nodeid %d",
rc->rc_header.h_length, nodeid);
return -EPROTO;
}

if (le32_to_cpu(rf->rf_lvblen) != ls->ls_lvblen ||
le32_to_cpu(rf->rf_lsflags) != ls->ls_exflags) {
log_error(ls, "config mismatch: %d,%x nodeid %d: %d,%x",
Expand Down

0 comments on commit 9a4b293

Please sign in to comment.