From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A184C26C39E for ; Tue, 25 Nov 2025 11:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764069634; cv=none; b=arckcp9WZ5DXabrie4PQYz1ItX6cNmn/lp4GIriCJCoOYkqPfmOvKyK5V3Jr6eHe98GaeTmcMGU1FCXhi4CPucSl5hm9zfCzGsx7IZYZ2fXhesFofw9OMukJ92SAuf7KsVcdtWrSXrrVGPDLdmf+eUbkUKy7m82dLdKhdRf7fK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764069634; c=relaxed/simple; bh=a4+h+unp3TP1oyr0yJ3XjFYwuxew3KdwZUR593H/1O8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Sv6xNsaL0pRtc/FFZgV2hWD3Hb7eYZ3LJiwVwUpugoV4TKaLX3ozI/mbEfbhWsuDQLH1Fb66Jk9bQT8sjyy43axQTjzyB2qPF7ZVFhwB9hV7Zr+FQxgyKiUr9nmpQcn/hMkAgjzgbG+mvnR8Azaqg8pAOCX4NMANYW8jtBUXW/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=j+WoOOhe; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j+WoOOhe" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-7ba49f92362so3121681b3a.1 for ; Tue, 25 Nov 2025 03:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764069632; x=1764674432; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eVhOQpkFhqqTf3BtOV6vobGzp0Wpfer3ElYSjbBrdyo=; b=j+WoOOhe0UpTZ/8/sOF3ccO+YV+LpBsOELWZTOEeNIwMYCCPkVUmN6xd47eqM4RPA8 AsR+eIG2+0fheyMrJkzTKLEGNsGDXPj0xwLyfXIjmfNl2rtRDUH1lxqlL1+SUjMB1T3F RorpWQQ9LsHnS3Vu5i3xdITgVzT9AF7lFBBJyGopVwSRTury1sS0jz31suLT6fBmT6/0 enuYL/j/FrUckry8sTJcLPQOma3+L1BHzOVUGRsI4GpD736UQzABXZiF6vmf8Kq5EnnE MLco88n8zLTvecRvttmUb9f232prbTo3aM/NyheIHVYxiPCsp6/gl5Fym+v0p/kaUCV1 +7cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764069632; x=1764674432; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eVhOQpkFhqqTf3BtOV6vobGzp0Wpfer3ElYSjbBrdyo=; b=KQudf/yVrJn+9EHAlYsbwOBDkGf36J3efNrEV58p8mn57gjirP8oxA+mX4eofye80i efKm6jfUjYKME9BiIyJ0VEMPq1dSsV4pJcBFXAYhCJmwp7l6UoGaHS2YmzxmA4pK1MXk pnPuf0F5U1Y5bHohFRXpfunSTUK7xZh5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 2002:a05:6a21:99a5:b0:35f:31bb:5a5d with SMTP id adf61e73a8af0-3614f227b8fmr16367798637.2.1764069631818; Tue, 25 Nov 2025 03:20:31 -0800 (PST) Received: from [172.16.132.48] ([119.161.98.68]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7c3ecf7d70asm17822575b3a.13.2025.11.25.03.20.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Nov 2025 03:20:31 -0800 (PST) Message-ID: <8e1ff2f1-b45e-4b1f-b545-d433e277607f@gmail.com> Date: Tue, 25 Nov 2025 16:50:23 +0530 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] selftests/seccomp: fix pointer type mismatch in UPROBE test To: Kees Cook , Shuah Khan Cc: Andy Lutomirski , Will Drewry , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev, khalid@kernel.org, david.hunter.linux@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, Jiri Olsa , sam@gentoo.org References: <20251026091232.166638-2-nirbhay.lkd@gmail.com> Content-Language: en-US From: Nirbhay Sharma In-Reply-To: <20251026091232.166638-2-nirbhay.lkd@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/26/25 2:42 PM, Nirbhay Sharma wrote: > Fix compilation error in UPROBE_setup caused by pointer type mismatch > in the ternary expression when compiled with -fcf-protection. The > probed_uprobe function pointer has the __attribute__((nocf_check)) > attribute, which causes the conditional operator to fail when combined > with the regular probed_uretprobe function pointer: > > seccomp_bpf.c:5175:74: error: pointer type mismatch in conditional > expression [-Wincompatible-pointer-types] > > Cast both function pointers to 'const void *' to match the expected > parameter type of get_uprobe_offset(), resolving the type mismatch > while preserving the function selection logic. > > This error appears with compilers that enable Control Flow Integrity > (CFI) protection via -fcf-protection, such as Clang 19.1.2 (default > on Fedora). > > Signed-off-by: Nirbhay Sharma > --- > tools/testing/selftests/seccomp/seccomp_bpf.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c > index 874f17763536..e13ffe18ef95 100644 > --- a/tools/testing/selftests/seccomp/seccomp_bpf.c > +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c > @@ -5172,7 +5172,8 @@ FIXTURE_SETUP(UPROBE) > ASSERT_GE(bit, 0); > } > > - offset = get_uprobe_offset(variant->uretprobe ? probed_uretprobe : probed_uprobe); > + offset = get_uprobe_offset(variant->uretprobe ? > + (const void *)probed_uretprobe : (const void *)probed_uprobe); > ASSERT_GE(offset, 0); > > if (variant->uretprobe) Hi all, I'm following up on this patch that fixes the pointer type mismatch in UPROBE_setup when building with -fcf-protection. It resolves the incompatible-pointer-types error seen with Clang 19. Please let me know if there are any comments or some changes needed. Thanks, Nirbhay Sharma