summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAlexandra Winter <wintera@linux.ibm.com>2026-09-28 17:14:20 +0200
committerJakub Kicinski <kuba@kernel.org>2026-09-30 17:36:00 -0700
commita0227fa24e8a2a0397cc4eb669731ff8d9161bbd (patch)
tree25cb9ffdc55333ebbb4cc3afbee73f7780090993 /include/linux
parent22691f0128a0155abc997eb10e108809599d7ebd (diff)
downloadlinux-a0227fa24e8a2a0397cc4eb669731ff8d9161bbd.tar.gz
linux-a0227fa24e8a2a0397cc4eb669731ff8d9161bbd.zip
s390/ism: Zerorize dmb at allocation
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 <wintera@linux.ibm.com> Reviewed-by: Julian Ruess <julianr@linux.ibm.com> Link: https://patch.msgid.link/20260928151420.383105-1-wintera@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dibs.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/dibs.h b/include/linux/dibs.h
index d3e0777f25ae..0c10c224bcca 100644
--- a/include/linux/dibs.h
+++ b/include/linux/dibs.h
@@ -261,12 +261,12 @@ struct dibs_dev_ops {
* @vlan_id: deprecated, ignored if device does not support vlan
* Upon return in addition the following fields will be valid:
* @dmb_tok: for usage by remote and local devices and clients
- * @cpu_addr: allocated buffer
+ * @cpu_addr: allocated, zerorized buffer
* @idx: dmb index, unique per dibs device
* @dma_addr: to be used by device driver,if applicable
*
- * Allocate a dmb buffer and register it with this device and for this
- * client.
+ * Allocate and zerorize a dmb buffer and register it with this device
+ * and for this client.
* Return: zero on success
*/
int (*register_dmb)(struct dibs_dev *dev, struct dibs_dmb *dmb,