Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
1fdaf71d
Commit
1fdaf71d
authored
Sep 15, 2009
by
Stephen Rothwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'ecryptfs/next'
parents
7c9498e3
55deb64a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
17 deletions
+15
-17
fs/ecryptfs/Kconfig
fs/ecryptfs/Kconfig
+3
-1
fs/ecryptfs/crypto.c
fs/ecryptfs/crypto.c
+8
-7
fs/ecryptfs/keystore.c
fs/ecryptfs/keystore.c
+4
-7
fs/ecryptfs/super.c
fs/ecryptfs/super.c
+0
-2
No files found.
fs/ecryptfs/Kconfig
View file @
1fdaf71d
config ECRYPT_FS
tristate "eCrypt filesystem layer support (EXPERIMENTAL)"
depends on EXPERIMENTAL && KEYS && CRYPTO && NET
depends on EXPERIMENTAL && KEYS && NET
select CRYPTO_ECB
select CRYPTO_CBC
help
Encrypted filesystem that operates on the VFS layer. See
<file:Documentation/filesystems/ecryptfs.txt> to learn more about
...
...
fs/ecryptfs/crypto.c
View file @
1fdaf71d
...
...
@@ -245,13 +245,11 @@ void ecryptfs_destroy_crypt_stat(struct ecryptfs_crypt_stat *crypt_stat)
crypto_free_blkcipher
(
crypt_stat
->
tfm
);
if
(
crypt_stat
->
hash_tfm
)
crypto_free_hash
(
crypt_stat
->
hash_tfm
);
mutex_lock
(
&
crypt_stat
->
keysig_list_mutex
);
list_for_each_entry_safe
(
key_sig
,
key_sig_tmp
,
&
crypt_stat
->
keysig_list
,
crypt_stat_list
)
{
list_del
(
&
key_sig
->
crypt_stat_list
);
kmem_cache_free
(
ecryptfs_key_sig_cache
,
key_sig
);
}
mutex_unlock
(
&
crypt_stat
->
keysig_list_mutex
);
memset
(
crypt_stat
,
0
,
sizeof
(
struct
ecryptfs_crypt_stat
));
}
...
...
@@ -925,7 +923,9 @@ static int ecryptfs_copy_mount_wide_sigs_to_inode_sigs(
struct
ecryptfs_global_auth_tok
*
global_auth_tok
;
int
rc
=
0
;
mutex_lock
(
&
crypt_stat
->
keysig_list_mutex
);
mutex_lock
(
&
mount_crypt_stat
->
global_auth_tok_list_mutex
);
list_for_each_entry
(
global_auth_tok
,
&
mount_crypt_stat
->
global_auth_tok_list
,
mount_crypt_stat_list
)
{
...
...
@@ -934,13 +934,13 @@ static int ecryptfs_copy_mount_wide_sigs_to_inode_sigs(
rc
=
ecryptfs_add_keysig
(
crypt_stat
,
global_auth_tok
->
sig
);
if
(
rc
)
{
printk
(
KERN_ERR
"Error adding keysig; rc = [%d]
\n
"
,
rc
);
mutex_unlock
(
&
mount_crypt_stat
->
global_auth_tok_list_mutex
);
goto
out
;
}
}
mutex_unlock
(
&
mount_crypt_stat
->
global_auth_tok_list_mutex
);
out:
mutex_unlock
(
&
mount_crypt_stat
->
global_auth_tok_list_mutex
);
mutex_unlock
(
&
crypt_stat
->
keysig_list_mutex
);
return
rc
;
}
...
...
@@ -1763,7 +1763,7 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
if
(
IS_ERR
(
*
key_tfm
))
{
rc
=
PTR_ERR
(
*
key_tfm
);
printk
(
KERN_ERR
"Unable to allocate crypto cipher with name "
"[%s]; rc = [%d]
\n
"
,
cipher
_name
,
rc
);
"[%s]; rc = [%d]
\n
"
,
full_alg
_name
,
rc
);
goto
out
;
}
crypto_blkcipher_set_flags
(
*
key_tfm
,
CRYPTO_TFM_REQ_WEAK_KEY
);
...
...
@@ -1776,7 +1776,8 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
rc
=
crypto_blkcipher_setkey
(
*
key_tfm
,
dummy_key
,
*
key_size
);
if
(
rc
)
{
printk
(
KERN_ERR
"Error attempting to set key of size [%zd] for "
"cipher [%s]; rc = [%d]
\n
"
,
*
key_size
,
cipher_name
,
rc
);
"cipher [%s]; rc = [%d]
\n
"
,
*
key_size
,
full_alg_name
,
rc
);
rc
=
-
EINVAL
;
goto
out
;
}
...
...
fs/ecryptfs/keystore.c
View file @
1fdaf71d
...
...
@@ -2366,21 +2366,18 @@ struct kmem_cache *ecryptfs_key_sig_cache;
int
ecryptfs_add_keysig
(
struct
ecryptfs_crypt_stat
*
crypt_stat
,
char
*
sig
)
{
struct
ecryptfs_key_sig
*
new_key_sig
;
int
rc
=
0
;
new_key_sig
=
kmem_cache_alloc
(
ecryptfs_key_sig_cache
,
GFP_KERNEL
);
if
(
!
new_key_sig
)
{
rc
=
-
ENOMEM
;
printk
(
KERN_ERR
"Error allocating from ecryptfs_key_sig_cache
\n
"
);
goto
out
;
return
-
ENOMEM
;
}
memcpy
(
new_key_sig
->
keysig
,
sig
,
ECRYPTFS_SIG_SIZE_HEX
);
mutex_lock
(
&
crypt_stat
->
keysig_list_mutex
);
/* Caller must hold keysig_list_mutex */
list_add
(
&
new_key_sig
->
crypt_stat_list
,
&
crypt_stat
->
keysig_list
);
mutex_unlock
(
&
crypt_stat
->
keysig_list_mutex
);
out:
return
rc
;
return
0
;
}
struct
kmem_cache
*
ecryptfs_global_auth_tok_cache
;
...
...
fs/ecryptfs/super.c
View file @
1fdaf71d
...
...
@@ -77,7 +77,6 @@ static void ecryptfs_destroy_inode(struct inode *inode)
struct
ecryptfs_inode_info
*
inode_info
;
inode_info
=
ecryptfs_inode_to_private
(
inode
);
mutex_lock
(
&
inode_info
->
lower_file_mutex
);
if
(
inode_info
->
lower_file
)
{
struct
dentry
*
lower_dentry
=
inode_info
->
lower_file
->
f_dentry
;
...
...
@@ -89,7 +88,6 @@ static void ecryptfs_destroy_inode(struct inode *inode)
d_drop
(
lower_dentry
);
}
}
mutex_unlock
(
&
inode_info
->
lower_file_mutex
);
ecryptfs_destroy_crypt_stat
(
&
inode_info
->
crypt_stat
);
kmem_cache_free
(
ecryptfs_inode_info_cache
,
inode_info
);
}
...
...
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