Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4339861pxu; Tue, 1 Dec 2020 02:26:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyd+LqvqsRvXc1LlZG0ZQ0waMf+6ZuKCBquZ6+OEbc/DqW+s+flojgsZ2823heVT9cgVTE5 X-Received: by 2002:a17:906:33c4:: with SMTP id w4mr2201580eja.380.1606818412873; Tue, 01 Dec 2020 02:26:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606818412; cv=none; d=google.com; s=arc-20160816; b=kciG9QUa0gDyZsFV0EDXhBlUx25eqdatgqovFDgx7OxSBejJ1c99KXyo6k2pkQgtG0 rvqUXKjnQhPkil9TsVE5uqDchqqu/RC0IhaW3EvQJoKWwccNKFaD546X7lSq2/t5ScaV sAgXp3mmK3pw1FqqrHdBgHvZkF5pqt/JpUQRaoXYfbvLb9M9goZW3iAI+s+f3iQQNHED TQIxkJEIT7xz0iO3VknREL4X93AgQsMmjBTRoQWmgc7TUEjrTAxJsLNxqYjIflJXKqyM Gpr4DL3Wb7oKadDIfsVxCgqpX2Y7SVLrNuZZlDrfKn41qXOZ4Ut0vawucGwGHfXb2q2H 3PTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=knQxcFi9c+keJfS52OVAxQ/QeZhgfa+b2kzcTUqwOy8=; b=Bh3WLRxPaEampZHsGH+kgjEGUwiQFdsbvoWG2KRxlZaEu6LRwcZy0VgbbJsJ8ZlWMe K3T/IKxYwaBnLFFijqdlLuWZ5NuPF+uWLylU3Cg7jyAnphxlxbGfxTNldrIdEme7bk8O KwIntICeACqkzQyP06IhF+nuYtnG0FPypUYNxjiFJdsGBeYRnX8qk0ALe9fYLR1xwrcx 75sz4G6oLSffu+Lk1w8P62iwzzWNXjjxf2jWJjD2BAQ1evOJUqXl4nvBAEKUxNbgyqjj e86LojCPEBnG0f0QgOOrxZor+pkrjCrdBcXMroBIwz35ViC2dVIqcnJFG7fjjZoAJFpP 6FGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NPqhfNVd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w24si685622ejy.97.2020.12.01.02.26.29; Tue, 01 Dec 2020 02:26:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NPqhfNVd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725861AbgLAKVU (ORCPT + 99 others); Tue, 1 Dec 2020 05:21:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30985 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726003AbgLAKVT (ORCPT ); Tue, 1 Dec 2020 05:21:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606817993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=knQxcFi9c+keJfS52OVAxQ/QeZhgfa+b2kzcTUqwOy8=; b=NPqhfNVdxNrGxEVwMMqNfng5px0RK9EoYUnE+nH3vgxF7rTf895JBrstvJVXNPnPxaDJ/e 8sp1e0Izj+fcn5zS9jNfC/NyISWoyF2Nig3if6AYKEu/zwadKEYEI6jDLl6iNTQF2fxqlp QOJAmH/aYFxk55oYMwsYEHelkrdqygk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-457-GexQxWKbNvmsvTgySBhIZw-1; Tue, 01 Dec 2020 05:19:49 -0500 X-MC-Unique: GexQxWKbNvmsvTgySBhIZw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A408A1092BA0; Tue, 1 Dec 2020 10:19:47 +0000 (UTC) Received: from gondolin (ovpn-113-138.ams2.redhat.com [10.36.113.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1C9260BE5; Tue, 1 Dec 2020 10:19:45 +0000 (UTC) Date: Tue, 1 Dec 2020 11:19:43 +0100 From: Cornelia Huck To: Qinglang Miao Cc: Vineeth Vijayan , Peter Oberparleiter , "Heiko Carstens" , Vasily Gorbik , "Christian Borntraeger" , , Subject: Re: [PATCH] s390: cio: fix use-after-free in ccw_device_destroy_console Message-ID: <20201201111943.626cb86f.cohuck@redhat.com> In-Reply-To: <20201201063150.82128-1-miaoqinglang@huawei.com> References: <20201201063150.82128-1-miaoqinglang@huawei.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 Dec 2020 14:31:50 +0800 Qinglang Miao wrote: > put_device calls release function which do kfree() inside. > So following use of sch&cdev would cause use-after-free bugs. > > Fix these by simply adjusting the position of put_device. > > Fixes: 37db8985b211 ("s390/cio: add basic protected virtualization support") > Reported-by: Hulk Robot > Suggested-by: Cornelia Huck > Signed-off-by: Qinglang Miao > --- > This patch is indeed a v2 of older one. Considering that the > patch's name has changed, I think a normal prefix 'PATCH' is > better. > > drivers/s390/cio/device.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Cornelia Huck