From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 99F693AF65F; Sat, 17 Oct 2026 16:51:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792255891; cv=none; b=DoOOiC63fzoDbp8GnLogndbUVlvNAandCZw72kov9NSVyY506wNd19X+ohMqY5VuZjujE2WfjShd/BTnL0xhL9mkz9j1NDPxnEFvYG1zSjCpCZBewqnj/xIIVhGYsKKcQezSM5TUR6a3zJ0/e/cji7l3fXKFcNmeFcczk9+0/vI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792255891; c=relaxed/simple; bh=u9HZm9LD19kWly0oPaUyVo1fpURB+QSZXKwgWoervkM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LRCUM1CgJ+oLXNVjygTbW/OT6HJxrSQ1c+LL1Ohhj6Z6htmEznwTwISZYK1mCgr/BVXGXYRGYa4a5YQG37BKG1s2aaLfuhY5g5rgHFI39VmjlnoWdMb5uvpO+Vd9nbSgr2KWfNfkzXYWdBYDko8yuazbvbyw0QxwWz8ey9eK0/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uDCYpyxP; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uDCYpyxP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04ED81F000C4; Sat, 17 Oct 2026 16:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792255890; bh=veYk5WxeWjPmW9hJEPXHoNVpdMScl6qLDc6r1Nj7+Qs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uDCYpyxP2jb6lN3x4FN0tuAmffFMVoHLqjP47jqUxYAv6cnXys/Ot6WiaZARkHdiu wrA+8j6ygKj2rp20SzNQucRaZ0f9X+fIYlGeoeZmUb17KXPHMSc6rHGI8B5DlEZ+wa i/MMHoY/eAGh9zgaExZ/IYEMY/xfIx9ZDH32wdfw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sergey Senozhatsky , Chris Mason , Brian Geffon , David Stevens , Minchan Kim , Richard Chang , Andrew Morton , Sasha Levin Subject: [PATCH 6.6 0054/1674] zram: fixup read_block_state() Date: Sat, 17 Oct 2026 17:38:46 +0200 Message-ID: <20261017160432.526477347@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sergey Senozhatsky [ Upstream commit 8b05d2d8af817c6a1e23032df51e7ad83030d543 ] ac_time is now in seconds, do not use ktime_to_timespec64() [akpm@linux-foundation.org: remove now-unused local `ts'] [akpm@linux-foundation.org: fix build] Link: https://lkml.kernel.org/r/20260115033031.3818977-1-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky Reported-by: Chris Mason Closes: https://lkml.kernel.org/r/20260114124522.1326519-1-clm@meta.com Cc: Brian Geffon Cc: David Stevens Cc: Minchan Kim Cc: Richard Chang Signed-off-by: Andrew Morton [ Stable tree note: The ac_time conversion described above is not present here, so retain the ktime_t conversion and microsecond output. Move the timespec64 temporary into the scan loop instead, allowing the follow-up bounds fix to move nr_pages initialization under init_lock cleanly. ] Stable-dep-of: 391f057f44a5 ("zram: fix out-of-bounds access in read_block_state()") Signed-off-by: Sasha Levin --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 0c422e4179ad5..91a1cec8a6e3f 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -879,7 +879,6 @@ static ssize_t read_block_state(struct file *file, char __user *buf, ssize_t index, written = 0; struct zram *zram = file->private_data; unsigned long nr_pages = zram->disksize >> PAGE_SHIFT; - struct timespec64 ts; kbuf = kvmalloc(count, GFP_KERNEL); if (!kbuf) @@ -894,6 +893,7 @@ static ssize_t read_block_state(struct file *file, char __user *buf, for (index = *ppos; index < nr_pages; index++) { int copied; + struct timespec64 ts; zram_slot_lock(zram, index); if (!zram_allocated(zram, index)) -- 2.53.0