From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8735DBA4F for ; Tue, 7 Mar 2023 19:10:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05110C433D2; Tue, 7 Mar 2023 19:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678216218; bh=TX69eYVPL/l2Cr7xqU38S5xKf1yGcR63b2Li+V9I49E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X3Vy3Mc86zWlvPJOn4hUO255RLxZ6nq1D5fRB0/6wDI6pOdMz+xSBhkUhIWwXTfak wnWbrkvLmoiW2aWStGAVbQl9ZfYb9AACpk0NxQMs7NE31K8t3nuD6Yrai7WHScgsTs 1RTfB3VWctZ2Dzz40Zw2aLeUybiziTR8YmcEI5FY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikulas Patocka , Sweet Tea Dorminy , Mike Snitzer Subject: [PATCH 5.15 514/567] dm flakey: fix a bug with 32-bit highmem systems Date: Tue, 7 Mar 2023 18:04:10 +0100 Message-Id: <20230307165928.245824274@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307165905.838066027@linuxfoundation.org> References: <20230307165905.838066027@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mikulas Patocka commit 8eb29c4fbf9661e6bd4dd86197a37ffe0ecc9d50 upstream. The function page_address does not work with 32-bit systems with high memory. Use bvec_kmap_local/kunmap_local instead. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Reviewed-by: Sweet Tea Dorminy Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-flakey.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -305,8 +305,9 @@ static void corrupt_bio_data(struct bio struct page *page = bio_iter_page(bio, iter); if (unlikely(page == ZERO_PAGE(0))) break; - segment = (page_address(page) + bio_iter_offset(bio, iter)); + segment = bvec_kmap_local(&bvec); segment[corrupt_bio_byte] = fc->corrupt_bio_value; + kunmap_local(segment); DMDEBUG("Corrupting data bio=%p by writing %u to byte %u " "(rw=%c bi_opf=%u bi_sector=%llu size=%u)\n", bio, fc->corrupt_bio_value, fc->corrupt_bio_byte,