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.129.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 1F516495539 for ; Thu, 13 Aug 2026 17:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786640724; cv=none; b=uXVg1cc1dw6SzMo8l1Ohu7ugZQkL6gYzkk9IVQMiLqJxaryWUmXXWQSerFdUA5QSTwOV/rZ5qchqsFnt39QmKOr3+H6Sj5fyKVHzy2hs8pULoxmRi//1IRujMZKW+S95hZHmxinkxJT7yOcphcDFXPHhluxTXi0PpDPvT9c3HZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786640724; c=relaxed/simple; bh=IeB67JuyzakqY1S7Y0qG7Z83fsUgRUkVDzxqGH/T7BQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QojYk/GaLCBzsTTE93T2eI1n6Q2knpqUJJqXImJeDn1Z+w5LSwKDVnxA5iGmjUbZr5BUaHqkEQHkcrGFA6hDEuPOUvM6RZ3Zus5veoNEEcxY7ZpiDQyQwJ4gQgjb4tI1zX6/iENnHpWJ59ldjVlrDAVl/qG1UgOqdL4r7mfJbFU= 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=O8HEvH9U; arc=none smtp.client-ip=170.10.129.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="O8HEvH9U" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786640722; 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: in-reply-to:in-reply-to:references:references; bh=rmq0hRGs7XLSkpGEwHv2UKKAjTQAHgK3a7MrJIwRAjY=; b=O8HEvH9UHjHXYHyK0u2PyATa+Y3XWhiNhXRv5ABDGnqticWqVXjWDfp9Qo34FDGwPohmEZ IvbPgQU5LAUh96btAMTI1r7dvsKt7A3RH5NbRgbr5oEuiTbp+GmQ6dJQgSYN8/fuXMqu1G 8wi7DTe97GE/++zq2CLJwSK1w36Y8SU= 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-321-ArqhbR0JPReXkqbQc_9JUg-1; Thu, 13 Aug 2026 13:05:20 -0400 X-MC-Unique: ArqhbR0JPReXkqbQc_9JUg-1 X-Mimecast-MFC-AGG-ID: ArqhbR0JPReXkqbQc_9JUg_1786640715 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 E37A91800643; Thu, 13 Aug 2026 17:05:14 +0000 (UTC) Received: from wsxc.redhat.com (unknown [10.96.134.24]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DBDD3195608A; Thu, 13 Aug 2026 17:05:02 +0000 (UTC) From: Ricardo Robaina To: audit@vger.kernel.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, bpf@vger.kernel.org Cc: paul@paul-moore.com, eparis@redhat.com, sgrubb@redhat.com, oleg@redhat.com, richard.henderson@linaro.org, mattst88@gmail.com, linmag7@gmail.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, guoren@kernel.org, monstr@monstr.eu, tsbogend@alpha.franken.de, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com, James.Bottomley@HansenPartnership.com, deller@gmx.de, ysato@users.sourceforge.jp, dalias@libc.org, glaubitz@physik.fu-berlin.de, davem@davemloft.net, andreas@gaisler.com, richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net, chris@zankel.net, jcmvbkbc@gmail.com, tglx@kernel.org, peterz@infradead.org, luto@kernel.org, Ricardo Robaina Subject: [PATCH 07/13] mips: pass all six syscall args to audit_syscall_entry() Date: Thu, 13 Aug 2026 14:02:57 -0300 Message-ID: <212ca026f8a19f564f3b37b03d1d3e09e0de3e47.1786626275.git.rrobaina@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Use syscall_get_arguments() to retrieve all six arguments portably. On 32-bit MIPS (O32 ABI), arguments 5 and 6 live on the user stack rather than in registers, so direct register access would be wrong. Signed-off-by: Ricardo Robaina --- arch/mips/kernel/ptrace.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 3f4c94c88124..9e6f9accdb41 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -1334,9 +1334,14 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs) if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) trace_sys_enter(regs, regs->regs[2]); - audit_syscall_entry(current_thread_info()->syscall, - regs->regs[4], regs->regs[5], - regs->regs[6], regs->regs[7]); + { + unsigned long args[6]; + + syscall_get_arguments(current, regs, args); + audit_syscall_entry(current_thread_info()->syscall, + args[0], args[1], args[2], args[3], + args[4], args[5]); + } /* * Negative syscall numbers are mistaken for rejected syscalls, but -- 2.55.0