diff options
author | Michael Halcrow <mhalcrow@us.ibm.com> | 2008-04-29 03:59:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:07 -0400 |
commit | 6a3fd92e73fffd9e583650c56ad9558afe51dc5c (patch) | |
tree | d65917432ffd0e6223dab3500819205433de22bd /fs/ecryptfs/ecryptfs_kernel.h | |
parent | f66e883eb6186bc43a79581b67aff7d1a69d0ff1 (diff) |
eCryptfs: make key module subsystem respect namespaces
Make eCryptfs key module subsystem respect namespaces.
Since I will be removing the netlink interface in a future patch, I just made
changes to the netlink.c code so that it will not break the build. With my
recent patches, the kernel module currently defaults to the device handle
interface rather than the netlink interface.
[akpm@linux-foundation.org: export free_user_ns()]
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/ecryptfs_kernel.h')
-rw-r--r-- | fs/ecryptfs/ecryptfs_kernel.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index 72e117706a68..951ee33a022d 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/namei.h> | 34 | #include <linux/namei.h> |
35 | #include <linux/scatterlist.h> | 35 | #include <linux/scatterlist.h> |
36 | #include <linux/hash.h> | 36 | #include <linux/hash.h> |
37 | #include <linux/nsproxy.h> | ||
37 | 38 | ||
38 | /* Version verification for shared data structures w/ userspace */ | 39 | /* Version verification for shared data structures w/ userspace */ |
39 | #define ECRYPTFS_VERSION_MAJOR 0x00 | 40 | #define ECRYPTFS_VERSION_MAJOR 0x00 |
@@ -410,8 +411,9 @@ struct ecryptfs_daemon { | |||
410 | #define ECRYPTFS_DAEMON_MISCDEV_OPEN 0x00000008 | 411 | #define ECRYPTFS_DAEMON_MISCDEV_OPEN 0x00000008 |
411 | u32 flags; | 412 | u32 flags; |
412 | u32 num_queued_msg_ctx; | 413 | u32 num_queued_msg_ctx; |
413 | pid_t pid; | 414 | struct pid *pid; |
414 | uid_t euid; | 415 | uid_t euid; |
416 | struct user_namespace *user_ns; | ||
415 | struct task_struct *task; | 417 | struct task_struct *task; |
416 | struct mutex mux; | 418 | struct mutex mux; |
417 | struct list_head msg_ctx_out_queue; | 419 | struct list_head msg_ctx_out_queue; |
@@ -610,10 +612,13 @@ int | |||
610 | ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, | 612 | ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, |
611 | size_t size, int flags); | 613 | size_t size, int flags); |
612 | int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode); | 614 | int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode); |
613 | int ecryptfs_process_helo(unsigned int transport, uid_t uid, pid_t pid); | 615 | int ecryptfs_process_helo(unsigned int transport, uid_t euid, |
614 | int ecryptfs_process_quit(uid_t uid, pid_t pid); | 616 | struct user_namespace *user_ns, struct pid *pid); |
615 | int ecryptfs_process_response(struct ecryptfs_message *msg, uid_t uid, | 617 | int ecryptfs_process_quit(uid_t euid, struct user_namespace *user_ns, |
616 | pid_t pid, u32 seq); | 618 | struct pid *pid); |
619 | int ecryptfs_process_response(struct ecryptfs_message *msg, uid_t euid, | ||
620 | struct user_namespace *user_ns, struct pid *pid, | ||
621 | u32 seq); | ||
617 | int ecryptfs_send_message(unsigned int transport, char *data, int data_len, | 622 | int ecryptfs_send_message(unsigned int transport, char *data, int data_len, |
618 | struct ecryptfs_msg_ctx **msg_ctx); | 623 | struct ecryptfs_msg_ctx **msg_ctx); |
619 | int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, | 624 | int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, |
@@ -623,13 +628,13 @@ void ecryptfs_release_messaging(unsigned int transport); | |||
623 | 628 | ||
624 | int ecryptfs_send_netlink(char *data, int data_len, | 629 | int ecryptfs_send_netlink(char *data, int data_len, |
625 | struct ecryptfs_msg_ctx *msg_ctx, u8 msg_type, | 630 | struct ecryptfs_msg_ctx *msg_ctx, u8 msg_type, |
626 | u16 msg_flags, pid_t daemon_pid); | 631 | u16 msg_flags, struct pid *daemon_pid); |
627 | int ecryptfs_init_netlink(void); | 632 | int ecryptfs_init_netlink(void); |
628 | void ecryptfs_release_netlink(void); | 633 | void ecryptfs_release_netlink(void); |
629 | 634 | ||
630 | int ecryptfs_send_connector(char *data, int data_len, | 635 | int ecryptfs_send_connector(char *data, int data_len, |
631 | struct ecryptfs_msg_ctx *msg_ctx, u8 msg_type, | 636 | struct ecryptfs_msg_ctx *msg_ctx, u8 msg_type, |
632 | u16 msg_flags, pid_t daemon_pid); | 637 | u16 msg_flags, struct pid *daemon_pid); |
633 | int ecryptfs_init_connector(void); | 638 | int ecryptfs_init_connector(void); |
634 | void ecryptfs_release_connector(void); | 639 | void ecryptfs_release_connector(void); |
635 | void | 640 | void |
@@ -672,7 +677,8 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs, | |||
672 | struct inode *ecryptfs_inode); | 677 | struct inode *ecryptfs_inode); |
673 | struct page *ecryptfs_get_locked_page(struct file *file, loff_t index); | 678 | struct page *ecryptfs_get_locked_page(struct file *file, loff_t index); |
674 | int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); | 679 | int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); |
675 | int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon, uid_t euid); | 680 | int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon, uid_t euid, |
681 | struct user_namespace *user_ns); | ||
676 | int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, | 682 | int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, |
677 | size_t *length_size); | 683 | size_t *length_size); |
678 | int ecryptfs_write_packet_length(char *dest, size_t size, | 684 | int ecryptfs_write_packet_length(char *dest, size_t size, |
@@ -684,6 +690,7 @@ int ecryptfs_send_miscdev(char *data, size_t data_size, | |||
684 | u16 msg_flags, struct ecryptfs_daemon *daemon); | 690 | u16 msg_flags, struct ecryptfs_daemon *daemon); |
685 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx); | 691 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx); |
686 | int | 692 | int |
687 | ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, uid_t euid, pid_t pid); | 693 | ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, uid_t euid, |
694 | struct user_namespace *user_ns, struct pid *pid); | ||
688 | 695 | ||
689 | #endif /* #ifndef ECRYPTFS_KERNEL_H */ | 696 | #endif /* #ifndef ECRYPTFS_KERNEL_H */ |