#!/bin/sh SYSCTL="/proc/sys" TARGET="${SYSCTL}/kernel/domainname" ORIG=$(cat "${TARGET}") TEST_STR="Testing sysctl" . ./common_tests # Only string sysctls support seeking/appending. MAXLEN=65 echo -n "Writing entire sysctl in short writes ... " set_orig dd if="${TEST_FILE}" of="${TARGET}" bs=1 2>/dev/null if ! verify "${TARGET}"; then echo "FAIL" >&2 rc=1 else echo "ok" fi echo -n "Writing middle of sysctl after unsynchronized seek ... " set_test dd if="${TEST_FILE}" of="${TARGET}" bs=1 seek=1 2>/dev/null if verify "${TARGET}"; then echo "FAIL" >&2 rc=1 else echo "ok" fi echo -n "Checking sysctl maxlen is at least $MAXLEN ... " set_orig perl -e 'print "A" x ('"${MAXLEN}"'-2), "B";' | \ dd of="${TARGET}" bs="${MAXLEN}" 2>/dev/null if ! grep -q B "${TARGET}"; then echo "FAIL" >&2 rc=1 else echo "ok" fi echo -n "Checking sysctl keeps original string on overflow append ... " set_orig perl -e 'print "A" x ('"${MAXLEN}"'-1), "B";' | \ dd of="${TARGET}" bs=$(( MAXLEN - 1 )) 2>/dev/null if grep -q B "${TARGET}"; then echo "FAIL" >&2 rc=1 else echo "ok" fi echo -n "Checking sysctl stays NULL terminated on write ... " set_orig perl -e 'print "A" x ('"${MAXLEN}"'-1), "B";' | \ dd of="${TARGET}" bs="${MAXLEN}" 2>/dev/null if grep -q B "${TARGET}"; then echo "FAIL" >&2 rc=1 else echo "ok" fi echo -n "Checking sysctl stays NULL terminated on overwrite ... " set_orig perl -e 'print "A" x ('"${MAXLEN}"'-1), "BB";' | \ dd of="${TARGET}" bs=$(( $MAXLEN + 1 )) 2>/dev/null if grep -q B "${TARGET}"; then echo "FAIL" >&2 rc=1 else echo "ok" fi exit $rc tabs'> summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/u_ether_configfs.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-02 12:34:27 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-02 12:34:27 -0800
commitf2557779e1a9cfbf69c99b74da26cc1b2b10e752 (patch)
tree8ddca65c897199add553948c429072b8bd463692 /drivers/usb/gadget/function/u_ether_configfs.h
parent6d04dfc8966019b8b0977b2cb942351f13d2b178 (diff)
parent030305d69fc6963c16003f50d7e8d74b02d0a143 (diff)
Merge tag 'pci-v4.10-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fix from Bjorn Helgaas: "Configure ASPM on the link from a PCI-to-PCIe bridge (avoids a NULL pointer dereference on topologies including these bridges)" * tag 'pci-v4.10-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI/ASPM: Handle PCI-to-PCIe bridges as roots of PCIe hierarchies
Diffstat (limited to 'drivers/usb/gadget/function/u_ether_configfs.h')