From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 89AFA13C8EA for ; Tue, 25 Nov 2025 11:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764069634; cv=none; b=Rl58InKt54YxthpBTG352GR33ZQoX2QV6JirWhLysS3Q08KUXIQFHgbTp4zjyho+W/G9V2sxuc9UHJAdgDWFBT66Anr/m7So1UR/yq9v/DWQb9eabvhbXpGeEAtbRWCOXPeBQo23fzrlliQpPaKY5q68G8WVltb0lqqf0oFGQvQ= 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.178 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-f178.google.com with SMTP id d2e1a72fcca58-7bc0cd6a13aso3318267b3a.0 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=OkGEdF6/IzPnqQ4PxtfBD9h8SdymNJcwUl+Xis3EW4mc3rJiNt47jQNAAfDcZZpimc WDLVzyAs4yioWXM+xioct/AjKoAwc5bMK32z165HshNyZGz+ysseGokhY/gM3Au45rYI O71GYDC90DC8fOw9OYvQn5NbXo/lDMdnYpdsJjvbbkcBLC8MjvfV1X2WTz8wgYdetH0P gk9IjXKtsvbvTGe1ZPCPg9AssMLUdymPynLCHHnw99kp2zDPpxDwraQekGKtEOk+UdFW N/2v484rIa6uvbsZ4gjw2ofDVoRGxkEXnosm37vaT3mSHHgsROkhpKTfSxh3DXiDolp2 2kRw== X-Forwarded-Encrypted: i=1; AJvYcCW86fasnQD/fjM9sDeKA6dFJETgVU8OSC2/nB7rkU8GAKcy96GB3TykMR06Cc7KOb1YbK/gWadS4crgWKY=@vger.kernel.org X-Gm-Message-State: AOJu0YyIaK8nBJyfW6aSMS4MUOZesddTAPHvjkFiyZmIQmXVf5Uml/Xz rKhNCOWVWoCf7+3TS36V9KXrxINpza//bvd1AC1WZoKz/3B3o2ibkHgV X-Gm-Gg: ASbGncuifbweCZXFqM7QoRr2YgmnsnPaSbbqNsv2uafJ9rOXasBI7Tg7eFFBd7ej/TS vrQ1daFCLKZfUf9kI8A377L3tDf+tc+hXVRu8D7zeDrWPC40WTCf7l+3/mAEy0j93+OJpVUzPIr uO7Wnk+ywUgJmAk1yIbKKUF9pOVwdPUKYlr6dsvKERVU4u3H9Y4v10Mm82u5rFw7HlSwMMrZnps 3LdPMAFITuN+y/EUXdhWTS06uQsppPTkvvc541NWvC7nG+yrwDOJEdvFVEfW+r7WiZ9gb9qHmSY PYkWhJJAqRGYW+Qf/pHajtRBjulmquL/vlUMmjsD0dKxoaClOPD/uh4U6UkycY84eAPCgd5gBfD w1lNDVzgQcJoPC+8XgowZ7N6V0m7HA7YM/qT37LhTFbdnpET2FDtpKvlHH1SETTJ8smXMYvcoap Y03uZRHv2m27aUPYgYyBjGySnehDdN0VvJT+3SkopqxlZo9VJCBaP4ajE4/T4QIeH5j0Xv8ZXll Q/6Pi6ielOPtEUZ X-Google-Smtp-Source: AGHT+IHceA3bqsPjmyCa2TPF6zTj0bq2CPgSfhCVMko2nEB7fZ8pj+ZsS/cB9USjHK3Gmjz3R3UxLg== X-Received: by 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-kernel@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