LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 11/16] dlm: fix overflows when copying from ->m_extra to lvb
@ 2008-02-07 6:09 David Teigland
0 siblings, 0 replies; only message in thread
From: David Teigland @ 2008-02-07 6:09 UTC (permalink / raw)
To: linux-kernel; +Cc: Al Viro
From: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Teigland <teigland@redhat.com>
---
fs/dlm/lock.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 6d98cf9..5b82187 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -1226,6 +1226,8 @@ static void set_lvb_lock_pc(struct dlm_rsb *r, struct dlm_lkb *lkb,
b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1];
if (b == 1) {
int len = receive_extralen(ms);
+ if (len > DLM_RESNAME_MAXLEN)
+ len = DLM_RESNAME_MAXLEN;
memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
lkb->lkb_lvbseq = ms->m_lvbseq;
}
@@ -2993,6 +2995,8 @@ static int receive_lvb(struct dlm_ls *ls, struct dlm_lkb *lkb,
if (!lkb->lkb_lvbptr)
return -ENOMEM;
len = receive_extralen(ms);
+ if (len > DLM_RESNAME_MAXLEN)
+ len = DLM_RESNAME_MAXLEN;
memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
}
return 0;
--
1.5.3.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-07 6:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-07 6:09 [PATCH 11/16] dlm: fix overflows when copying from ->m_extra to lvb David Teigland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).