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=1796384945; b=tONkKxNl0lK7+BqtWj/kQJJrhRnPMHqi0DrPDxQ+RaasgxCSHabatIzWD9EqBUqCZWM1 SoAYcgotdEsl7G6cx2batKnQbIfsDDNxLYROskyDZMhXIPdHczs18ONo0zCokB143dHxD zJ0xAWfvUKgBKsR/5EUha/5UL5o5Y2qVJYbOFikahlDF3FlAddruxKZuHQkFdH1qV0B8B 3Fy4SIliIEFR6xqMANdjaWqNCdSm1WIBZ92W9ztQOj43Bc1yGmvwm1T3jamG8pnidtB+f 9e2m0UTeOlYeofDLuaH+XF0EHUU5ryy71lX5lMIhLt457r1s6r87CKZCGZQZjlzNtxQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384945; 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=Gl1xSi8j+3DyNXtnpWOUJsCR3woR/3UGcmo0jPFh1bo=; b=X6TFuRbQyUJ00JfJz+ANdX1OS3itFGv9gyPPomOO2xpSnK2WkHajyz0gLNNXprgWFsiS ldCm8sWfzmAtUz5ACpzf1hN9qK2gY52+S6AjlnBt6cCEcKx1n0c34wBDd0P53TXG4aCgQ 4YydojOJH+Rz5xHsuiyCbLI2LtATcmoRG5gLRjZA9IM5G9TsPa0xjrdoC65IdB4039HUV /O+d2xZV7y2aXplTvjRZRL5uyl5zBibN8X4fym/ZfxrhHRz9iK2pbjTW3KurCzmLV8cCg 7KjhYgAjtE05OY33rZIXQNhBELvJLU2Y3vN3AS2ntSdMZPT6E4GEgfrobp++p8rMo9Q== 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="tEPN/hI2"; 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 D2048606A322; Fri, 4 Dec 2026 11:49:05 +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=tEPN/hI2 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3C4D1F00897; Fri, 4 Dec 2026 11:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384945; bh=Gl1xSi8j+3DyNXtnpWOUJsCR3woR/3UGcmo0jPFh1bo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tEPN/hI2ndhCzyBwLx6HoWIdACRF2a0a3TxHwQeaKCvUt+aUdNNkFwKmkV0KBcQ8z WO8aDQ6WakhDdIUZQ22VUxhnS2xKzp72ZBedCQ0LKSd8jqcgq8LR0V47xGdR1z7x3h kp1xQsFaMPZ8Sj9NqXR1OHvX0dVfR7EwqURjUt9A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alexandra Winter , Julian Ruess , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 0357/1167] s390/ism: Zerorize dmb at allocation Date: Fri, 4 Dec 2026 18:56:24 +0900 Message-ID: <20261204100711.285624816@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexandra Winter [ Upstream commit a0227fa24e8a2a0397cc4eb669731ff8d9161bbd ] Sashiko reported [1] that 'Missing __GFP_ZERO in folio_alloc() causes uninitialized kernel memory to be exposed in the receive message buffer'. An ism dmb is receive-only, so the data is not leaked to a remote peer. In general the smc kernel module (dibs client) will only push newly received data to userspace. We still should not have uninitialized data in a receive buffer. Since commit 750afb08ca71 ("cross-tree: phase out dma_zalloc_coherent()") dma_alloc_coherent no longer required the __GFP_ZERO flag, but when commit 83781384a96b ("s390/ism: Properly fix receive message buffer allocation") switched to folio_alloc(), it should have added back the __GFP_ZERO flag. Add __GFP_ZERO flag and state in dibs.h that register_dbm() provides a zerorized buffer (dibs_lo already does). Link: https://lore.kernel.org/linux-s390/20260903143746.A5CC41F00A3A@smtp.kernel.org/ [1] Fixes: 83781384a96b ("s390/ism: Properly fix receive message buffer allocation") Signed-off-by: Alexandra Winter Reviewed-by: Julian Ruess Link: https://patch.msgid.link/20260928151420.383105-1-wintera@linux.ibm.com Signed-off-by: Jakub Kicinski [ sashal: Adapted the hunk to the older driver, where ism_alloc_dmb() takes struct ism_dev/struct ism_dmb instead of dibs_* types, and dropped the dibs.h kernel-doc hunk because that file doesn't exist. ] Signed-off-by: Sasha Levin --- drivers/s390/net/ism_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index 183b2f274ebdd..4a76d6144f174 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -327,7 +327,8 @@ static int ism_alloc_dmb(struct ism_dev *ism, struct ism_dmb *dmb) return -EINVAL; folio = folio_alloc(GFP_KERNEL | __GFP_NOWARN | __GFP_NOMEMALLOC | - __GFP_NORETRY, get_order(dmb->dmb_len)); + __GFP_NORETRY | __GFP_ZERO, + get_order(dmb->dmb_len)); if (!folio) { rc = -ENOMEM; -- 2.53.0