Re: [PATCH] add sysfs attribute 'carrier' for net devices - try 2.

From: Stephen Hemminger (shemminger_at_osdl.org)
Date: 09/29/04

  • Next message: John McCutchan: "[RFC][PATCH] inotify 0.11.0"
    To: Nico Schottelius <nico-kernel@schottelius.org>
    Date:	Tue, 28 Sep 2004 15:24:43 -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.

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


  • Next message: John McCutchan: "[RFC][PATCH] inotify 0.11.0"

    Relevant Pages

    • Re: fun or real: proc interface for module handling?
      ... On Thursday 31 July 2003 16:12, Nico Schottelius wrote: ... > I was just joking around here, but what do you think about this idea: ... module params in the former case ?). ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • 2.6.0: very slow keyboard repeating!
      ... While beeing very happy in 2.5 that the keyboard was very fast in ... the repeat rate is as slow as in 2.4 again! ... (Nico Schottelius after writin' a very senseless email) ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • package index: decr-f: correct?
      ... I am building up a free and central package index and added Linux to it. ... (Nico Schottelius after writin' a very senseless email) ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: smbfs / loop: problematic or not unuseable?
      ... On Mon, 16 Feb 2004, Nico Schottelius wrote: ... > While still suffering from my more or less dead harddisk I am seeing ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: harddisk or kernel problem?
      ... On Monday 16 of February 2004 00:34, Nico Schottelius wrote: ... > Before I continue to report what I've found out: ... READ DMA errors were logged, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)