Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a9cc9159281d44754f621f75d4efad0076b29db4
Commit:     a9cc9159281d44754f621f75d4efad0076b29db4
Parent:     ef58bccab7c7ef34451aa4ceea39545ef126b666
Author:     Al Viro <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 00:02:29 2008 -0500
Committer:  David Teigland <[EMAIL PROTECTED]>
CommitDate: Mon Feb 4 01:29:13 2008 -0600

    dlm: fix overflows when copying from ->m_extra to lvb
    
    Signed-off-by: Al Viro <[EMAIL PROTECTED]>
    Signed-off-by: David Teigland <[EMAIL PROTECTED]>
---
 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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to