linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nico Schottelius <nico-kernel@schottelius.org>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Nico Schottelius <nico-kernel@schottelius.org>,
	Jesper Juhl <juhl-lkml@dif.dk>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Paulo Marques <pmarques@grupopie.com>,
	Martin Waitz <tali@admingilde.org>
Subject: Re: [PATCH] add sysfs attribute 'carrier' for net devices - try 2.
Date: Wed, 29 Sep 2004 08:54:01 +0200	[thread overview]
Message-ID: <20040929065401.GA3473@schottelius.org> (raw)
In-Reply-To: <1096410283.21799.43.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

Thanks for enlightening [1] me!

Nico

P.S.: [1] enlightenment.org is still alive, just wanted to note that..

Stephen Hemminger [Tue, Sep 28, 2004 at 03:24:43PM -0700]:
> On Tue, 2004-09-28 at 22:54 +0200, Nico Schottelius wrote:
> > Hello!
> > 
> > I am just a bit tired and a bit confused, but
> > 
> > Jesper Juhl [Tue, Sep 28, 2004 at 09:23:25PM +0200]:
> > > > > Using snprintf in this way is kind of silly. since buffer is PAGESIZE.
> > > > > The most concise format of this would be:
> > > > > 	return sprintf(buf, dec_fmt, !!netif_carrier_ok(dev));
> > 
> > wouldn't this potentially open a security hole / buffer overflow?
> 
> buf comes from fs/sysfs/file.c:fill_read_buf and is PAGESIZE.
> Since netif_carrier_ok() returns 0 or 1, don't see how that could ever
> turn into a security hole.
> 	
> 
> > I am currently not really seeing where buf is passed from and what
> > dec_fmt is, but am I totally wrong?
> 
> dec_fmt is in net-sysfs.c and is defined as "%d\n" to avoid
> repetition of same string literal.
> 
> 

-- 
Keep it simple & stupid, use what's available.
Please use pgp encryption: 8D0E 27A4 is my id.
http://nico.schotteli.us | http://linux.schottelius.org

[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]

  reply	other threads:[~2004-09-29  6:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20041021112750.GN15294@schottelius.org>
     [not found] ` <Pine.LNX.4.61.0410221744500.15769@jjulnx.backbone.dif.dk>
2004-09-26 22:51   ` [PATCH] add sysfs attribute 'carrier' for net devices Jesper Juhl
2004-09-27 17:29     ` Stephen Hemminger
2004-09-28 11:18       ` Jesper Juhl
2004-09-28 19:23         ` [PATCH] add sysfs attribute 'carrier' for net devices - try 2 Jesper Juhl
2004-09-28 19:22           ` Stephen Hemminger
2004-09-28 20:54           ` Nico Schottelius
2004-09-28 22:24             ` Stephen Hemminger
2004-09-29  6:54               ` Nico Schottelius [this message]
2004-09-28 12:10       ` [PATCH] add sysfs attribute 'carrier' for net devices Paulo Marques
2004-09-28 16:09         ` Martin Waitz
2004-10-23 18:49           ` Nico Schottelius

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=20040929065401.GA3473@schottelius.org \
    --to=nico-kernel@schottelius.org \
    --cc=juhl-lkml@dif.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmarques@grupopie.com \
    --cc=shemminger@osdl.org \
    --cc=tali@admingilde.org \
    /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;
as well as URLs for NNTP newsgroup(s).