From: Julian Wiedmann <jwi@linux.ibm.com>
Subject: s390/qeth: remove outdated portname debug msg
Patch-mainline: v4.17-rc1
Git-commit: d857e11193a24d6623bb562e9b26cde582bd877f
References: bsc#1117953, LTC#172960
Description: qeth: sanitize strings in debug messages
Symptom: Use-after free when reading from s390 debug files.
Problem: Pointers in sprintf-formatted s390dbf debug files are
dereferenced whenever the trace file is read from.
If the referenced data has a shorter life-time than the trace
file, any read operation can result in a use-after-free.
Solution: Sanitize the debug entries, remove all usage of indirect data.
Reproduction: Workload that creates and removes many qeth-based network
interfaces, while reading from s390 debug files.
Upstream-Description:
s390/qeth: remove outdated portname debug msg
The 'portname' attribute is deprecated and setting it has no effect.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/s390/net/qeth_core_main.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -719,11 +719,8 @@ static int qeth_check_idx_response(struc
QETH_DBF_HEX(CTRL, 2, buffer, QETH_DBF_CTRL_LEN);
if ((buffer[2] & 0xc0) == 0xc0) {
- QETH_DBF_MESSAGE(2, "received an IDX TERMINATE "
- "with cause code 0x%02x%s\n",
- buffer[4],
- ((buffer[4] == 0x22) ?
- " -- try another portname" : ""));
+ QETH_DBF_MESSAGE(2, "received an IDX TERMINATE with cause code %#02x\n",
+ buffer[4]);
QETH_CARD_TEXT(card, 2, "ckidxres");
QETH_CARD_TEXT(card, 2, " idxterm");
QETH_CARD_TEXT_(card, 2, " rc%d", -EIO);