Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3349043ybv; Mon, 24 Feb 2020 23:32:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwIchDPLBOo3LbnTrCWKu76WOkNEkrw+NFRARnOzGlRbsDoNP7W3a/mLMe1qcbZWHsTZYQi X-Received: by 2002:a05:6830:1219:: with SMTP id r25mr19478042otp.180.1582615947059; Mon, 24 Feb 2020 23:32:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582615947; cv=none; d=google.com; s=arc-20160816; b=cwIFAdXK3DfuttrmrKfj8pZu34goXkNljWG/uk8kPLGfvjwmiOlTp3nyXI3zic1YOp 92LUuc+4agOXkjff+77fyffjqvIQ97XR+/ncHa9tU4coEgJYuefz6yldSh6KoDKBcoq0 WvTgwAlReIxxyixIDVxxk8OUG5vDuvj+DLbmzKNVqhNPeNL6dNQfcM47bUI/Oywqy/BS g15ObaRwuolws9m2riomtN2qN/xSAh6q7W6JK6DSSXWoXZeyMAXvBXO0NSFWVHOmyVKL 3Qc/PkDBX6CNibBaCzzy8Yo15Xgo2kVo9BKuu9yGeTBoC986cI0CLvXux7JkB7TSoV/k /yuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=xmL5mNQIpqr9YgAUqty2jHE9112YdztqpqiF1HNMG8k=; b=jG5YVLARTG05hadIvA+GgSdVxhWjw9+lDEibi7MK2se6r+jQUDr7pV+CQvMssjXuox XWT4FDkXaWimPfSO9L6XAbF7HOPkDITvvGaT8rSkEGqsuYTgB3Z1vPxvia4Zijak5MJk jM9RcfmAG3WyZC5gp2iXvGSKnzszkELqmXZDq6QdgCdPbuSypSDC9v8f2DkF9VmU2ElP zlG/155bPysSjitWPGkja4BEMc2pMHLw8Oi+RV+7bbwC6CPakshJ6iaCyRAw9tsKdofd vRe1mZbQRivVp4yC2LjbtzgJLMbAp9Y7wgI/FL8q3s6CI9Xe3JcLYwj/j67OcbowsySG rlvg== 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 w207si6285613oia.226.2020.02.24.23.32.15; Mon, 24 Feb 2020 23:32:27 -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 S1729294AbgBYHaZ (ORCPT + 99 others); Tue, 25 Feb 2020 02:30:25 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38123 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729055AbgBYHaY (ORCPT ); Tue, 25 Feb 2020 02:30:24 -0500 Received: by mail-wm1-f66.google.com with SMTP id a9so1965577wmj.3 for ; Mon, 24 Feb 2020 23:30:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=xmL5mNQIpqr9YgAUqty2jHE9112YdztqpqiF1HNMG8k=; b=sFTbEFRdHpDFI1ud08kegz5D+Enas/RPbpKBq/6cj9biSm2K1GLGZsfe5Ta92hUlQk sMaEttAB3EiBmEVvNRik/93kD6z4wuN6O3vMtIYada7TtBYgMKTRlaifajOPk2l+r3iE H7XMdjdQ2XC+K9sxF32drNGT6uw7xLuSoxnQQOyONM512+4Jgrte+C2N//u3H45cl7IX dfcy7I3HVi4X77CN22tIvT0mGZJr6/mjNYOb90t/O19UuHbpLNHH6uDG8qj0Zy3a4FDr 7NrnCapFsxyMkwW9/UGKQ06BazkQsTkeKpU/UZjDVZsBIr+XqoL3f0ozvM+sVyRRdnCR y1tw== X-Gm-Message-State: APjAAAXJdyvBi0FYHk0QJLwGrBBAqfd4jkvnuZk3ofwVRE6Wzscyzqwj U+akp6Kut9pXLxOXuRoTgc4= X-Received: by 2002:a1c:dc85:: with SMTP id t127mr3958789wmg.16.1582615821752; Mon, 24 Feb 2020 23:30:21 -0800 (PST) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id t10sm1421653wru.59.2020.02.24.23.30.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Feb 2020 23:30:20 -0800 (PST) Subject: Re: [PATCH v2 2/2] tty: fix compat TIOCGSERIAL checking wrong function ptr To: Eric Biggers , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Al Viro References: <20200224181532.GA109047@gmail.com> <20200224182044.234553-1-ebiggers@kernel.org> <20200224182044.234553-3-ebiggers@kernel.org> From: Jiri Slaby Autocrypt: addr=jslaby@suse.com; prefer-encrypt=mutual; keydata= mQINBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQj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QEsGgjs8v719sguok8eADBbfmumerh/8RhPKRuTWxrXdNq/pu0n7hA6Btx7NYjBnnD8 lV8Qlb0lencEUBXNFDmdWussMAlnxjmKhZyb30m1IgjFfG30UloZzUGCyLkr/53JMovAswmC IHNtXHwb58Ikn1i2U049aFso+WtDz4BjnYBqCL1Y2F7pd8l2HmDqm2I4gubffSaRHiBbqcSB lXIjJOrd6Q66u5+1Yv32qk/nOL542syYtFDH2J5wM2AWvfjZH1tMOVvVMu5Fv7+0n3x/9shY ivRypCapDfcWBGGsbX5eaXpRfInaMTGaU7wmWO44Z5diHpmQgTLOrN9/MEtdkK6OVhAMVenI w1UnZnA+ZfaZYShi5oFTQk3vAz7/NaA5/bNHCES4PcDZw7Y/GiIh/JQR8H1JKZ99or9LjFeg HrC8YQ1nzkeDfsLtYM11oC3peHa5AiXLmCuSC9ammQ3LhkfET6N42xTu2A== Message-ID: <265c9940-e274-2598-112a-35b66ab5001e@suse.com> Date: Tue, 25 Feb 2020 08:30:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200224182044.234553-3-ebiggers@kernel.org> Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24. 02. 20, 19:20, Eric Biggers wrote: > From: Eric Biggers > > Commit 77654350306a ("take compat TIOC[SG]SERIAL treatment into > tty_compat_ioctl()") changed the compat version of TIOCGSERIAL to start > checking for the presence of the ->set_serial function pointer rather > than ->get_serial. This appears to be a copy-and-paste error, since > ->get_serial is the function pointer that is called as well as the > pointer that is checked by the non-compat version of TIOCGSERIAL. > > Fix this by checking the correct function pointer. > > Fixes: 77654350306a ("take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl()") > Cc: # v4.20+ > Signed-off-by: Eric Biggers Acked-by: Jiri Slaby > --- > drivers/tty/tty_io.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c > index db4a13bc855ed6..5a6f36b391d95d 100644 > --- a/drivers/tty/tty_io.c > +++ b/drivers/tty/tty_io.c > @@ -2734,7 +2734,7 @@ static int compat_tty_tiocgserial(struct tty_struct *tty, > memset(&v, 0, sizeof(v)); > memset(&v32, 0, sizeof(v32)); > > - if (!tty->ops->set_serial) > + if (!tty->ops->get_serial) > return -ENOTTY; > err = tty->ops->get_serial(tty, &v); > if (!err) { > -- js suse labs