Return-Path: Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49687 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbgLAKVT (ORCPT ); Tue, 1 Dec 2020 05:21:19 -0500 Date: Tue, 1 Dec 2020 11:19:43 +0100 From: Cornelia Huck 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-ID: To: Qinglang Miao Cc: Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org, 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