From patchwork Thu Jun 20 16:23:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 92561 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9837F3894C0D for ; Thu, 20 Jun 2024 16:24:36 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by sourceware.org (Postfix) with ESMTPS id F377E3894C01 for ; Thu, 20 Jun 2024 16:23:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F377E3894C01 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F377E3894C01 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2604:1380:40e1:4800::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718900642; cv=none; b=O9Xp8y0A94tiDGSfxdIbM6rUy4at1wrrvrVnJWHl+HC6jifm/sDh9pffXWvBJ6VCT1RUwq8lhDoALzmtBE6a0bQ6b/MpkzAQjtYMIahKyHzIqggm6B90we5jxLqgvm5EEWIyQcUBEW0MbWEtJgc6/Ti1T+mNtowYhEjwY5KVduk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718900642; c=relaxed/simple; bh=Doj0//VPfq9z758xR2+yZ79Db+NeekZ0EoHrfr9q2Q0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=x5WGxX1som91nWgZiinSJiyglaqKvS9UJx1zLmrTn0A3AgYbva8SS/AAcHzCVZOzstgZMTKJqWqXmO/5LDLCypQ8g83lHPn0rvrbQAvw+SAESwen+nRK+gq4vW+cGv/ku6X2kVsu2X9/7JkzanzjEJsQBDDPxpgnrtpZ7mTM01o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 6A3ABCE2741; Thu, 20 Jun 2024 16:23:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECB5EC4AF07; Thu, 20 Jun 2024 16:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718900636; bh=Doj0//VPfq9z758xR2+yZ79Db+NeekZ0EoHrfr9q2Q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AaWGCEH0FUtHpMS1MWl92zyMC/tgI55ZbXl6tZ3t5C3/D90MhQY7LMPv52sRtXgX7 /tDHOQ6fobnn4uVWb5vNTuBQIwEAxDas3AiEfhSop6feRAWhRnZ+da7P7VMngnhmkk uKday5m0uC0pCQIfQjJmNfph+BSKsE6mupZiTK4nCMh6ev02nOQHZHAifS9GhfJcf8 Av2+SR2IBKxnqrqNk3UUKHECPl0wYIrYeODFjmzBUOQioGFpi7EdScbEqPk5DdwfzV /j7R+AlsEtHGaZd/7u8r6X3V3OMunqnE6kTRg7ZdDsGpPmUCRt3Q2a3/R9uSNNqkgU 9t5D3HmhZEJ5Q== From: Arnd Bergmann To: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Helge Deller , linux-parisc@vger.kernel.org, "David S. Miller" , Andreas Larsson , sparclinux@vger.kernel.org, Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N . Rao" , linuxppc-dev@lists.ozlabs.org, Brian Cain , linux-hexagon@vger.kernel.org, Guo Ren , linux-csky@vger.kernel.org, Heiko Carstens , linux-s390@vger.kernel.org, Rich Felker , John Paul Adrian Glaubitz , linux-sh@vger.kernel.org, "H. Peter Anvin" , Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, libc-alpha@sourceware.org, musl@lists.openwall.com, ltp@lists.linux.it Subject: [PATCH 03/15] mips: fix compat_sys_lseek syscall Date: Thu, 20 Jun 2024 18:23:04 +0200 Message-Id: <20240620162316.3674955-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240620162316.3674955-1-arnd@kernel.org> References: <20240620162316.3674955-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org From: Arnd Bergmann This is almost compatible, but passing a negative offset should result in a EINVAL error, but on mips o32 compat mode would seek to a large 32-bit byte offset. Use compat_sys_lseek() to correctly sign-extend the argument. Signed-off-by: Arnd Bergmann --- arch/mips/kernel/syscalls/syscall_o32.tbl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl index 85751c9b9cdb..2439a2491cff 100644 --- a/arch/mips/kernel/syscalls/syscall_o32.tbl +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl @@ -27,7 +27,7 @@ 17 o32 break sys_ni_syscall # 18 was sys_stat 18 o32 unused18 sys_ni_syscall -19 o32 lseek sys_lseek +19 o32 lseek sys_lseek compat_sys_lseek 20 o32 getpid sys_getpid 21 o32 mount sys_mount 22 o32 umount sys_oldumount