mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] BSD Secure Levels: printk overhaul, 2.6.11-rc2-mm1 (1/8)
Date: Thu, 10 Feb 2005 13:59:20 -0800	[thread overview]
Message-ID: <20050210215920.GB2474@waste.org> (raw)
In-Reply-To: <20050207192108.GA776@halcrow.us>

On Mon, Feb 07, 2005 at 01:21:08PM -0600, Michael Halcrow wrote:
> This is the first in a series of eight patches to the BSD Secure
> Levels LSM.  It overhauls the printk mechanism in order to reduce the
> unnecessary usage of the .text area.  Thanks to Brad Spengler for the
> suggestion.
> 
> Signed off by: Michael Halcrow <mhalcrow@us.ibm.com>

> Index: linux-2.6.11-rc2-mm1-modules/security/seclvl.c
> ===================================================================
> --- linux-2.6.11-rc2-mm1-modules.orig/security/seclvl.c	2005-02-03 14:55:44.799527472 -0600
> +++ linux-2.6.11-rc2-mm1-modules/security/seclvl.c	2005-02-03 14:56:18.527400056 -0600
> @@ -101,22 +101,20 @@
>  
>  #define MY_NAME "seclvl"
>  
> -/**
> - * This time-limits log writes to one per second.
> - */
> -#define seclvl_printk(verb, type, fmt, arg...)			\
> -	do {							\
> -		if (verbosity >= verb) {			\
> -			static unsigned long _prior;		\
> -			unsigned long _now = jiffies;		\
> -			if ((_now - _prior) > HZ) {		\
> -				printk(type "%s: %s: " fmt,	\
> -					MY_NAME, __FUNCTION__ ,	\
> -					## arg);		\
> -				_prior = _now;			\
> -			}					\
> -		}						\
> -	} while (0)
> +static void seclvl_printk( int verb, const char * fmt, ... )
> +{
> +	va_list args;
> +	va_start( args, fmt );
> +	if (verbosity >= verb) {
> +		static unsigned long _prior;
> +		unsigned long _now = jiffies;
> +		if ((_now - _prior) > HZ) {
> +			vprintk( fmt, args );
> +		}
> +		_prior = _now;
> +	}
> +	va_end( args );
> +}

This could be done with a seclvl_printk macro wrapping a
__seclvl_printk function that provides __FUNCTION__, leaving the
callers the same.

-- 
Mathematics is the supreme nostalgia of our time.

      parent reply	other threads:[~2005-02-10 21:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-07 19:21 Michael Halcrow
2005-02-07 19:30 ` [PATCH] BSD Secure Levels: suid/sgid on directories; open/mknod issue, 2.6.11-rc2-mm1 (2/8) Michael Halcrow
2005-02-07 19:31 ` [PATCH] BSD Secure Levels: claim block dev in file struct rather than inode struct, 2.6.11-rc2-mm1 (3/8) Michael Halcrow
2005-02-07 22:26   ` Chris Wright
2005-02-07 22:41     ` Valdis.Kletnieks
2005-02-08  1:48       ` David Wagner
2005-02-08  2:10         ` Valdis.Kletnieks
2005-02-08  2:20           ` Chris Wright
2005-02-08  3:15             ` Valdis.Kletnieks
2005-02-08 14:33           ` David Wagner
2005-02-07 22:42     ` Valdis.Kletnieks
2005-02-08 17:24     ` Michael Halcrow
2005-02-08 17:47       ` Valdis.Kletnieks
2005-02-08 20:08         ` Serge E. Hallyn
2005-02-08 23:38       ` Chris Wright
2005-02-07 19:32 ` [PATCH] BSD Secure Levels: memory alloc failure check, 2.6.11-rc2-mm1 (4/8) Michael Halcrow
2005-02-07 19:34 ` [PATCH] BSD Secure Levels: allow setuid/setgid on process if root, 2.6.11-rc2-mm1 (5/8) Michael Halcrow
2005-02-07 19:35 ` [PATCH] BSD Secure Levels: nits, 2.6.11-rc2-mm1 (6/8) Michael Halcrow
2005-02-08 23:43   ` Chris Wright
2005-02-07 19:36 ` [PATCH] BSD Secure Levels: comment cleanups, 2.6.11-rc2-mm1 (7/8) Michael Halcrow
2005-02-07 19:37 ` [PATCH] BSD Secure Levels: remove ptrace, 2.6.11-rc2-mm1 (8/8) Michael Halcrow
2005-02-10 21:59 ` Matt Mackall [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050210215920.GB2474@waste.org \
    --to=mpm@selenic.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhalcrow@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®