linux_dsm_epyc7002/arch/nios2/include/asm
Linus Torvalds 30c44659f4 Merge branch 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull strscpy string copy function implementation from Chris Metcalf.

Chris sent this during the merge window, but I waffled back and forth on
the pull request, which is why it's going in only now.

The new "strscpy()" function is definitely easier to use and more secure
than either strncpy() or strlcpy(), both of which are horrible nasty
interfaces that have serious and irredeemable problems.

strncpy() has a useless return value, and doesn't NUL-terminate an
overlong result.  To make matters worse, it pads a short result with
zeroes, which is a performance disaster if you have big buffers.

strlcpy(), by contrast, is a mis-designed "fix" for strlcpy(), lacking
the insane NUL padding, but having a differently broken return value
which returns the original length of the source string.  Which means
that it will read characters past the count from the source buffer, and
you have to trust the source to be properly terminated.  It also makes
error handling fragile, since the test for overflow is unnecessarily
subtle.

strscpy() avoids both these problems, guaranteeing the NUL termination
(but not excessive padding) if the destination size wasn't zero, and
making the overflow condition very obvious by returning -E2BIG.  It also
doesn't read past the size of the source, and can thus be used for
untrusted source data too.

So why did I waffle about this for so long?

Every time we introduce a new-and-improved interface, people start doing
these interminable series of trivial conversion patches.

And every time that happens, somebody does some silly mistake, and the
conversion patch to the improved interface actually makes things worse.
Because the patch is mindnumbing and trivial, nobody has the attention
span to look at it carefully, and it's usually done over large swatches
of source code which means that not every conversion gets tested.

So I'm pulling the strscpy() support because it *is* a better interface.
But I will refuse to pull mindless conversion patches.  Use this in
places where it makes sense, but don't do trivial patches to fix things
that aren't actually known to be broken.

* 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  tile: use global strscpy() rather than private copy
  string: provide strscpy()
  Make asm/word-at-a-time.h available on all architectures
2015-10-04 16:31:13 +01:00
..
asm-macros.h
asm-offsets.h
cache.h nios2: Cache handling 2014-12-08 12:55:54 +08:00
cacheflush.h nios2: Cache handling 2014-12-08 12:55:54 +08:00
checksum.h nios2: Library functions 2014-12-08 12:56:00 +08:00
cmpxchg.h nios2: Miscellaneous header files 2014-12-08 12:56:03 +08:00
cpuinfo.h nios2: Cpuinfo handling 2014-12-08 12:56:02 +08:00
delay.h nios2: Time keeping 2014-12-08 12:56:01 +08:00
dma-mapping.h nios2: DMA mapping API 2014-12-08 12:55:56 +08:00
elf.h nios2: ELF definitions 2014-12-08 12:55:58 +08:00
entry.h
io.h arch/*/io.h: Add ioremap_wt() to all architectures 2015-06-07 15:28:57 +02:00
irq.h nios2: Interrupt handling 2014-12-08 12:55:55 +08:00
irqflags.h nios2: Interrupt handling 2014-12-08 12:55:55 +08:00
Kbuild Merge branch 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2015-10-04 16:31:13 +01:00
kgdb.h nios2: add kgdb support 2015-02-16 19:26:43 +08:00
linkage.h nios2: Miscellaneous header files 2014-12-08 12:56:03 +08:00
mmu_context.h nios2: Process management 2014-12-08 12:55:53 +08:00
mmu.h nios2: Memory management 2014-12-08 12:55:51 +08:00
mutex.h nios2: Miscellaneous header files 2014-12-08 12:56:03 +08:00
page.h nios2: Remove unused extern declaration of shm_align_mask 2014-12-08 12:56:11 +08:00
pgalloc.h nios2: Page table management 2014-12-08 12:55:53 +08:00
pgtable-bits.h nios2: drop _PAGE_FILE and pte_file()-related helpers 2015-02-10 14:30:32 -08:00
pgtable.h mm: make FIRST_USER_ADDRESS unsigned long on all archs 2015-02-11 17:06:03 -08:00
processor.h nios2: Remove unused prepare_to_copy() 2015-02-09 14:17:27 +08:00
prom.h nios2: add early printk support 2015-02-10 23:21:08 +08:00
ptrace.h nios2: update pt_regs 2015-03-12 13:35:06 +08:00
registers.h nios2: Nios2 registers 2014-12-08 12:56:03 +08:00
setup.h
shmparam.h nios2: rework cache 2015-04-24 14:49:53 +08:00
signal.h nios2: Signal handling support 2014-12-08 12:55:59 +08:00
string.h nios2: Library functions 2014-12-08 12:56:00 +08:00
switch_to.h nios2: Process management 2014-12-08 12:55:53 +08:00
syscall.h nios2: System calls handling 2014-12-08 12:55:58 +08:00
syscalls.h nios2: System calls handling 2014-12-08 12:55:58 +08:00
thread_info.h Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc 2015-04-15 13:53:55 -07:00
timex.h nios2: Time keeping 2014-12-08 12:56:01 +08:00
tlb.h nios2: TLB handling 2014-12-08 12:55:54 +08:00
tlbflush.h nios2: TLB handling 2014-12-08 12:55:54 +08:00
traps.h nios2: Traps exception handling 2014-12-08 12:55:50 +08:00
uaccess.h nios2/uaccess: fix sparse errors 2014-12-17 13:53:41 +08:00