From nobody Sun Oct 5 16:18:16 2025 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) (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 BF1C2487BE for ; Fri, 1 Aug 2025 02:50:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=183.62.165.209 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754016607; cv=none; b=q2X/GecWS8C0My/9SixrJ7TmvGKpeyqqnsSWisTu98EMVECyYzQvc4RADRULjtUA4DGExb1QdlKF1+jVQvAXOF2kcq/KCzkr9gh7bo1qDeaQUdUyRnk9ljqAn8zs7Oakyj+dxAyez+WG9z1x3L10Cr9erGXoUJfkRKPp73zKhtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754016607; c=relaxed/simple; bh=MqDXBQ1oPnFaUWMVYYS9aaAOQed3q/QU16mTcUNZPro=; h=Date:Message-ID:Mime-Version:From:To:Cc:Subject:Content-Type; b=oKXxIdkQpVm4wsPf4jq4YnP6xIu+2O8RXUWEOM45ukoMXSNpTC/5NhdNoaIcUqmW+90n/GANGIoCZDG8jMUJvUFhKJMtgPRsHGm5e8ltj8jGTEh5Nldmvdi39/190Dx1aTCKYa0l/JGHb4A+8msEWQlRdvjN/D2crE0hr1I/whQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=183.62.165.209 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (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 mxct.zte.com.cn (FangMail) with ESMTPS id 4btVmR0ZDYz5B15M; Fri, 01 Aug 2025 10:49:59 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl2.zte.com.cn with SMTP id 5712nlsR073301; Fri, 1 Aug 2025 10:49:47 +0800 (+08) (envelope-from liu.xuemei1@zte.com.cn) Received: from mapi (xaxapp04[null]) by mapi (Zmail) with MAPI id mid32; Fri, 1 Aug 2025 10:49:48 +0800 (CST) Date: Fri, 1 Aug 2025 10:49:48 +0800 (CST) X-Zmail-TransId: 2afb688c2b4cffffffffbab-fbbcd X-Mailer: Zmail v1.0 Message-ID: <20250801104948133AaMr5S6E382PbNNhoJgHA@zte.com.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?UTF-8?B?W1BBVENIIFJFU0VORF0gcmlzY3Y6IG1tYXAoKTogdXNlIHVuc2lnbmVkIG9mZnNldCB0eXBlIGluIHJpc2N2X3N5c19tbWFw?= X-MAIL: mse-fl2.zte.com.cn 5712nlsR073301 X-TLS: YES X-SPF-DOMAIN: zte.com.cn X-ENVELOPE-SENDER: liu.xuemei1@zte.com.cn X-SPF: None X-SOURCE-IP: 10.5.228.133 unknown Fri, 01 Aug 2025 10:49:59 +0800 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 688C2B57.000/4btVmR0ZDYz5B15M Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jessica Liu The variable type of offset should be consistent with the relevant interfaces of mmap which described in commit 295f10061af0 ("syscalls: mmap(): use unsigned offset type consistently). Otherwise, a user input with the top bit set would result in a negative page offset rather than a large one. Signed-off-by: Jessica Liu --- arch/riscv/kernel/sys_riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index d77afe05578f..795b2e815ac9 100644 --- a/arch/riscv/kernel/sys_riscv.c +++ b/arch/riscv/kernel/sys_riscv.c @@ -10,7 +10,7 @@ static long riscv_sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, - unsigned long fd, off_t offset, + unsigned long fd, unsigned long offset, unsigned long page_shift_offset) { if (unlikely(offset & (~PAGE_MASK >> page_shift_offset))) -- 2.25.1