From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D638367F26 for ; Wed, 8 Jul 2026 09:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.107.17.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783504631; cv=none; b=nrpIBeNMlpgPByR7ct0DNgDMbExNENiygpynIW7yHFVY+As2LzZJKQIPW1CKtLZ/X3hqmFW1JUYUxWyij2o5mw72abp+k2d4AhwiPbs9RUXdXrlp9HYY8ny+wSHao6VqlDsMjQgF4zt9XOn/5CzeEluUEaXG+T8mBAKs6S3sGIw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783504631; c=relaxed/simple; bh=+Wk81+0N1d4OYETYC2dY54NrV9j3xji7yvvjJQ/BHFo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HpplCdV8XPJkDXsutSPvwDu816hV8desXm08anP52L32dmc3pOgaoiDlj3xRUt1CEpBiA2z866sQr6AUASiBR/07c80SycP0LY5VfFegzO9t4Kc9DxgsGMsbS6aInaqHgR1BdKHjXBMR5ZW45OxV8949AWm/iowQ6OUG8FkYyrc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strace.io; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=194.107.17.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strace.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id D5B4872C8CC; Wed, 8 Jul 2026 12:57:08 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id C7C3E7CCB3A; Wed, 8 Jul 2026 12:57:08 +0300 (IDT) Date: Wed, 8 Jul 2026 12:57:08 +0300 From: "Dmitry V. Levin" To: Renzo Davoli Cc: linux-kernel@vger.kernel.org, Andrew Morton , Oleg Nesterov , Shuah Khan , Alexey Gladkov , Eugene Syromyatnikov , Mike Frysinger , Davide Berardi , strace-devel@lists.strace.io Subject: Re: [PATCH v4 2/2] selftests/ptrace: add a test case for PTRACE_SET_SYSCALL_INFO syscall skipping Message-ID: <20260708095708.GA29093@strace.io> References: <20260708090655.38432-1-renzo@cs.unibo.it> <20260708090655.38432-3-renzo@cs.unibo.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260708090655.38432-3-renzo@cs.unibo.it> On Wed, Jul 08, 2026 at 11:06:55AM +0200, Renzo Davoli wrote: > Check whether PTRACE_SET_SYSCALL_INFO syscall skipping semantics implemented in the > kernel matches userspace expectations. [...] > + ASSERT_LT(ptrace_stop, 4) { > + LOG_KILL_TRACEE("ptrace stop overflow"); > + } This assertion is redundant given that ... > + const unsigned int expected_nr[] = { > + __NR_getpid, > + __NR_getpid, > + __NR_getpid, > + __NR_exit_group > + }; > + > + ASSERT_LT(ptrace_stop, ARRAY_SIZE(expected_nr)) { > + LOG_KILL_TRACEE("ptrace stop overflow"); > + } ... there is a more reliable assertion here instead. > + ASSERT_EQ(info.seccomp.nr, expected_nr[ptrace_stop]) { > + LOG_KILL_TRACEE("syscall nr mismatch"); > + } > + switch (ptrace_stop) { > + case 0: > + case 3: > + break; These two cases don't really do anything, feel free to drop them if you like, it's a matter of style preferences. -- ldv