From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382742; b=rrfEMDm9mwq7nFfMKCdKBL58cUTAIpOwoe6e9aGicpAfHDqKUWEEK3gR9+7WMFVlqJqq 6q6lU8w+GQzjYNShJ/dccLuaQ+X9UDdAW91lqQ9s262pFssyBY279wyX/ZX7KfZs+SZvm G0rTHrz+IX9/RhX3lqLfSGhRZqikQmyp2Fdx576gwmDX7CPzGZgFUeVayAAufPwIIv2yb qna1FHgTYRzCsHW9+pCt39Nlgd1U1/CZInayvZ91O1OF3eDY4YwTyuZGBcJN2GuYVqwt7 mOPB/4+3Tkw/+lrc4rGLw3p3g2USElm/uRKh9YByGnhiEIvrAF+QiI2Ty8dDjWD5cig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382742; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=5x+J5NdiKPrBsRI/n/LdBXpXXWAOXM2TBcosgCA0hIM=; b=AWuAeX+7JmEgC3AcQ9iV2y3m+7ggIo/1/uL5kA6C/PuOW0riPBhvQSk/Ehnu+M0EOSTX 0q485j8Rk8KfVONCr8jaepNrSbViCiIbG1jcy27t02hK4dumxeQrDOPLi8QrGjVKH8BBq iVzMCmtTqDq+gh6JUKdano3ocAOcppzZsT9ETMVlR18nC1Z5FhTy90KxnIkH2AVyRrmLI j+F52RIqsBN0GntCv1wZWeM/ZTse2AF1/38QzKsyqYJam72RQ5MHLSCu3hSetcN+7S33s vH2jX48KlEu+Q8NXyeYyYo2L2uRJpdHTP8ryhXFCaTLJN8AF2IFFYo/tRGVVZ04KmVA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SjYfuYRa; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4747606A686; Fri, 4 Dec 2026 11:12:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SjYfuYRa Received: by smtp.kernel.org (Postfix) with ESMTPSA id C17DE1F00931; Fri, 4 Dec 2026 11:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382742; bh=5x+J5NdiKPrBsRI/n/LdBXpXXWAOXM2TBcosgCA0hIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SjYfuYRaCIdoDVtbyL9tml/xKJud509o1EQoJ3bWQeklg2XhnknEP1Xd5Ydg47tQf 1tNk9xHo2rbtoPcbCBPVDWqofpBp9nJ81xB+LJLKqSCbUlygUCNDMAdzPt40SSdBon dY/JeSkiPHr880L1279uMAct34jkrFICHUyQF1Dw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ding Feng , Damien Le Moal Subject: [PATCH 6.18 544/703] zonefs: ignore RLIMIT_FSIZE above LLONG_MAX in zonefs_write_check_limits() Date: Fri, 4 Dec 2026 19:07:23 +0900 Message-ID: <20261204100642.253325833@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ding Feng commit fb5289b697c965581104bafdd875b969a1db3e79 upstream. zonefs_write_check_limits() follows generic_write_check_limits() and has the same problem: it stores rlimit(RLIMIT_FSIZE), an unsigned long, in a loff_t, so a soft limit between 2^63 and RLIM_INFINITY is negative and every write fails with -EFBIG and raises SIGXFSZ. Keep the limit unsigned and apply it only when it is at most LLONG_MAX, as the generic helper now does. Fixes: ebfd68cd0c1e ("zonefs: Fix O_APPEND async write handling") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-5-5 Frama-C Signed-off-by: Ding Feng Signed-off-by: Damien Le Moal Signed-off-by: Greg Kroah-Hartman --- fs/zonefs/file.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/fs/zonefs/file.c +++ b/fs/zonefs/file.c @@ -401,15 +401,16 @@ static loff_t zonefs_write_check_limits( { struct inode *inode = file_inode(file); struct zonefs_zone *z = zonefs_inode_zone(inode); - loff_t limit = rlimit(RLIMIT_FSIZE); + u64 limit = rlimit(RLIMIT_FSIZE); loff_t max_size = z->z_capacity; - if (limit != RLIM_INFINITY) { - if (pos >= limit) { + /* No file position reaches a limit above LLONG_MAX. */ + if (limit != RLIM_INFINITY && limit <= LLONG_MAX) { + if (pos >= (loff_t)limit) { send_sig(SIGXFSZ, current, 0); return -EFBIG; } - count = min(count, limit - pos); + count = min(count, (loff_t)limit - pos); } if (!(file->f_flags & O_LARGEFILE))