linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] string: Improve the generic strlcpy() implementation
@ 2015-10-05 15:38 Alexey Dobriyan
  2015-10-05 16:11 ` Ingo Molnar
       [not found] ` <CA+55aFyTVJfCt00gYJpiQW5kqPaRGJ93JmfRRni-73zCf5ivqg@mail.gmail.com>
  0 siblings, 2 replies; 34+ messages in thread
From: Alexey Dobriyan @ 2015-10-05 15:38 UTC (permalink / raw)
  To: Ingo Molnar, cmetcalf; +Cc: Linux Kernel

I want to say two things:

1) strlcpy race

>  * In addition, the implementation is robust to the string changing out
>  * from underneath it, unlike the current strlcpy() implementation.

Canonical OpenBSD version does byte-by-byte copying,
this race is purely Linux invention.

2) strscpy() will copy garbage past NUL from source into destination.
It won't fault but still, who knows what lies after string.

^ permalink raw reply	[flat|nested] 34+ messages in thread
* [GIT PULL] strscpy string copy function
@ 2015-09-10 19:43 Chris Metcalf
  2015-10-04 15:55 ` Linus Torvalds
  0 siblings, 1 reply; 34+ messages in thread
From: Chris Metcalf @ 2015-09-10 19:43 UTC (permalink / raw)
  To: Linus Torvalds, open list

Linus,

Please pull the following changes for 4.3 from:

   git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile.git strscpy

Your comment for 4.2 was to get rid of the "make it zero-sized" default thing,
which I did in the v2 patch in July.  I did get a bit of feedback around the
language of the kerneldoc comment, which I updated, and the result is ready
to be pulled, if it seems like the right thing to you now!

Chris Metcalf (3):
       Make asm/word-at-a-time.h available on all architectures
       string: provide strscpy()
       tile: use global strscpy() rather than private copy

  arch/arc/include/asm/Kbuild          |  1 +
  arch/avr32/include/asm/Kbuild        |  1 +
  arch/blackfin/include/asm/Kbuild     |  1 +
  arch/c6x/include/asm/Kbuild          |  1 +
  arch/cris/include/asm/Kbuild         |  1 +
  arch/frv/include/asm/Kbuild          |  1 +
  arch/hexagon/include/asm/Kbuild      |  1 +
  arch/ia64/include/asm/Kbuild         |  1 +
  arch/m32r/include/asm/Kbuild         |  1 +
  arch/metag/include/asm/Kbuild        |  1 +
  arch/microblaze/include/asm/Kbuild   |  1 +
  arch/mips/include/asm/Kbuild         |  1 +
  arch/mn10300/include/asm/Kbuild      |  1 +
  arch/nios2/include/asm/Kbuild        |  1 +
  arch/powerpc/include/asm/Kbuild      |  1 +
  arch/s390/include/asm/Kbuild         |  1 +
  arch/score/include/asm/Kbuild        |  1 +
  arch/tile/gxio/mpipe.c               | 33 ++------------
  arch/tile/include/asm/Kbuild         |  1 +
  arch/um/include/asm/Kbuild           |  1 +
  arch/unicore32/include/asm/Kbuild    |  1 +
  arch/xtensa/include/asm/Kbuild       |  1 +
  include/asm-generic/word-at-a-time.h | 80 ++++++++++++++++++++++++++++----
  include/linux/string.h               |  3 ++
  lib/string.c                         | 88 ++++++++++++++++++++++++++++++++++++
  25 files changed, 188 insertions(+), 37 deletions(-)

-- 
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2015-10-19 16:25 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 15:38 [PATCH] string: Improve the generic strlcpy() implementation Alexey Dobriyan
2015-10-05 16:11 ` Ingo Molnar
2015-10-05 16:13   ` Ingo Molnar
     [not found] ` <CA+55aFyTVJfCt00gYJpiQW5kqPaRGJ93JmfRRni-73zCf5ivqg@mail.gmail.com>
2015-10-05 16:22   ` Ingo Molnar
2015-10-05 16:28     ` Ingo Molnar
2015-10-05 16:36       ` [PATCH] string: Fix strscpy() uninitialized data copy bug Ingo Molnar
2015-10-05 18:54         ` Chris Metcalf
2015-10-06  7:21           ` Ingo Molnar
2015-10-05 20:40     ` [PATCH] string: Improve the generic strlcpy() implementation Linus Torvalds
2015-10-06 16:47       ` [PATCH] strscpy: zero any trailing garbage bytes in the destination Chris Metcalf
2015-10-06 16:59         ` kbuild test robot
2015-10-06 17:34         ` Chris Metcalf
2015-10-07  7:28         ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2015-09-10 19:43 [GIT PULL] strscpy string copy function Chris Metcalf
2015-10-04 15:55 ` Linus Torvalds
2015-10-05 11:27   ` [PATCH] string: Improve the generic strlcpy() implementation Ingo Molnar
2015-10-05 11:53     ` Ingo Molnar
2015-10-05 13:15       ` Ingo Molnar
2015-10-05 14:04         ` Ingo Molnar
     [not found]         ` <CA+55aFx2McOeEiB7fJ-BV=vBsH=i2cC-qW8_EBEnScfQhugD_w@mail.gmail.com>
2015-10-05 14:07           ` Ingo Molnar
2015-10-05 14:33           ` Ingo Molnar
2015-10-05 15:32             ` Linus Torvalds
2015-10-05 16:03               ` Ingo Molnar
2015-10-05 12:28     ` Linus Torvalds
2015-10-05 13:10       ` Ingo Molnar
2015-10-05 22:28     ` Rasmus Villemoes
2015-10-06  7:54       ` Ingo Molnar
2015-10-06  8:03       ` Ingo Molnar
2015-10-06 22:00         ` Rasmus Villemoes
2015-10-07  7:18           ` Ingo Molnar
2015-10-07  9:04             ` Rasmus Villemoes
2015-10-07  9:22               ` Linus Torvalds
2015-10-08  8:48                 ` Ingo Molnar
2015-10-09  8:10                   ` Rasmus Villemoes
2015-10-19 12:42     ` Rasmus Villemoes
2015-10-19 16:24       ` Chris Metcalf

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