Re: [PATCH] Process Attribute API for Security Modules 2.5.69

From: Andrew Morton (akpmat_private)
Date: Tue May 06 2003 - 14:01:04 PDT

  • Next message: viroat_private: "Re: [PATCH] Process Attribute API for Security Modules 2.5.69"

    Stephen Smalley <sdsat_private> wrote:
    >
    > This patch against 2.5.69 implements a process attribute API for
    > security modules via a set of nodes in a /proc/pid/attr directory.
    
    Just a few triviata:
    
    > +static int proc_attr_readdir(struct file * filp,
    
    Can all this be inside CONFIG_SOMETHING?  It's quite a lot of code.
    
    > +	switch (i) {
    > +		case 0:
    
    We often line the `case' up with the `switch' to save a tabstop.
    
    > +			if (i>=sizeof(attr_stuff)/sizeof(attr_stuff[0])) {
    
    The ARRAY_SIZE macro does this.
    
    > +static ssize_t proc_pid_attr_read(struct file * file, char * buf,
    > +				  size_t count, loff_t *ppos)
    > +{
    > ...
    > +	copy_to_user(buf, (char *) page + *ppos, count);
    
    Need to check the return value here, return a short read if something was
    copied, else -EFAULT.  Or just EFAULT.
    
    
    _______________________________________________
    linux-security-module mailing list
    linux-security-moduleat_private
    http://mail.wirex.com/mailman/listinfo/linux-security-module
    



    This archive was generated by hypermail 2b30 : Tue May 06 2003 - 14:07:52 PDT