Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2490838pxj; Mon, 10 May 2021 04:22:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNoHfvaVx+yh6i9Jne+upD9yk8ErUqKu9Mtwd76XlYBAacXBcXYPGdozooUUJv8SM4xTmO X-Received: by 2002:a6b:b8c3:: with SMTP id i186mr17979899iof.38.1620645754429; Mon, 10 May 2021 04:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645754; cv=none; d=google.com; s=arc-20160816; b=A7vP0TWYh4cNNn888eEwVyyINNeTxmfVm7hQh2YZufb0NrC3wlFAvNAaEaMYG31vvZ d/5Jp2KtEBDw6j+g66XzQxVUSTNNPzyvVwVpB9ETTlcIoaGGcffdFgQ14Hn2cqHcsIhB 6sKsdx8+hIaJ3WwzbF/omqdmT+665gPlwDzmyS4RY2mgzJZVBiv7nBpwW/ru3vUDtCbV I+iIVkZuN/LAggi9XNJx0VYjHn/bROYm8X/xVSQGvgX5347Om1Ubb996SScvj0lTl3BA asUNQakCI6KI4+XIAIems5an5AmqkO3fg9Nr3cBGXC57L0mX2LySNOS0hMx3Mq3fQWKQ dYJg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HgPDtpKMW7pPot3YJ5aVt18J3w+TK2WYzx6HzDYwwfk=; b=tfZu2IKY/EwZUprSMQWO9Vf/jSg1jRkr47gYwZR1FnF1bCXap2duxv13R0hURBslMn yP63lL9fG4lG5uYkps4uUZfNUdgkU6b6rHXbqQma6k2Vh73H9IZNAuOwZEy5kPGkqrr5 uL046d8lEwqqKUeuJvBCmLa3p00Hs+sQSoQcc50LFGX6N/oXm05/EARZlLALlKZJcJ/T 7ZOJbtLw4rA2oFI7FaX6n6d8gWdB5pAWsjBqKR2IMCbNdEjbyUYHi1cr/n+RpiTxoDla szK4s93Hz60HPHNk5jfjy0CmfR/BtMOUoQ0w3FrRIUEoliYoo1ln1xlDeCSz6znXsIUq yjBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ejFtPkBO; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o21si10647042jat.63.2021.05.10.04.22.21; Mon, 10 May 2021 04:22:34 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=ejFtPkBO; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233824AbhEJLSt (ORCPT + 99 others); Mon, 10 May 2021 07:18:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:52778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233876AbhEJKzd (ORCPT ); Mon, 10 May 2021 06:55:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32E2061C25; Mon, 10 May 2021 10:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643369; bh=5tR5IpQs+z9kEAOU5POh1Sr9kQA/z9dSZJFgHXH2P10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ejFtPkBOcFrNDb06UForly0k9GJ5n3etcBdb5Mq69ZJBfJK37IUWB5OvoOzbaxX8F +Xe6KmZmPtUwaXDYAuIyps0xoxc/y4WoXG/4ipldAPABfGnkFPjRvw9pBtjUG0sp+w LEfV/+2qsOHna42/RkcMwcdCC5q+FkQPusdYchc4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+bcc922b19ccc64240b42@syzkaller.appspotmail.com, Pavel Skripkin Subject: [PATCH 5.10 288/299] tty: fix memory leak in vc_deallocate Date: Mon, 10 May 2021 12:21:25 +0200 Message-Id: <20210510102014.429410247@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Skripkin commit 211b4d42b70f1c1660feaa968dac0efc2a96ac4d upstream. syzbot reported memory leak in tty/vt. The problem was in VT_DISALLOCATE ioctl cmd. After allocating unimap with PIO_UNIMAP it wasn't freed via VT_DISALLOCATE, but vc_cons[currcons].d was zeroed. Reported-by: syzbot+bcc922b19ccc64240b42@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Cc: stable Link: https://lore.kernel.org/r/20210327214443.21548-1-paskripkin@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vt/vt.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1382,6 +1382,7 @@ struct vc_data *vc_deallocate(unsigned i atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, ¶m); vcs_remove_sysfs(currcons); visual_deinit(vc); + con_free_unimap(vc); put_pid(vc->vt_pid); vc_uniscr_set(vc, NULL); kfree(vc->vc_screenbuf);