From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C484F368D5E for ; Wed, 24 Jun 2026 13:34:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782308070; cv=none; b=au1siD2AGikM1Y1yplxWAiujhMZsMA/55P2Z6ZhS6l9BdMqPMz07xsyZVSlukNbsJe1TqTJU8QmMxxgQLbCRaOA3mmaABa8qQ1FZjFKGedDPo3IIjaAdli/o6GHigKVwtY8pfh0jaFC65JanPWqv1Or/FmYI1D1C3faKfJxGpHw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782308070; c=relaxed/simple; bh=AM/m6QUx+7HmbzlJxUPHx4TvQOgm3V9jyXvmAIwwqI4=; h=Message-ID:Date:MIME-Version:Subject:To:References:From:Cc: In-Reply-To:Content-Type; b=HzsqdytRLt/JJe8twT6HzrOhuScJQC3Cdy4oAEpYZ/kJS3/gPJzUU6jzx24XxTTjxDGNDpLF/XuvdfOkhy0oyZzqkuRYtU9pHUV8feFMrh68CRLNhVARum0U8TDzNPGp+ZqA69Wc0sXSobElEWyRebG1DabXibqUrttWcgZ8Rdg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=Th7r1J3u; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="Th7r1J3u" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B3732008; Wed, 24 Jun 2026 06:34:22 -0700 (PDT) Received: from [10.2.213.11] (e137867.arm.com [10.2.213.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E81773F632; Wed, 24 Jun 2026 06:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1782308066; bh=AM/m6QUx+7HmbzlJxUPHx4TvQOgm3V9jyXvmAIwwqI4=; h=Date:Subject:To:References:From:Cc:In-Reply-To:From; b=Th7r1J3uAsKYc2dcNvUt3pcSlTWu0LFbMoJVOxJKVHUmBXGW1ky0aS/6JLwwrtcRt jcGgtNO1re/hQ7QWO9Ch04913KtFC85ujJ6e6GbZ6T0TpMOCTVvv0ZSgKbWRZWVfYD CGiNI6HJrNWxscZlxJZMIfwLkjzDxSNEH+zooJaA= Message-ID: Date: Wed, 24 Jun 2026 14:34:17 +0100 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 v15 01/11] entry: Fix potential syscall truncation in syscall_trace_enter() To: Jinjie Ruan References: <20260511092103.1974980-1-ruanjinjie@huawei.com> <20260511092103.1974980-2-ruanjinjie@huawei.com> From: Ada Couprie Diaz Cc: Ada Couprie Diaz , catalin.marinas@arm.com, will@kernel.org, oleg@redhat.com, tglx@kernel.org, peterz@infradead.org, luto@kernel.org, kees@kernel.org, wad@chromium.org, mark.rutland@arm.com, yeoreum.yun@arm.com, linusw@kernel.org, kevin.brodsky@arm.com, ldv@strace.io, thuth@redhat.com, james.morse@arm.com, song@kernel.org, anshuman.khandual@arm.com, broonie@kernel.org, ryan.roberts@arm.com, pengcan@kylinos.cn, liqiang01@kylinos.cn, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Language: en-US, en-GB, fr Organization: Arm Ltd. In-Reply-To: <20260511092103.1974980-2-ruanjinjie@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/05/2026 10:20, Jinjie Ruan wrote: > In syscall_trace_enter(), the current logic returns "ret ? : syscall". > While __secure_computing() currently only returns 0 (allow) or -1 (kill), > this "ret ? : syscall" pattern is conceptually flawed. > > If __secure_computing() were to return a non-zero value that isn't -1, it > would unintentionally override the actual system call number. This logic > is redundant because if seccomp denies the syscall, the execution path > should already be handled by the caller based on the error return, rather > than conflating the return code with the syscall number. > > Fix it by explicitly returning the syscall number. This ensures > the syscall register remains untainted by the trace return values and > aligns with the expectation that seccomp-related interceptions are > handled via the -1 return status. > > Cc: Thomas Gleixner > Fixes: 142781e108b1 ("entry: Provide generic syscall entry functionality") > Signed-off-by: Jinjie Ruan > --- Reviewed-by: Ada Couprie Diaz