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: 805994 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp377486wrt; Thu, 20 Jun 2024 09:24:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX96BktG/sn+vgAzCV2Q4/SqvhdAp/1wSNi4xCd2HhYc9thge+sX7pW3DuNyxP8GBKT/azPpUeLEHyUwUGbQxDV X-Google-Smtp-Source: AGHT+IFMJnFfSYbb9VIoV50kfW26fFB+5Vhg4GDQXmB/h9vDeDpjjdL1aTiHOpMTjWdD3uomGLro X-Received: by 2002:a05:6808:23cf:b0:3d1:ff7c:a957 with SMTP id 5614622812f47-3d51bb037e7mr5231575b6e.53.1718900655336; Thu, 20 Jun 2024 09:24:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718900655; cv=pass; d=google.com; s=arc-20160816; b=0s9YIVQS5frNc+wscY1H7JcLk0FRYm/IpI5T/3QXzarNf20LLqq36jJ6Vje8C+oDPz MPdioPJTuPmlbX2pv9kFU8p7KSG3TArw4D/LAN77x5WDaeJCmxVB3YtWECTvpefFQeED D4uYJarK77UEEZTRb5mr0zS4lh7fjXsf4Q2k1vkGCLBxvS9y0N57ft3ZdRsPeXZTRgOT M8sOLeop/PcTnIuTaZhoqCh63xf39WirgBq8WP/wpQ5zUeuiMDSI6RBzbwO4Yqpmh8cH RjeKLP/lTopD8Ih6nq4g3Ri31gDX8V7Xa3s8MLGNJyy/qntoZfkPoqPc5EcJNqYyqhbm XXBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=dM7iPDKCly3/XX+LCTJnpYbNZdM4qNmVsCpF/rYcRpU=; fh=xSIq547Z/8+2mwrThk5NmWwnmadq1eVmQ35PeXz4rpA=; b=fmOtmyN3rNyTMRiwoSpnb2gPpXYwiPcNXcP/J1p71G8hWvAFkI9cQTwE+2TL+uQ1eA ANaBuUqTJnvnVapMSdyO9g456mGb/g76UVMMMKg8sgswDfSwrXp/bCbVjvFPA6UgrNrk z0VIq/FCt3z7UqwQORHzOs3qzJcqftVr/PJGV1KEIPnXzWiw7LdpKn/5c9WjbhlQxIxd YE3yWzhxWBOVsEVyoGecAz0AEygoB6RHySSWxG1Fw+c7fPEB5AxclxgGh/Xc8NNXFDEt OmuHgBCbiVh261JWi7D8l5/fuISDx0uJKpZG7J/2R3hnQD67nKbq8pIW/B22BQaML/Co NLVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AaWGCEH0; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a1e0cc1a2514c-80d78a7d676si3110389241.187.2024.06.20.09.24.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 09:24:15 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AaWGCEH0; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E3D9E3894C2E for ; Thu, 20 Jun 2024 16:24:14 +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+patch=linaro.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