Individual written problems are to be done individually. Group
programming problems are to be done in your assigned programming
groups. The deadline for group programming problems applies to both
CVN and non-CVN students. All homework submissions are to be made via
the submit programs. Refer to the homework policy page on the
class web site for further details.
Programming problems are to be done in your assigned groups using the VM that has been assigned to your group. For all programming problems you will be required to submit source code, a README file documenting your files and code, and a test run of your programs. In addition, you should submit a cover sheet using either homework_work.txt or homework_nonwork.txt, depending on whether or not the programming assignment is completely working or not. For source code submissions, you only need to submit new source code files that you created and kernel source code files that you changed. You should clearly indicate your names, email addresses, and assigned group number on your submission. Each group is required to submit one writeup for the programming assignment.
The image of the kernel you build for this assignment should be vmlinuz.hmwk6. Grading for this assignment will be done based on vmlinuz.hmwk6. The kernel you use for this assignment should be the Linux 2.4.2 kernel you built and installed as part of Homework #2.
The standard Unix filesystem permission scheme is very crude. It breaks the entire world into three parts: a file's owner, a file's group, and everything else. Each one of these parts has three bits signifying whether they can read, write, or execute a specific file. A sample file listing would be something like:
rwx
at the beginning indicates that the owner of the
program vi
(root in this case) has the ability to read,
write and execute the file. The middle set of r-x
indicates that members of the owning group (also root) have the
ability to read and execute this file. The final r-x
indicates that any other users have the ability to read and execute
this file.
For this assignment, you are to implement a more flexible access control list scheme, where an additional set of permissions, for additional users and groups, are checked upon file access. This assignment will demonstrate Linux's filesystem behavior, show you how to access files from kernel-space, and teach you how to implement a commonly-used security method. Two references that you may find helpful are the Linux reference book for the course and and Chapter 9 of The Linux Kernel.
permission
should be some combination of the values 4 for
read, 2 for write, and 1 for execute. If the value of
mode
is 1, that signifies that id
is a user
id (a uid
). If the value of mode
is 2, that signifies
that id
represents a group id (a gid
).
mode
s of -1 and -2 specify that the identified user or
group are to be removed from the access-control list.
In order to make your changes persistent, the kernel is to save this infomation to a file named .acl within the directory in which your acl protected files reside. You can find out how to make system calls from kernel space in the article Making System Calls from Kernel Space.
Additional Notes:
Your solution only applies to files and not directories. All
directory access should occur through the default methods.
Note that a dentry list exists that consists of several different
pointers to one inode. Each dentry is a representation of that inode
in a different directory. It is important that you ignore this list
because 1) it is problematic code to begin with and 2) it is only
representative of directories that have been recently accessed - other
"dormant" directories might be excluded from this list.