Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
52f21999
Commit
52f21999
authored
Mar 28, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ecryptfs: close rmmod race
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
de55eb1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
12 deletions
+2
-12
fs/ecryptfs/miscdev.c
fs/ecryptfs/miscdev.c
+2
-12
No files found.
fs/ecryptfs/miscdev.c
View file @
52f21999
...
@@ -80,13 +80,6 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file)
...
@@ -80,13 +80,6 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file)
int
rc
;
int
rc
;
mutex_lock
(
&
ecryptfs_daemon_hash_mux
);
mutex_lock
(
&
ecryptfs_daemon_hash_mux
);
rc
=
try_module_get
(
THIS_MODULE
);
if
(
rc
==
0
)
{
rc
=
-
EIO
;
printk
(
KERN_ERR
"%s: Error attempting to increment module use "
"count; rc = [%d]
\n
"
,
__func__
,
rc
);
goto
out_unlock_daemon_list
;
}
rc
=
ecryptfs_find_daemon_by_euid
(
&
daemon
);
rc
=
ecryptfs_find_daemon_by_euid
(
&
daemon
);
if
(
!
rc
)
{
if
(
!
rc
)
{
rc
=
-
EINVAL
;
rc
=
-
EINVAL
;
...
@@ -96,7 +89,7 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file)
...
@@ -96,7 +89,7 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file)
if
(
rc
)
{
if
(
rc
)
{
printk
(
KERN_ERR
"%s: Error attempting to spawn daemon; "
printk
(
KERN_ERR
"%s: Error attempting to spawn daemon; "
"rc = [%d]
\n
"
,
__func__
,
rc
);
"rc = [%d]
\n
"
,
__func__
,
rc
);
goto
out_
module_put_
unlock_daemon_list
;
goto
out_unlock_daemon_list
;
}
}
mutex_lock
(
&
daemon
->
mux
);
mutex_lock
(
&
daemon
->
mux
);
if
(
daemon
->
flags
&
ECRYPTFS_DAEMON_MISCDEV_OPEN
)
{
if
(
daemon
->
flags
&
ECRYPTFS_DAEMON_MISCDEV_OPEN
)
{
...
@@ -108,9 +101,6 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file)
...
@@ -108,9 +101,6 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file)
atomic_inc
(
&
ecryptfs_num_miscdev_opens
);
atomic_inc
(
&
ecryptfs_num_miscdev_opens
);
out_unlock_daemon:
out_unlock_daemon:
mutex_unlock
(
&
daemon
->
mux
);
mutex_unlock
(
&
daemon
->
mux
);
out_module_put_unlock_daemon_list:
if
(
rc
)
module_put
(
THIS_MODULE
);
out_unlock_daemon_list:
out_unlock_daemon_list:
mutex_unlock
(
&
ecryptfs_daemon_hash_mux
);
mutex_unlock
(
&
ecryptfs_daemon_hash_mux
);
return
rc
;
return
rc
;
...
@@ -147,7 +137,6 @@ ecryptfs_miscdev_release(struct inode *inode, struct file *file)
...
@@ -147,7 +137,6 @@ ecryptfs_miscdev_release(struct inode *inode, struct file *file)
"bug.
\n
"
,
__func__
,
rc
);
"bug.
\n
"
,
__func__
,
rc
);
BUG
();
BUG
();
}
}
module_put
(
THIS_MODULE
);
return
rc
;
return
rc
;
}
}
...
@@ -471,6 +460,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
...
@@ -471,6 +460,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
static
const
struct
file_operations
ecryptfs_miscdev_fops
=
{
static
const
struct
file_operations
ecryptfs_miscdev_fops
=
{
.
owner
=
THIS_MODULE
,
.
open
=
ecryptfs_miscdev_open
,
.
open
=
ecryptfs_miscdev_open
,
.
poll
=
ecryptfs_miscdev_poll
,
.
poll
=
ecryptfs_miscdev_poll
,
.
read
=
ecryptfs_miscdev_read
,
.
read
=
ecryptfs_miscdev_read
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment