netdev
[Top] [All Lists]

Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy

To: Felipe Alfaro Solana <felipe_alfaro@xxxxxxxxxxxxx>, "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" <yoshfuji@xxxxxxxxxxxxxx>, davem@xxxxxxxxxx, Linux Kernel Mailinglist <linux-kernel@xxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
Subject: Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy
From: Russell King <rmk+lkml@xxxxxxxxxxxxxxxx>
Date: Thu, 27 Nov 2003 22:33:48 +0000
In-reply-to: <20031127221928.F25015@xxxxxxxxxxxxxxxxxxxxxx>; from rmk+lkml@xxxxxxxxxxxxxxxx on Thu, Nov 27, 2003 at 10:19:28PM +0000
Mail-followup-to: Felipe Alfaro Solana <felipe_alfaro@xxxxxxxxxxxxx>, "YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B" <yoshfuji@xxxxxxxxxxxxxx>, davem@xxxxxxxxxx, Linux Kernel Mailinglist <linux-kernel@xxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
References: <1069934643.2393.0.camel@xxxxxxxxxxxxxxxxxxxxxxxx> <20031127.210953.116254624.yoshfuji@xxxxxxxxxxxxxx> <20031127194602.A25015@xxxxxxxxxxxxxxxxxxxxxx> <20031128.045413.133305490.yoshfuji@xxxxxxxxxxxxxx> <20031127200041.B25015@xxxxxxxxxxxxxxxxxxxxxx> <1069970770.2138.10.camel@xxxxxxxxxxxxxxxxxxxxxxxx> <20031127221928.F25015@xxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
On Thu, Nov 27, 2003 at 10:19:28PM +0000, Russell King wrote:
> Note: we should really fix the generic strncpy() - there are places in
> the kernel source which rely on the x86 strncpy() behaviour today (eg,
> binfmt_*.c core file generation.)

Sorry, bad example.  Hmm, from a glance around, it seems that all of
the places which use strncpy() implicitly zero the buffer prior to
using strncpy().

This means that the x86 strncpy is doing unnecessary zeroing.  I do
remember Alan complaining about the last set of strlcpy() stuff
introducing information leaks - maybe those got fixed though.

Ok, I don't know where the kernel stands on this issue anymore.
Can someone definitively provide a statement of exactly what the
kernel expects of strncpy() ?

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

<Prev in Thread] Current Thread [Next in Thread>