From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796281781; b=FeYdyoNgdM//+E4PslZfm4PVIqkDxUxWHwt2v1KQFdvtQJoTKIWoIHgpe4xkiQsKjDYf owcLj3MVa7mtoTuGlye1GjbppvW8zSV4D9zB/qSuaxh65zQ9oHqj8fARMBNTTD2L2da/p Ni+5wwj/G0arQNzQ+jtDNvsxCW/Qfdnz3PYt5TsNp7tYzbJVA4g7hIVxLovhBkDe4CNkX uQlkSJZgz8HDVT7ahxSrEjgRyB3ednX0xTWn59xKOXCNbw/cx8zf52rYPVDlzPX8UGZT/ fdthllY/yzBQuq4VUecGJflWTdWBjHTz22nH9MDnwZnL1bCNbDbR/Hzn/Mgj8Xjq9fQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796281781; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=d7ukF5qy1No27oJIGElchPEVE2IFCsb1P8B4NQs6VxU=; b=wC0I1NPBsxfMKmHQw2DqQ3Sb1hw87g++M+Z0WHGP9wQvUWvHxnpwUO4MgHyTcSJaz5WJ wa64zJVAFYBPnQj6N/2Wqk7iNWdOQBy/58rHb5DUCpIudeXidk6q2CPej58ycxVFASpY5 dx6J6ye4LrFtGbYlAZdl8q6M7S7Nx6QayWnW5EfY3XoRKaEIvdhQALz0sX7i2i+UK/Kiz NBvG9Jkg77c2ftBsqR3dBhal8IaFDXTtd97TTF+3ZsVlZ91Nq0RgU1Jxnh0muAHJsPVR1 13YIPj2e1lZvNL18TG+wffbT5NdKdUqE5naT9SXLGiIUQltISgCX1IeHFZee7glpomw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Xuvfbe69; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A47D606A32D for ; Thu, 3 Dec 2026 07:09:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Xuvfbe69 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5B9F1F00893; Thu, 3 Dec 2026 07:09:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796281780; bh=d7ukF5qy1No27oJIGElchPEVE2IFCsb1P8B4NQs6VxU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Xuvfbe69Aj+WGatQS8wVRKmMQ1ARaukT0GGACL0uBe2FFc6SHddoboC1RMfwGRtaE EWEBbTXaiiAStYso0st1aofhkcXsdmsK1gGJIADF13cUKVbekkQLX/KgC/m/d5Mfja +abwpmzb2bRvizEGIIAe4hI0b6pF033eNdKfqwWwppxx7N8mJPkPsT8GY4U8LabcGD ++nBX0oXn/EsSGXVcaw7SsS2bpOPr5BlKHCavFlJGW4CJZaMGAcdaMBDNp+i5FhD0D TsOZqfoyh9ziPoUEA1gB36lSAt6nSnEbnjxSJBTleFSk7008zVR1EtBRajMqIZRUhO cxiBSbBb7Svgw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH RFC net-next 2/2] selftests: af_unix: Add test for SO_MAX_DGRAM_QLEN Reply-To: sashiko-reviews@lists.linux.dev To: "Ishu Brar" Cc: sparclinux@vger.kernel.org In-Reply-To: <20261202-af-unix-dgram-qlen-v1-2-043723f83d6d@brar.si> References: <20261202-af-unix-dgram-qlen-v1-0-043723f83d6d@brar.si> <20261202-af-unix-dgram-qlen-v1-2-043723f83d6d@brar.si> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 07:09:40 +0000 X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] selftests: af_unix: missing stddef.h include for offsetof() in dgram_qlen.c - [Low] selftests: af_unix: unprivileged EPERM in dgram_qlen wakeup tests - [Low] selftests: af_unix: missing dgram_qlen entry in .gitignore -- commit 945f90bd1ff3e537024ec7cf72598717163e9cd7 Author: Ishu Brar selftests: af_unix: Add test for SO_MAX_DGRAM_QLEN This commit adds a kselftest covering the SO_MAX_DGRAM_QLEN socket option for AF_UNIX datagram sockets. > diff --git a/tools/testing/selftests/net/af_unix/Makefile b/tools/testing= /selftests/net/af_unix/Makefile > index fb2e09f0f44bb..110cc339598bc 100644 > --- a/tools/testing/selftests/net/af_unix/Makefile > +++ b/tools/testing/selftests/net/af_unix/Makefile > @@ -6,6 +6,7 @@ cc-option =3D $(call __cc-option, $(CC),,$(1),$(2)) > CFLAGS +=3D $(KHDR_INCLUDES) -Wall $(call cc-option,-Wflex-array-member-= not-at-end) > =20 > TEST_GEN_PROGS :=3D \ > + dgram_qlen \ > diag_uid \ > scm_inq \ > scm_pidfd \ [Severity: Low] Should dgram_qlen also be added to tools/testing/selftests/net/af_unix/.gitignore alongside the other binaries in TEST_GEN_PROGS? > diff --git a/tools/testing/selftests/net/af_unix/dgram_qlen.c b/tools/tes= ting/selftests/net/af_unix/dgram_qlen.c > new file mode 100644 > index 0000000000000..7a5f423397311 > --- /dev/null > +++ b/tools/testing/selftests/net/af_unix/dgram_qlen.c > @@ -0,0 +1,243 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* SO_MAX_DGRAM_QLEN: per-socket datagram queue length for AF_UNIX. */ > + > +#define _GNU_SOURCE > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "kselftest_harness.h" [ ... ] > +FIXTURE_SETUP(dgram_qlen) > +{ > + /* A bound receiver, not a socketpair: a receiver whose peer is the > + * sender is exempt from the queue limit in unix_dgram_sendmsg(). > + */ > + self->addr.sun_family =3D AF_UNIX; > + self->addrlen =3D offsetof(struct sockaddr_un, sun_path) + 1 + > + snprintf(self->addr.sun_path + 1, > + sizeof(self->addr.sun_path) - 1, > + "dgram_qlen.%d", getpid()); [Severity: Medium] Does this fail to build because stddef.h is not included for offsetof()? None of the included headers or kselftest_harness.h pull in offsetof() on glibc or musl, so compiling dgram_qlen.c fails with an undeclared identifier error. [ ... ] > +/* Raising the limit must wake a sender blocked in send(), with no recv(= ). */ > +TEST_F(dgram_qlen, raise_wakes_blocked_sender) > +{ [ ... ] > + usleep(200 * 1000); > + ASSERT_EQ(0, set_qlen(self->rcv, 100)); > + ASSERT_EQ(pid, waitpid(pid, &status, 0)); > + ASSERT_EQ(0, WEXITSTATUS(status)); > + close(fd); > +} > + > +/* Same for a sender waiting in poll() for POLLOUT. */ > +TEST_F(dgram_qlen, raise_wakes_poller) > +{ [ ... ] > + usleep(200 * 1000); > + ASSERT_EQ(0, set_qlen(self->rcv, 100)); > + ASSERT_EQ(pid, waitpid(pid, &status, 0)); > + ASSERT_EQ(0, WEXITSTATUS(status)); > + close(fd); > +} [Severity: Low] Will set_qlen(self->rcv, 100) fail with EPERM in raise_wakes_blocked_sender and raise_wakes_poller when the test runs without CAP_NET_ADMIN? The default net.unix.max_dgram_qlen sysctl is 10, so raising the limit to 1= 00 requires CAP_NET_ADMIN and aborts via ASSERT_EQ() before waitpid() reaps the child process. Raising the limit from 2 to a value at or below 10 (such as= 4 or 8, as in limit_applies and lower_keeps_queue) would wake the child witho= ut requiring privileges. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-af-unix-dg= ram-qlen-v1-0-043723f83d6d@brar.si?part=3D2