lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 15 Mar 2010 10:22:41 -0700
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	Ossama Othman <ossama.othman@...el.com>
CC:	Greg Kroah-Hartman <gregkh@...e.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Intel Restricted Access Region Handler

On 03/14/10 01:14, Ossama Othman wrote:
> The Intel Restricted Access Region Handler provides a buffer allocation
> mechanism to RAR users.  Since the intended usage model is to lock out
> CPU access to RAR (the CPU will not be able to access RAR memory), this
> driver does not access RAR memory, and merely keeps track of what areas
> of RAR memory are in use.  It has it's own simple allocator that does
> not rely on existing kernel allocators (SLAB, etc) since those
> allocators are too tightly coupled with the paging mechanism, which isn't
> needed for the intended RAR use cases.
> 
> An mmap() implementation is provided for debugging purposes to simplify
> RAR memory access from the user space.  However, it will effectively be
> a no-op when RAR access control is enabled since the CPU will not be
> able to access RAR.
> 
> This driver should not be confused with the rar_register driver.  That
> driver exposes an interface to access RAR registers on the Moorestown
> platform.  The RAR handler driver relies on the rar_register driver for
> low level RAR register reads and writes.
> 
> Signed-off-by: Ossama Othman <ossama.othman@...el.com>
> ---
>  drivers/staging/Kconfig                   |    2 +
>  drivers/staging/Makefile                  |    1 +
>  drivers/staging/memrar/Kconfig            |   15 +
>  drivers/staging/memrar/Makefile           |    2 +
>  drivers/staging/memrar/memrar.h           |  160 +++++
>  drivers/staging/memrar/memrar_allocator.c |  432 +++++++++++++
>  drivers/staging/memrar/memrar_allocator.h |  141 +++++
>  drivers/staging/memrar/memrar_handler.c   |  948 +++++++++++++++++++++++++++++
>  8 files changed, 1701 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/staging/memrar/Kconfig
>  create mode 100644 drivers/staging/memrar/Makefile
>  create mode 100644 drivers/staging/memrar/memrar.h
>  create mode 100644 drivers/staging/memrar/memrar_allocator.c
>  create mode 100644 drivers/staging/memrar/memrar_allocator.h
>  create mode 100644 drivers/staging/memrar/memrar_handler.c
> 
> diff --git a/drivers/staging/memrar/Makefile b/drivers/staging/memrar/Makefile
> new file mode 100644
> index 0000000..a3336c0
> --- /dev/null
> +++ b/drivers/staging/memrar/Makefile
> @@ -0,0 +1,2 @@
> +obj-$(CONFIG_MRST_RAR_HANDLER)	+= memrar.o
> +memrar-y			:= memrar_allocator.o memrar_handler.o
> diff --git a/drivers/staging/memrar/memrar.h b/drivers/staging/memrar/memrar.h
> new file mode 100644
> index 0000000..7a09e7d
> --- /dev/null
> +++ b/drivers/staging/memrar/memrar.h
> @@ -0,0 +1,160 @@
> +/*
> + *      RAR Handler (/dev/memrar) internal driver API.
> + *      Copyright (C) 2009 Intel Corporation. All rights reserved.
> + *
> + *      This program is free software; you can redistribute it and/or
> + *      modify it under the terms of version 2 of the GNU General
> + *      Public License as published by the Free Software Foundation.
> + *
> + *      This program is distributed in the hope that it will be
> + *      useful, but WITHOUT ANY WARRANTY; without even the implied
> + *      warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
> + *      PURPOSE.  See the GNU General Public License for more details.
> + *      You should have received a copy of the GNU General Public
> + *      License along with this program; if not, write to the Free
> + *      Software Foundation, Inc., 59 Temple Place - Suite 330,
> + *      Boston, MA  02111-1307, USA.
> + *      The full GNU General Public License is included in this
> + *      distribution in the file called COPYING.
> + */
> +
> +
> +#ifndef _MEMRAR_H
> +#define _MEMRAR_H
> +
> +#include <linux/ioctl.h>
> +#include <linux/types.h>
> +
> +
> +/*
> + * @struct RAR_stat
> + *
> + * @brief This structure is used for @c RAR_HANDLER_STAT ioctl and for
> + *        @c RAR_get_stat() user space wrapper function.
> + */

Don't use doxygen or whatever that is in the Linux kernel.
Use kernel-doc notation as described in Documentation/kernel-doc-nano-HOWTO.txt.

In many places/multiple files.


> +struct RAR_stat {
> +	/* Type of RAR memory (e.g., audio vs. video) */
> +	__u32 type;
> +
> +	/*
> +	* Total size of RAR memory region.
> +	*/
> +	__u32 capacity;
> +
> +	/* Size of the largest reservable block. */
> +	__u32 largest_block_size;
> +};


Thanks.

-- 
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ