lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240820160636.7bfc4d5a@kernel.org>
Date: Tue, 20 Aug 2024 16:06:36 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Breno Leitao <leitao@...ian.org>
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
 liuhangbin@...il.com, petrm@...dia.com, matttbe@...nel.org, Shuah Khan
 <shuah@...nel.org>, netdev@...r.kernel.org, Willem de Bruijn
 <willemb@...gle.com>, David Wei <dw@...idwei.uk>,
 linux-kernel@...r.kernel.org (open list), linux-kselftest@...r.kernel.org
 (open list:KERNEL SELFTEST FRAMEWORK)
Subject: Re: [PATCH net-next v5] net: netconsole: selftests: Create a new
 netconsole selftest

On Mon, 19 Aug 2024 02:03:53 -0700 Breno Leitao wrote:
> +function check_for_dependencies() {
> +	if [ "$(id -u)" -ne 0 ]; then
> +		echo "This test must be run as root" >&2
> +		exit "${ksft_skip}"
> +	fi
> +
> +	if ! which socat > /dev/null ; then
> +		echo "SKIP: socat(1) is not available" >&2
> +		exit "${ksft_skip}"
> +	fi
> +
> +	if ! which ip > /dev/null ; then
> +		echo "SKIP: ip(1) is not available" >&2
> +		exit "${ksft_skip}"
> +	fi
> +
> +	if ! which udevadm > /dev/null ; then
> +		echo "SKIP: udevadm(1) is not available" >&2
> +		exit "${ksft_skip}"
> +	fi
> +
> +	if [ ! -d "${NETCONS_CONFIGFS}" ]; then
> +		echo "SKIP: directory ${NETCONS_CONFIGFS} does not exist. Check if NETCONSOLE_DYNAMIC is enabled" >&2
> +		exit "${ksft_skip}"
> +	fi
> +
> +	if ip link show "${DSTIF}" 2> /dev/null; then
> +		echo "SKIP: interface ${DSTIF} exists in the system. Not overwriting it." >&2
> +		exit "${ksft_skip}"
> +	fi

nit: maybe ip addr list to see if the 192.168.1.x network is already in
use? 

> +}
> +
> +# ========== #
> +# Start here #
> +# ========== #
> +modprobe netdevsim 2> /dev/null || true
> +modprobe netconsole 2 > /dev/null || true
> +
> +# The content of kmsg will be save to the following file
> +OUTPUT_FILE="/tmp/${TARGET}"
> +
> +# Check for basic system dependency and exit if not found
> +check_for_dependencies
> +# Set current loglevel to KERN_INFO(6), and default to KERN_NOTICE(5)
> +echo "6 5" > /proc/sys/kernel/printk

nit: should we not undo this in clenaup?

> +# Remove the namespace, interfaces and netconsole target on exit
> +trap cleanup EXIT
> +# Create one namespace and two interfaces
> +set_network
> +# Create a dynamic target for netconsole
> +create_dynamic_target
> +# Listed for netconsole port inside the namespace and destination interface
> +listen_port_and_save_to "${OUTPUT_FILE}" &
> +# Wait for socat to start and listen to the port.
> +wait_local_port_listen "${NAMESPACE}" "${PORT}" udp
> +# Send the message
> +echo "${MSG}: ${TARGET}" > /dev/kmsg
> +# Wait until socat saves the file to disk
> +busywait "${BUSYWAIT_TIMEOUT}" test -s "${OUTPUT_FILE}"
> +
> +# Make sure the message was received in the dst part
> +# and exit
> +validate_result "${OUTPUT_FILE}"

Main reason Im complaining, I see:

[    6.686720] netconsole: unknown parameter '2' ignored

in the kernel logs when the test runs.

Is it expected?
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ