From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B089D3EFFD5 for ; Fri, 10 Jul 2026 08:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783671417; cv=none; b=o0OmcCgD3W1OvEk89uKAbzxMtibKvtNu9x4hHTV3firCLPs7uG2QccpHm3tv09scXCqmUEPljVIGta6crYL3AL3taHYh3cpk/KP2td9xiSoVNYDrpfcjVdX1eWTfnHSv5nYGYwX27S4OMefVB/T1NGufh4gJrjNPwP8XHYbn2PM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783671417; c=relaxed/simple; bh=7KIc5ogxZwWrfJnko7PciiNQQWmWczwA7bDSRUvGObU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QfRgMDTha5LC5hYDEX5bEUg2EeCVJ81L5loTA4ANduHTZERNKdEOCIskY+02Ol38S2OM7gfQqBiahW24D1vSsMj2rgXDxLMqrQJkhjfEcwdP53Zi5QPxQUo9LuYtqo13znOtn7PPMKQkkAEfYDFPYfUDFubh41yq4SZbI9NnZmE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DatQq7zq; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DatQq7zq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783671414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=v4vUaGFk2l9Uqurf0ksjXpb4C/iQo+zejwWRDADYgb8=; b=DatQq7zqepbmgjCIt7HS+hWbHHc+5miqP+mKJjX0WAR8XYqL0zvYwDG7i8yYQm80VFzT0L gHB6r73LdkBoQ7+P5mgkCagmGMh0y0AHrvq5E/E5D2G9FjBigo49xOnZ2WF1kIU5PvYg5L Knsha/KR87+nPWjVr6vSApyMmfMJoQ0= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-rJpTrNr0MlibO6VsPMNLIg-1; Fri, 10 Jul 2026 04:16:49 -0400 X-MC-Unique: rJpTrNr0MlibO6VsPMNLIg-1 X-Mimecast-MFC-AGG-ID: rJpTrNr0MlibO6VsPMNLIg_1783671408 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 13E6A1801BE5; Fri, 10 Jul 2026 08:16:48 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.49.56]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3ACA8180028B; Fri, 10 Jul 2026 08:16:43 +0000 (UTC) From: Thomas Huth To: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , =?UTF-8?q?G=C3=BCnther=20Noack?= , linux-security-module@vger.kernel.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests/landlock: Skip scoped_signal subtest with MSG_OOB if not available Date: Fri, 10 Jul 2026 10:16:42 +0200 Message-ID: <20260710081642.405916-1-thuth@redhat.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 From: Thomas Huth MSG_OOB might be disabled in the kernel for unix sockets (by not selecting CONFIG_AF_UNIX_OOB), and in this case the related tests of the scoped_signal_test are currently failing. Add a runtime probe using socketpair() to detect MSG_OOB support and skip the test gracefully if it is unavailable. Signed-off-by: Thomas Huth --- .../selftests/landlock/scoped_signal_test.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/testing/selftests/landlock/scoped_signal_test.c b/tools/testing/selftests/landlock/scoped_signal_test.c index 58d25157fe781..3cf20d769f2bc 100644 --- a/tools/testing/selftests/landlock/scoped_signal_test.c +++ b/tools/testing/selftests/landlock/scoped_signal_test.c @@ -398,6 +398,24 @@ static int setup_signal_handler(int signal) return sigaction(SIGURG, &sa, NULL); } +/* + * MSG_OOB might be disabled in the kernel via the CONFIG_AF_UNIX_OOB + * switch, so this function can be used for probing for its availability. + */ +static bool has_af_unix_oob(void) +{ + bool available = false; + int sp[2]; + + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) == 0) { + available = (send(sp[0], ".", 1, MSG_OOB) == 1); + close(sp[0]); + close(sp[1]); + } + + return available; +} + /* clang-format off */ FIXTURE(fown) {}; /* clang-format on */ @@ -460,6 +478,9 @@ TEST_F(fown, sigurg_socket) int pipe_parent[2], pipe_child[2]; pid_t child; + if (!has_af_unix_oob()) + SKIP(return, "CONFIG_AF_UNIX_OOB / MSG_OOB not available"); + memset(&server_address, 0, sizeof(server_address)); set_unix_address(&server_address, 0); -- 2.55.0