alistair23-linux/arch/blackfin/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-offsets.h
atomic.h atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
barrier.h arch: Cleanup read_barrier_depends() and comments 2014-12-11 21:15:05 -05:00
bfin-global.h
bfin-lq035q1.h
bfin5xx_spi.h
bfin_can.h
bfin_dma.h
bfin_pfmon.h
bfin_ppi.h
bfin_sdh.h bf609: rsi: Add bf609 rsi MMR macro and board platform data. 2013-05-07 18:26:18 +08:00
bfin_serial.h serial: bfin: ctsrts: enfore Kconfig naming convention 2015-05-06 22:26:59 +02:00
bfin_simple_timer.h
bfin_sport.h UAPI: (Scripted) Disintegrate arch/blackfin/include/asm 2012-12-13 13:50:56 +08:00
bfin_sport3.h treewide: Fix typos in printk and comment 2013-03-18 14:57:53 +01:00
bfin_twi.h i2c: bfin-twi: remove unnecessary Blackfin SSYNC from the driver 2014-03-09 08:41:18 +01:00
bfin_watchdog.h
bfrom.h
bitops.h arch,blackfin: Convert smp_mb__*() 2014-04-18 11:40:34 +02:00
blackfin.h
bug.h
cache.h
cacheflush.h
cdef_LPBlackfin.h
checksum.h
clkdev.h clk: Add common __clk_get(), __clk_put() implementations 2013-12-04 17:19:44 +01:00
clocks.h
cmpxchg.h
context.S
cplb.h
cplbinit.h
cpu.h
def_LPBlackfin.h blackfin: Support L1 SRAM parity checking feature on bf60x 2014-01-29 15:12:20 +08:00
delay.h
dma-mapping.h blackfin: Provide dma_mmap_coherent() and dma_get_sgtable() 2013-01-29 08:11:14 +01:00
dma.h Revert "blackfin: dma: current count mmr is read only" 2014-06-11 00:13:22 +08:00
dpmc.h
early_printk.h
elf.h default SET_PERSONALITY() in linux/elf.h 2013-02-26 02:46:08 -05:00
entry.h
exec.h
fixed_code.h UAPI: (Scripted) Disintegrate arch/blackfin/include/asm 2012-12-13 13:50:56 +08:00
flat.h
ftrace.h ftrace: Make CALLER_ADDRx macros more generic 2014-05-21 03:10:32 -04:00
gpio.h blackfin: adi gpio driver and pinctrl driver support 2013-11-15 17:33:42 +08:00
gptimers.h
hardirq.h hardirq: Make hardirq bits generic 2013-11-13 20:21:46 +01:00
io.h blackfin: Fix build error 2015-06-10 10:19:24 -07:00
ipipe.h blackfin: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
ipipe_base.h
irq.h pinctrl: Move pint PM storage structure out of blackfin architecture. 2014-02-10 10:13:08 +01:00
irq_handler.h genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
irqflags.h
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
l1layout.h
linkage.h
mem_init.h blackfin: dmc: Improve DDR2 write through in DMC effict controller. 2013-05-07 18:25:59 +08:00
mem_map.h
mmu.h
mmu_context.h
module.h
nand.h
nmi.h
page.h
page_offset.h
pci.h remove <asm/scatterlist.h> 2015-05-05 13:35:39 -06:00
pda.h
perf_event.h
pgtable.h blackfin: drop pte_file() 2015-02-10 14:30:31 -08:00
pm.h
portmux.h blackfin: portmux: cleanup head file 2014-04-12 08:46:32 +08:00
processor.h arch, locking: Ciao arch_mutex_cpu_relax() 2014-07-17 12:32:47 +02:00
pseudo_instructions.h
ptrace.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-12-20 18:05:28 -08:00
reboot.h
rwlock.h
scb.h blackfin: scb: Add system crossbar init code. 2013-09-13 10:42:27 +08:00
sections.h
segment.h
smp.h
spinlock.h
spinlock_types.h
string.h
switch_to.h
syscall.h
thread_info.h blackfin: Remove exec_domain usage 2015-04-12 20:58:24 +02:00
time.h
timex.h
tlb.h
tlbflush.h
trace.h
traps.h
uaccess.h blackfin: macro whitespace fixes 2015-01-13 15:23:47 +02:00
unistd.h sys_sgetmask/sys_ssetmask: add CONFIG_SGETMASK_SYSCALL 2014-06-04 16:54:14 -07:00