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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3733972.1659460456@warthog.procyon.org.uk>
Date:   Tue, 02 Aug 2022 18:14:16 +0100
From:   David Howells <dhowells@...hat.com>
To:     Marc Dionne <marc.dionne@...istor.com>
Cc:     dhowells@...hat.com, linux-afs@...ts.infradead.org,
        linux-fsdevel@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] afs: Fix access after dec in put functions

Marc Dionne <marc.dionne@...istor.com> wrote:

> > -       trace_afs_server(server, r - 1, atomic_read(&server->active), reason);
> > +       trace_afs_server(server->debug_id, r - 1, a, reason);
> 
> Don't you also want to copy server->debug_id into a local variable here?

Okay, how about the attached change?

David
---
diff --git a/fs/afs/server.c b/fs/afs/server.c
index bca4b4c55c14..4981baf97835 100644
--- a/fs/afs/server.c
+++ b/fs/afs/server.c
@@ -399,7 +399,7 @@ struct afs_server *afs_use_server(struct afs_server *server, enum afs_server_tra
 void afs_put_server(struct afs_net *net, struct afs_server *server,
 		    enum afs_server_trace reason)
 {
-	unsigned int a;
+	unsigned int a, debug_id = server->debug_id;
 	bool zero;
 	int r;
 
@@ -408,7 +408,7 @@ void afs_put_server(struct afs_net *net, struct afs_server *server,
 
 	a = atomic_inc_return(&server->active);
 	zero = __refcount_dec_and_test(&server->ref, &r);
-	trace_afs_server(server->debug_id, r - 1, a, reason);
+	trace_afs_server(debug_id, r - 1, a, reason);
 	if (unlikely(zero))
 		__afs_put_server(net, server);
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ