Editing
Loop Device
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Setting up the host environment == I expect here, you know how to set up a running linux vserver environment. If not, consult other manuals and HOWTO's. Just patch and configure your vserver kernel as usual. Ensure that you chose to activate loopback devices (CONFIG_BLK_DEV_LOOP). If you plan to use loop-AES deactivate CONFIG_BLK_DEV_LOOP, or build it as module. Therefore you'll need some additional patches to get this feature running inside vserver guests. Depending on your configuration you have to use more or less additional patches. Just answer the following questions: === Do you use kernel 2.6.16 or older === Yes: Apply this patch: http://lkml.org/lkml/2006/3/24/370 === Do you use vserver 2.1.1-rc14 or older? === Yes: Apply this patches: <pre> diff -NurpP linux-2.6.16-vs2.1.1-rc14.3/kernel/fork.c linux-2.6.16-vs2.1.1-rc14.4/kernel/fork.c --- linux-2.6.16-vs2.1.1-rc14.3/kernel/fork.c 2006-03-20 18:09:05 +0100 +++ linux-2.6.16-vs2.1.1-rc14.4/kernel/fork.c 2006-03-25 02:22:55 +0100 @@ -1348,6 +1348,7 @@ long do_fork(unsigned long clone_flags, if ((clone_flags & CLONE_KTHREAD) && !vx_check(0, VX_ADMIN)) { vxwprintk(1, "xid=%d tried to spawn a kernel thread.", vx_current_xid()); + free_pidmap(pid); return -EPERM; } </pre> and <pre> diff -NurpP --minimal linux-2.6.16-vs2.1.1-rc14.1/drivers/block/loop.c linux-2.6.16-vs2.1.1-rc14.2/drivers/block/loop.c --- linux-2.6.16-vs2.1.1-rc14.1/drivers/block/loop.c 2006-03-20 17:32:31 +0100 +++ linux-2.6.16-vs2.1.1-rc14.2/drivers/block/loop.c 2006-03-24 03:37:07 +0100 @@ -943,7 +943,7 @@ loop_set_status(struct loop_device *lo, struct loop_func_table *xfer; if (lo->lo_encrypt_key_size && lo->lo_key_owner != current->uid && - !capable(CAP_SYS_ADMIN)) + !capable(CAP_SYS_ADMIN) && !vx_ccaps(VXC_CRYPTO_LOOP)) return -EPERM; if (lo->lo_state != Lo_bound) return -ENXIO; @@ -1023,7 +1023,8 @@ loop_get_status(struct loop_device *lo, memcpy(info->lo_crypt_name, lo->lo_crypt_name, LO_NAME_SIZE); info->lo_encrypt_type = lo->lo_encryption ? lo->lo_encryption->number : 0; - if (lo->lo_encrypt_key_size && capable(CAP_SYS_ADMIN)) { + if (lo->lo_encrypt_key_size && + (capable(CAP_SYS_ADMIN) || vx_ccaps(VXC_CRYPTO_LOOP))) { info->lo_encrypt_key_size = lo->lo_encrypt_key_size; memcpy(info->lo_encrypt_key, lo->lo_encrypt_key, lo->lo_encrypt_key_size); diff -NurpP --minimal linux-2.6.16-vs2.1.1-rc14.1/include/linux/vserver/context.h linux-2.6.16-vs2.1.1-rc14.2/include/linux/vserver/context.h --- linux-2.6.16-vs2.1.1-rc14.1/include/linux/vserver/context.h 2006-03-20 18:09:05 +0100 +++ linux-2.6.16-vs2.1.1-rc14.2/include/linux/vserver/context.h 2006-03-24 03:35:26 +0100 @@ -76,6 +76,7 @@ #define VXC_BINARY_MOUNT 0x00040000 #define VXC_QUOTA_CTL 0x00100000 +#define VXC_CRYPTO_LOOP 0x00200000 /* context state changes */ </pre> Once this patches are commited to your kernel source, (re)compile and boot it. === change capabilities files === You have to make some changes in the capabilities files too. If they don't exist already, just create them. Usually they can be found under <tt>/etc/vservers/<guest name>/bcapabilities</tt> and <tt>/etc/vservers/<guest name>/ccapabilities. </tt> ==== ccapabilities ==== ^21 secure_mount secure_remount ^21 is VXC_CRYPTO_LOOP, but as of version 0.30.210 the util-vserver don't recognize this flag (yet). ==== bcapabilities ==== CAP_IPC_LOCK
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information