Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp318669yba; Wed, 3 Apr 2019 09:17:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLgo1AC4rQSBD7McPSH3sBdtCH0qa0elpL5odg5+WW/jXmYCy3r1pdFIknNp7iT63XedRF X-Received: by 2002:a62:5185:: with SMTP id f127mr215394pfb.199.1554308233276; Wed, 03 Apr 2019 09:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554308233; cv=none; d=google.com; s=arc-20160816; b=Jgyh/pq9EweB2q8coY5xCAvJj80FGKgL/C6qqPRya4ELEjeBE00oor89pLs6nwT68Y 6bZTk1cx8mOJpE8nl+IIryg/xYNkoFGH/VkehrGj0vsjK5cLAAFeke/OGHcXj7Ukhle4 fbY3ctaH67HeVq0T8tFdZOe0q2C+L+5sbMv4StY2HB2h1psvWU7l70SIyX93tyNc5XRx jtgOcsLxKge7UDWcqLr0GXhTpE44V9VRJWlyDMCY7jqnYEK0053xNKp+qITzZNB55ya8 /5y29oQPATPOgvfgFjTsechBbmaqCloNx1qGPhldZorOpK+LMQfLENAjALnbZeKSbYaJ moqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tbznbMNMszP5zUDeOcFvfF0oeHEgLzyiqqIQ9s6ordg=; b=kt2986h1Oj0szvc21KUpF3vnY1DrwINMvcqJCa2IVdVU4LbwFCCYIJfqdvwItL8v72 4R0uvxxi40mrTThLM9FhdKaMMeI4HT3/D7TnDviDf2SC1bAof8gEZkmSy+LWfSTBTfM0 mthBOJQDJGD6GrqUdCBqeN8uNre73KGV0ka8dwUYmBcDh7Rzvu1viwyapLTyz5H4OKCz Y7L37dBmuLQpWXDexsBttUOoMk3sOpMd8MoYoD1aOJMamVGfsprZoUO1moAkR0vw06gj ICddG9/Op1KwG079m610hGPgbtGJsz6HQTBT7ZE+IFFvSE28fSzs4hUSmKBd03J3I+Ka Esqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nuBzjPPX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay8si8040223plb.202.2019.04.03.09.16.57; Wed, 03 Apr 2019 09:17:13 -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=nuBzjPPX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbfDCQQI (ORCPT + 99 others); Wed, 3 Apr 2019 12:16:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:45862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbfDCQQI (ORCPT ); Wed, 3 Apr 2019 12:16:08 -0400 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 4BEC8206B7; Wed, 3 Apr 2019 16:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554308167; bh=m7lFOUM4c3MvB1yjd1lFh6kMBfBqzE5Tns8BLLH1vqs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nuBzjPPXVtjwxtWsz6k18Ic1+FJN26PrjM9FBGcDWazbD2xnjSJYVn8xl2Q+7g9oX gE7VuT2InZG3ub4Hu4c5c33SFiquKoWW2hQDltaoBlkukf5L82xaKmj92HBmJtnhnG oxgTdZI3pdII8uEz4+b0JqAb3AFsS+1eICwkC/Vc= Date: Wed, 3 Apr 2019 12:16:06 -0400 From: Sasha Levin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, Linus Torvalds Subject: Re: [PATCH AUTOSEL 4.19 40/57] kvm: properly check debugfs dentry before using it Message-ID: <20190403161606.GB16241@sasha-vm> References: <20190330012854.32212-1-sashal@kernel.org> <20190330012854.32212-40-sashal@kernel.org> <20190330054350.GB23655@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190330054350.GB23655@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 30, 2019 at 06:43:50AM +0100, Greg Kroah-Hartman wrote: >On Fri, Mar 29, 2019 at 09:28:33PM -0400, Sasha Levin wrote: >> From: Greg Kroah-Hartman >> >> [ Upstream commit 8ed0579c12b2fe56a1fac2f712f58fc26c1dc49b ] >> >> debugfs can now report an error code if something went wrong instead of >> just NULL. So if the return value is to be used as a "real" dentry, it >> needs to be checked if it is an error before dereferencing it. >> >> This is now happening because of ff9fb72bc077 ("debugfs: return error >> values, not NULL"). syzbot has found a way to trigger multiple debugfs >> files attempting to be created, which fails, and then the error code >> gets passed to dentry_path_raw() which obviously does not like it. >> >> Reported-by: Eric Biggers >> Reported-and-tested-by: syzbot+7857962b4d45e602b8ad@syzkaller.appspotmail.com >> Cc: "Radim Krčmář" >> Cc: kvm@vger.kernel.org >> Acked-by: Paolo Bonzini >> Signed-off-by: Greg Kroah-Hartman >> Signed-off-by: Linus Torvalds >> Signed-off-by: Sasha Levin >> --- >> virt/kvm/kvm_main.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c >> index c436d95fd7aa..fb74f994cb63 100644 >> --- a/virt/kvm/kvm_main.c >> +++ b/virt/kvm/kvm_main.c >> @@ -3912,7 +3912,7 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm) >> } >> add_uevent_var(env, "PID=%d", kvm->userspace_pid); >> >> - if (kvm->debugfs_dentry) { >> + if (!IS_ERR_OR_NULL(kvm->debugfs_dentry)) { >> char *tmp, *p = kmalloc(PATH_MAX, GFP_KERNEL); >> >> if (p) { >> -- >> 2.19.1 >> > >Same thing here, this was a 5.0-only thing, no need for it to be >backported, please drop it from all trees. Dropped, thanks! -- Thanks, Sasha