Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2042823imm; Thu, 24 May 2018 05:01:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrt45fYxjPy/CN0NoLInEkzLUr0R2N+uBIfYJBgbQbB/QAXvD9Fppej6qmBG6RTRqypNRgX X-Received: by 2002:a17:902:bf08:: with SMTP id bi8-v6mr7008480plb.353.1527163277650; Thu, 24 May 2018 05:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527163277; cv=none; d=google.com; s=arc-20160816; b=CSMVgLGcCke81LsP+zc3Y0fXXGum53kyoUv9300hdYDRF3ZVEqNbhhbYOtTMbKwNlH G8vVisHs0Quw1ltLlRW3Z7E5GbjRjct56Otc260UbbHS2j47hFaPHQNpdg92f6Z+ZjvC WMK/ykdl6mf4oy9GCRTWdY9fLilqVr4SEjR1QBd2GeA+5o4aBt7YPG1JUFTgbC6ZcdMs UHQpWNxP0D24Zuew+p9mXDWeDD9+9Y0H2G6HK9hX8n6s+kz6gnJrPYRaGlyZoXJVh0R2 wrIP1EfzVNtN0HydGll7NEnsAeUXGRhj4980R9VolirGM1CfhWg1hSTgIojtnz5yvPC4 6g1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ccGZlLFwAEZtGgdRKncP3JU7eAB2p3tszQsrUB7u+2Q=; b=CCK96bQ1mHQiJOzWeDjDnuOFbcXagE52lFUQwjuiTqahvR18Fc2XaRUuNUOmXWvpZz Z+2m89JsTfTde5RI2adGtyW6EiEQ6oDk2zLyNlIgQpy+76ExBZJ8w/oJLn78FycdTqzW YP3KrL0gEVb4t9BZtBT40s1CFwyAZPlo9CJp3lbGCOhDeIezdILsuCkyO2O7qISZRYYV +UCiG8z68M5i06snWnwQUvk2dbTVB+/I8tpJC5mXyYtl4ZahCc1Od+0/sMA2enJfJSa/ Zk2pin8r+HYQwAVLPVfEtDDUJHWjoSW43/0EiRtx0c85LQDlaGAN0I9em9mcuZeN7asB xyoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nAGz/hA1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8-v6si11868706plt.410.2018.05.24.05.01.00; Thu, 24 May 2018 05:01:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nAGz/hA1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969546AbeEXMAM (ORCPT + 99 others); Thu, 24 May 2018 08:00:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:56330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966462AbeEXJpH (ORCPT ); Thu, 24 May 2018 05:45:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BDDFA208CD; Thu, 24 May 2018 09:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155107; bh=35yRZAyT9lEFruoCvZ7FMMC8m+oEkYUUkzNF64c3qW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nAGz/hA1OXmUlX8plB2pbGeVw/zc0IjZOmJi/tjcXwOWSEMJkIHdUGyOxB4Jn9Jmp go7gRaJUOlMS4P3RzIWkU0pRMHoLtdn8lm+blBgEs/7oeh0y1fYA9FzAViJ9LkJe8K FfPMr/QJg0d4BxkRSA+ET1o7FU6pKvNf9qGq6Cq8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , Martin Schwidefsky Subject: [PATCH 4.4 58/92] s390/qdio: fix access to uninitialized qdio_q fields Date: Thu, 24 May 2018 11:38:35 +0200 Message-Id: <20180524093204.893790544@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Wiedmann commit e521813468f786271a87e78e8644243bead48fad upstream. Ever since CQ/QAOB support was added, calling qdio_free() straight after qdio_alloc() results in qdio_release_memory() accessing uninitialized memory (ie. q->u.out.use_cq and q->u.out.aobs). Followed by a kmem_cache_free() on the random AOB addresses. For older kernels that don't have 6e30c549f6ca, the same applies if qdio_establish() fails in the DEV_STATE_ONLINE check. While initializing q->u.out.use_cq would be enough to fix this particular bug, the more future-proof change is to just zero-alloc the whole struct. Fixes: 104ea556ee7f ("qdio: support asynchronous delivery of storage blocks") Cc: #v3.2+ Signed-off-by: Julian Wiedmann Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/qdio_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/s390/cio/qdio_setup.c +++ b/drivers/s390/cio/qdio_setup.c @@ -140,7 +140,7 @@ static int __qdio_allocate_qs(struct qdi int i; for (i = 0; i < nr_queues; i++) { - q = kmem_cache_alloc(qdio_q_cache, GFP_KERNEL); + q = kmem_cache_zalloc(qdio_q_cache, GFP_KERNEL); if (!q) return -ENOMEM;