Re: [PATCH 3 of 4] ima: Linux Security Module implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 20, 2005 at 09:43:34AM -0400, Reiner Sailer wrote:
> +/* security structure appended to inodes */
> +#define IMA_MAGIC 0x9999
> +struct ima_inode {
> +	unsigned short magic;
> +	atomic_t measure_count;	/* # processes currently using this file in measure-mode */
> +	ima_entry_flags dirty;
> +	char *file_name;	/* points to measure entry->fileName */
> +};
> +
> +/* security structure appended to measured files*/
> +struct ima_file {
> +	unsigned short magic;	/* identify our struct format */
> +	char is_measuring;	/* identify fds that are "measuring" */
> +};

magic values for structures protect you from nothing.  Do not use them.


> +static u32 decode_u32(u8 * buf)
> +{
> +	u32 val = buf[0];
> +	val = (val << 8) | (u8) buf[1];
> +	val = (val << 8) | (u8) buf[2];
> +	val = (val << 8) | (u8) buf[3];
> +	return val;
> +}
> +
> +static void encode_u32(u8 * buf, u32 val)
> +{
> +	buf[0] = (u8) val >> 24;
> +	buf[1] = (u8) val >> 16;
> +	buf[2] = (u8) val >> 8;
> +	buf[3] = (u8) val >> 0;
> +}

Hm, what's wrong with the standard kernel functions to do this kind of
thing?


> diff -uprN linux-2.6.12-rc4/security/ima/INSTALL linux-2.6.12-rc4-ima/security/ima/INSTALL
> --- linux-2.6.12-rc4/security/ima/INSTALL	1969-12-31 19:00:00.000000000 -0500
> +++ linux-2.6.12-rc4-ima/security/ima/INSTALL	2005-05-19 17:59:20.000000000 -0400

Kernel directories do not get a INSTALL file.  Stuff like that goes into
the Documentation/ directory.

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux