Wengang Wang
2010-Jun-30 12:23 UTC
[Ocfs2-devel] [PATCH] ocfs2/dlm: don't access beyond bitmap size
dlm->recovery_map is defined as unsigned long recovery_map[BITS_TO_LONGS(O2NM_MAX_NODES)]; We should treat O2NM_MAX_NODES as the bit map size in bits. This patches fixes a bit operation that takes O2NM_MAX_NODES + 1 as bitmap size. Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com> --- fs/ocfs2/dlm/dlmrecovery.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index f8b75ce..9dfaac7 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -463,7 +463,7 @@ static int dlm_do_recovery(struct dlm_ctxt *dlm) if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) { int bit; - bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES+1, 0); + bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES, 0); if (bit >= O2NM_MAX_NODES || bit < 0) dlm_set_reco_dead_node(dlm, O2NM_INVALID_NODE_NUM); else -- 1.6.6.1
Sunil Mushran
2010-Jun-30 16:52 UTC
[Ocfs2-devel] [PATCH] ocfs2/dlm: don't access beyond bitmap size
Signed-off-by: Sunil Mushran<sunil.mushran at oracle.com> On 06/30/2010 05:23 AM, Wengang Wang wrote:> dlm->recovery_map is defined as > unsigned long recovery_map[BITS_TO_LONGS(O2NM_MAX_NODES)]; > > We should treat O2NM_MAX_NODES as the bit map size in bits. > This patches fixes a bit operation that takes O2NM_MAX_NODES + 1 as bitmap size. > > Signed-off-by: Wengang Wang<wen.gang.wang at oracle.com> > --- > fs/ocfs2/dlm/dlmrecovery.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c > index f8b75ce..9dfaac7 100644 > --- a/fs/ocfs2/dlm/dlmrecovery.c > +++ b/fs/ocfs2/dlm/dlmrecovery.c > @@ -463,7 +463,7 @@ static int dlm_do_recovery(struct dlm_ctxt *dlm) > if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) { > int bit; > > - bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES+1, 0); > + bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES, 0); > if (bit>= O2NM_MAX_NODES || bit< 0) > dlm_set_reco_dead_node(dlm, O2NM_INVALID_NODE_NUM); > else >
Joel Becker
2010-Jul-12 18:32 UTC
[Ocfs2-devel] [PATCH] ocfs2/dlm: don't access beyond bitmap size
On Wed, Jun 30, 2010 at 08:23:30PM +0800, Wengang Wang wrote:> dlm->recovery_map is defined as > unsigned long recovery_map[BITS_TO_LONGS(O2NM_MAX_NODES)]; > > We should treat O2NM_MAX_NODES as the bit map size in bits. > This patches fixes a bit operation that takes O2NM_MAX_NODES + 1 as bitmap size. > > Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com>This patch is now in the 'fixes' branch of ocfs2.git. Joel -- The zen have a saying: "When you learn how to listen, ANYONE can be your teacher." Joel Becker Consulting Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127