cifs: protect updating server->dstaddr with a spinlock
Subsystems (2)
PATCH 1/1 cifs: protect updating server->dstaddr with a spinlock
We use a spinlock while we are reading and accessing the destination address for a server. We need to also use this spinlock to protect when we are modifying this adress from reconn_set_ipaddr().
--- fs/cifs/connect.c | 2 ++ 1 file changed, 2 insertions(+)
fs/cifs/connect.c +2 -0
@@ -375,8 +375,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server)return rc; } +spin_lock (&cifs_tcp_ses_lock); rc =cifs_convert_address ((struct sockaddr *)&server->dstaddr, ipaddr,strlen (ipaddr)); +spin_unlock (&cifs_tcp_ses_lock);kfree (ipaddr);return !rc ?-1 :0 ;
Signature · 1 line
2.13.6
Quoted 14 lines · Ronnie Sahlberg
We use a spinlock while we are reading and accessing the destination address for a server. We need to also use this spinlock to protect when we are modifying this adress from
reconn_set_ipaddr().Signed-off-by Ronnie Sahlberg <[email protected]>--- fs/cifs/connect.c | 2 ++ 1 file changed, 2 insertions(+)fs/cifs/connect.c +0
-0
fs/cifs/connect.c static int reconn_set_ipaddr(struct TCP_Server_Info *server) · line 384
Quoted 10 lines
fs/cifs/connect.c +2
-0@@ -375,8 +375,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server)return rc; } +spin_lock (&cifs_tcp_ses_lock); rc =cifs_convert_address ((struct sockaddr *)&server->dstaddr, ipaddr,strlen (ipaddr)); +spin_unlock (&cifs_tcp_ses_lock);kfree (ipaddr);return !rc ?-1 :0 ;
Steve French
Appliedmerged into cifs-2.6.git for-next
Quoted 28 lines · Ronnie Sahlberg
We use a spinlock while we are reading and accessing the destination address for a server. We need to also use this spinlock to protect when we are modifying this adress from
reconn_set_ipaddr().Signed-off-by Ronnie Sahlberg <[email protected]>--- fs/cifs/connect.c | 2 ++ 1 file changed, 2 insertions(+)fs/cifs/connect.c +2
-1@@ -375,8 +375,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server)return rc; } +spin_lock (&cifs_tcp_ses_lock); rc =cifs_convert_address ((struct sockaddr *)&server->dstaddr, ipaddr,strlen (ipaddr)); +spin_unlock (&cifs_tcp_ses_lock);kfree (ipaddr);return !rc ?-1 :0 ; --2.13.6
Signature · 3 lines
Thanks, Steve