Received: by 10.223.185.116 with SMTP id b49csp2208690wrg; Thu, 15 Feb 2018 08:07:59 -0800 (PST) X-Google-Smtp-Source: AH8x224FKM4PUQOja2aPDLFKoyJzGSvJVOW5wN5/FOXHuvUb+y3sGjnxh3k9xBvmx3OR01XOMAB5 X-Received: by 10.167.131.83 with SMTP id z19mr3072777pfm.242.1518710879692; Thu, 15 Feb 2018 08:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518710879; cv=none; d=google.com; s=arc-20160816; b=kA8PCl7fd3QMRwmAOIlDcLwcCAqPxXP+UznB1UTTHbt3hstSQgKSVErXYVPG7ibb1F nhHmBvB6/eq00Yw/Fp7QL8qugau3HbUBJqxiRPVoXqAQK8UeIf6F4LvpAalnLEHTP/zz xLgiUSDiUWHMV6cbe/VcLDBQ4FCTNQxzV0Lb7+JTOt3vO4CgJgqGI3uG1An1ezeJ7wMD rDP4pxosj7c05PYLRuEcCB47eQfYpoBL/iiH8b9mRUYc5VV+UpIUo5zdHus8aWJCaBdC uCAlln+8fhxJ/dlFQiG0uJb2C6fnaHkVLNbaronff6XdQt4/kmJhAosSIUOIAUO2O1Ry HEuA== 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 :arc-authentication-results; bh=mrjaWqk+75qCa2JjYST/MZIDRlLTq6BddtTLt6OHFg8=; b=wKda69p0ww2RRm5MW4wA4TI6jtvuWL9h998zxAmZdD9PQIAkp1a5h6VCXCFC5wbvhD fp+M8kjsLb2e/B1cUgR0S1M1PnVeGqfSWCY7DLj4DrQje2RzaMad1JVjUbcrUdcQfZWG ay50eWN9RxMRYnL4qXc0FfHCJqGwqoxa1HVTqJO/QNC2+NlAyulvtXWBeMOjCM7NBDMC 4fP2jA6uk4ShWH0Auvfp06fYQ9mMJp5EmLL6dltfrJqOrw5XV+lmSO8m0ZjAE/wWzmsw 2iaVQOUBB0fNwPO2PnzdIyrmv90jfiGnAHFWUc0vzkjw7VC6jabDKA7nDgUJtWZTmG1b t8pg== ARC-Authentication-Results: i=1; mx.google.com; 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 g6-v6si1414051plj.159.2018.02.15.08.07.38; Thu, 15 Feb 2018 08:07:59 -0800 (PST) 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; 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 S1424583AbeBOPqB (ORCPT + 99 others); Thu, 15 Feb 2018 10:46:01 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35172 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424564AbeBOPpy (ORCPT ); Thu, 15 Feb 2018 10:45:54 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2FDFF11B5; Thu, 15 Feb 2018 15:45:54 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Biggers , syzbot , Andrew Morton , Zhouyi Zhou , Jens Axboe , Linus Torvalds Subject: [PATCH 4.15 158/202] kernel/relay.c: revert "kernel/relay.c: fix potential memory leak" Date: Thu, 15 Feb 2018 16:17:38 +0100 Message-Id: <20180215151721.162546627@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Biggers commit a1be1f3931bfe0a42b46fef77a04593c2b136e7f upstream. This reverts commit ba62bafe942b ("kernel/relay.c: fix potential memory leak"). This commit introduced a double free bug, because 'chan' is already freed by the line: kref_put(&chan->kref, relay_destroy_channel); This bug was found by syzkaller, using the BLKTRACESETUP ioctl. Link: http://lkml.kernel.org/r/20180127004759.101823-1-ebiggers3@gmail.com Fixes: ba62bafe942b ("kernel/relay.c: fix potential memory leak") Signed-off-by: Eric Biggers Reported-by: syzbot Reviewed-by: Andrew Morton Cc: Zhouyi Zhou Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- kernel/relay.c | 1 - 1 file changed, 1 deletion(-) --- a/kernel/relay.c +++ b/kernel/relay.c @@ -611,7 +611,6 @@ free_bufs: kref_put(&chan->kref, relay_destroy_channel); mutex_unlock(&relay_channels_mutex); - kfree(chan); return NULL; } EXPORT_SYMBOL_GPL(relay_open);