lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1588044545-59405-1-git-send-email-wubo40@huawei.com>
Date:   Tue, 28 Apr 2020 11:29:05 +0800
From:   Wu Bo <wubo40@...wei.com>
To:     <rpeterso@...hat.com>, <agruenba@...hat.com>
CC:     <cluster-devel@...hat.com>, <linux-kernel@...r.kernel.org>,
        <liuzhiqiang26@...wei.com>, <linfeilong@...wei.com>,
        <wubo40@...wei.com>
Subject: [PATCH] fs/gfs2:lock a spinlock always before returning from do_xmote()

The call stack is as follows:
finish_xmote()
        ...
        spin_lock(&gl->gl_lockref.lock);
        ...
	--> do_xmote()
            spin_unlock(&gl->gl_lockref.lock);
            ...
            return;
        ...
        spin_unlock(&gl->gl_lockref.lock);
           
do_xmote function needs to be locked before returning,
Otherwise, there will be a double release lock in finish_xmote() function.

Signed-off-by: Wu Bo <wubo40@...wei.com>
---
 fs/gfs2/glock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 29f9b66..7129d10 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -613,6 +613,7 @@ static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int
 				fs_err(sdp, "Error %d syncing glock \n", ret);
 				gfs2_dump_glock(NULL, gl, true);
 			}
+			spin_lock(&gl->gl_lockref.lock);
 			return;
 		}
 	}
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ