Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp803849imm; Mon, 21 May 2018 14:48:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZruR8AOQ/ufjfTgJblJCHGiJipDWoR9bpT6Yieulm48LXkxNIgaLmf0rloj+6HrBLWzVOjy X-Received: by 2002:a63:bf45:: with SMTP id i5-v6mr1874596pgo.41.1526939287477; Mon, 21 May 2018 14:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526939287; cv=none; d=google.com; s=arc-20160816; b=JVYunW9C4NYlmemAE4VEILx0n7OKnmnTJJQfAa1TB68BUux65zTVqIZ3XDnuxeRGWZ 802yXqY39FWeLV//DS7lvO9x8DMFXJSoXws/7oKGaFZ/MJGN/AvPylozsOdp2SABKWre 4s30HizkqQQzwYIXqplvtxB7//R2tf4pJ3TUHScNaNsKaFWgwbidzwebnaj7QnY2mjmG MC0cXSmJg1V1h2E418J3vBMVR1HQqB7Fll9BIyIcPi/0tBu/+azBsVJOCdVO96CkacN+ BuquEAlzxUn7Al2/stga5RczZkejzJZ3iTw6OwNcsgifj7WyVtViYq6nb2/XnTAJ2yuL 42pg== 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=5rce2/XRSA0YyYce8GaCpIVvsm20ccOr3ZlQ4zQE3MU=; b=H7Z7XU9caTMlODJ/PGvDd+OG9IzWFJBCr2dbS/jsjU9kvnaJqmsADM0h9gUDyZf5+z NClrbaxxzA0Q5cQBCE/B8WGRE3jY61qNapnUCCEF3xtk0Qb0g6OE7r/BAdrw0sZqcJa4 Ku4dBpwOm3GjFwi3ZtyrGt7h5WNcT+ohOH4312BuhRcOsKqFFZvzhX04DHzhPHlH7k8j eOiy5wL3vXCxHVLuiK+2auF0LfIkNwV6bueEsmiWc+oyVV0kr8ndhkC4pUTKCMvWedtK nO4/GwZS9M76+7uBpis6MNJUQjmY6haVjoNeFpQFEJ1f1Y2EE6q0LJU8jzzt0Kl9e84H rqfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yY1HFOi6; 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 v4-v6si3596903pgc.694.2018.05.21.14.47.52; Mon, 21 May 2018 14:48:07 -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=yY1HFOi6; 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 S932210AbeEUVX6 (ORCPT + 99 others); Mon, 21 May 2018 17:23:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:38628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754155AbeEUVXq (ORCPT ); Mon, 21 May 2018 17:23:46 -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 37EE020871; Mon, 21 May 2018 21:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526937825; bh=sDjtlK9KhEkQ4iEjDIOinTARQlmO51TsHd8+RO3Mbwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yY1HFOi6CjWTNUyeafFMSxk8qSwOLIlPQjA3YXqTPZPNNtsHlDbZLlLHy9/GcPOh2 Elmic8b57N4sUh3S++ilvQllV59LLnEZD1djEXKsborU/LKICVQa92NRArHmH8C3fV rvsUoLqoGwssDfuc3AsK5zLCpcIPd4vQdudk97QE= 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.16 040/110] s390/qdio: fix access to uninitialized qdio_q fields Date: Mon, 21 May 2018 23:11:37 +0200 Message-Id: <20180521210507.606013066@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180521210503.823249477@linuxfoundation.org> References: <20180521210503.823249477@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.16-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 @@ -141,7 +141,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;