kernel_optimize_test/arch/mips/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
..
dec
emma
fw
ip32
lasat
mach-ar7
mach-ath25
mach-ath79
mach-au1x00
mach-bcm47xx
mach-bcm63xx
mach-bmips
mach-cavium-octeon
mach-cobalt
mach-db1x00
mach-dec
mach-emma2rh
mach-generic
mach-ip22
mach-ip27
mach-ip28
mach-ip32
mach-jazz
mach-jz4740
mach-lantiq
mach-lasat
mach-loongson32
mach-loongson64
mach-malta
mach-netlogic
mach-paravirt
mach-pistachio
mach-pmcs-msp71xx
mach-pnx833x
mach-ralink
mach-rc32434
mach-rm
mach-sead3
mach-sibyte
mach-tx39xx
mach-tx49xx
mach-vr41xx
mips-boards
netlogic genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
octeon
pci
sgi
sibyte
sn
txx9
vr41xx
xtalk
abi.h
addrspace.h
amon.h
arch_hweight.h
asm-eva.h
asm-offsets.h
asm.h
asmmacro-32.h
asmmacro-64.h
asmmacro.h
atomic.h
barrier.h
bcache.h
bitops.h
bmips-spaces.h
bmips.h
bootinfo.h
branch.h
break.h
bug.h
bugs.h
cache.h
cacheflush.h
cacheops.h
cdmm.h
cevt-r4k.h
checksum.h
clkdev.h
clock.h
cmp.h
cmpxchg.h
compat-signal.h
compat.h
compiler.h
cop2.h
cpu-features.h MIPS: cpu-features: Add cpu_has_ftlb 2015-09-22 21:11:05 +02:00
cpu-info.h
cpu-type.h
cpu.h MIPS: cpu-features: Add cpu_has_ftlb 2015-09-22 21:11:05 +02:00
delay.h
device.h
div64.h
dma-coherence.h
dma-mapping.h dma-mapping: consolidate dma_set_mask 2015-09-10 13:29:01 -07:00
dma.h
ds1287.h
dsp.h
edac.h
elf.h
errno.h
eva.h
exec.h
fb.h
fixmap.h
floppy.h
fpregdef.h
fpu_emulator.h
fpu.h
ftrace.h
futex.h
gio_device.h
gt64120.h
hardirq.h
hazards.h
highmem.h
hpet.h
hugetlb.h
hw_irq.h
i8259.h
ide.h
idle.h
inst.h
io.h
irq_cpu.h
irq_gt641xx.h
irq_regs.h
irq.h
irqflags.h
isadep.h
jazz.h
jazzdma.h
jump_label.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
kdebug.h
kexec.h
kgdb.h
kmap_types.h
kprobes.h
kvm_host.h KVM: disable halt_poll_ns as default for s390x 2015-09-25 10:31:30 +02:00
kvm_para.h
linkage.h
local.h
m48t37.h
maar.h MIPS: Initialise MAARs on secondary CPUs 2015-09-27 14:15:26 +02:00
mc146818-time.h
mc146818rtc.h
mips_machine.h
mips_mt.h
mips-cm.h MIPS: CM: Provide a function to map from CPU to VP ID. 2015-09-27 14:11:17 +02:00
mips-cpc.h
mips-r2-to-r6-emul.h
mipsmtregs.h
mipsprom.h
mipsregs.h MIPS: cpu-features: Add cpu_has_ftlb 2015-09-22 21:11:05 +02:00
mmu_context.h
mmu.h
mmzone.h
module.h
msa.h
msc01_ic.h
nile4.h
paccess.h
page.h
pci.h
perf_event.h
pgalloc.h
pgtable-32.h
pgtable-64.h
pgtable-bits.h
pgtable.h
pm-cps.h
pm.h
pmon.h
prefetch.h
processor.h
prom.h
ptrace.h
r4k-timer.h
r4kcache.h
reboot.h
reg.h
regdef.h
rtlx.h
seccomp.h
setup.h
sgialib.h
sgiarcs.h
shmparam.h
sigcontext.h
signal.h
sim.h
smp-cps.h
smp-ops.h
smp.h
sni.h
socket.h
sparsemem.h
spinlock_types.h
spinlock.h
spram.h
stackframe.h
stackprotector.h
stacktrace.h
string.h
switch_to.h
syscall.h
termios.h
thread_info.h
time.h
timex.h
tlb.h
tlbdebug.h
tlbflush.h
tlbmisc.h
topology.h
traps.h
txx9irq.h
txx9pio.h
txx9tmr.h
types.h
uaccess.h
uasm.h
unaligned.h
unistd.h
uprobes.h
vdso.h
vga.h
vpe.h
war.h
watch.h
wbflush.h