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] [day] [month] [year] [list]
Date:	Wed, 11 Feb 2009 14:19:58 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>,
	penberg@...helsinki.fi, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] trace: splice support for tracing_pipe

On Wed, Feb 11, 2009 at 01:35:26PM +0100, Ingo Molnar wrote:
> 
> * Steven Rostedt <rostedt@...dmis.org> wrote:
> 
> > On Mon, 9 Feb 2009, Eduard - Gabriel Munteanu wrote:
> > > +
> > > +static ssize_t tracing_splice_read_pipe(struct file *filp,
> > > +					loff_t *ppos,
> > > +					struct pipe_inode_info *pipe,
> > > +					size_t len,
> > > +					unsigned int flags)
> > > +{
> > > +	struct page *pages[PIPE_BUFFERS];
> > > +	struct partial_page partial[PIPE_BUFFERS];
> > > +	struct trace_iterator *iter = filp->private_data;
> > > +	struct splice_pipe_desc spd = {
> > > +		.pages = pages,
> > > +		.partial = partial,
> > > +		.nr_pages = 0, /* This gets updated below. */
> > > +		.flags = flags,
> > > +		.ops = &tracing_pipe_buf_ops,
> > > +		.spd_release = tracing_spd_release_pipe,
> > > +	};
> > 
> > Note, this is getting a little stack heavy. It is still in bounds,
> > but I get very nervous when I see structure arrays on the stack.
> > If either the structure or the array grows large, we can be in trouble.
> 
> Good point - but note that this is how splice support is implemented in
> a number of other files - so if PIPE_BUFFERS or partial_page grows in
> size, those places will fail too.
> 
> 	Ingo

I first thought they can be declared as static, since the read_pipe functions
are not supposed to be reentrant, only one reader is allowed inside the pipe
(serialized with a global mutex).
But the mutex is released while waiting, and still, I guess it should be
reentrant one day if we plan to let the user having one trace_pipe per
cpu trace.

Would a dynamic allocation be too much overhead for that?

--
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