Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3059133pxa; Tue, 25 Aug 2020 10:16:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyhPSLgS3BC8RVXmdGAqzPjm67zI3a3wZ5gjC1T92mU16/DZKRB4FGdZ6vojwG6ncQjdPF X-Received: by 2002:a17:906:1707:: with SMTP id c7mr11744357eje.498.1598375806451; Tue, 25 Aug 2020 10:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598375806; cv=none; d=google.com; s=arc-20160816; b=LjvM3DuqPD4n1HCfrjd+Moh0ytxF9OouH2pxQoWKr3tOwBesDE3tzoov/e3J4WXSsy 7vTIciwj82xzOHOmcRX/5H3FFDxJGDCVovrzupcobQaekfVwV6jlSN42eJ0Rzt12Au5v n+jdDu8cElki7qmUN+fpNK3c1HQpJnRHh2+70uBALtpHjc0FjbrmTaMWC7CcJgmEzdL9 spg1csj91hUVWv8TBpiqjkR5W2qVZtb/HGYGReXb1j2rRMD5LlDmKCZyJ6+ofzBr8JT5 mTS+VOPCHS/KaR86qYrOskr2FitNGENHzSOZVObHmaFOgTF8fKMrf2n+BZVlfY8BoqyV h9dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CDJUAd9wV5rW2Ler2a2mLyA8fUH115tJlJPmgB4uBuY=; b=0dfq9pxKDT+TED1ovHNNt5JUZ/yOgTtuGZJP6IbW0GzhYpaemyR+V9RfsFsqYOiLfV 4cs+Tw5560Lxg8YkV6rNUmM3CiHW3FTgVF7MZkeC4Zom0uHHI5Udi8AOZAXzNwvhKWuO EaiS0jOn4lkerbEjVdcBy0KEXSW2WISPcXpAybuxTchdlwOfWIWJCrM7isYy5aklzyXY 2t1uBoQ9U6D1z3HhzLCjtb2BYIbC1K7Oh6vOfO9fl9AL2ZTrMgkh8k0isFFucBr9j8qg AtSUusBCG2PWNI/DxpEdo7EOIq7gUM1ENhve0+KRfHXKsbxD43/MnZJbJ2LUYtjnT2Ee FJjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="NnZw/EDH"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si7036007ejz.302.2020.08.25.10.16.23; Tue, 25 Aug 2020 10:16:46 -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=@gmail.com header.s=20161025 header.b="NnZw/EDH"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726306AbgHYRNB (ORCPT + 99 others); Tue, 25 Aug 2020 13:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726119AbgHYRM5 (ORCPT ); Tue, 25 Aug 2020 13:12:57 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6557C061574; Tue, 25 Aug 2020 10:12:56 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id w186so5164919pgb.8; Tue, 25 Aug 2020 10:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=CDJUAd9wV5rW2Ler2a2mLyA8fUH115tJlJPmgB4uBuY=; b=NnZw/EDHYt2NwwW6ntYS4NRclJi2nzS0qnpyZ5bOPH+F1THhlFHTusVgt0akMN1gHg cruU8w15DKhorJi2+8a0CgAleQeml1Ibg+Bkkp6iqxrqbpMl5Xy2PRKkHIHnw8DLUxBK kremo6Ji8Ywg1muwwQh1KGSfzGX3Cn36vVUhiAMBgdn80NgNo0UFCQUJjAkWtuczdWew z37hSfISD+N/dTDknT6czKgEsGrvYbecgW2DvnKaaYUSlC0EmAIadOnbHcNmFbCRAhye H6N+m7rbfMudLxWFTXNzTv/jXRx3QHfkqxyMoixpHjorW6O1PD0kKA0NfuVVX+xAIqjw 9HwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CDJUAd9wV5rW2Ler2a2mLyA8fUH115tJlJPmgB4uBuY=; b=C3+NLszTegHPGz7CAggisbF+RnDcLyByNNrQTq95zVmkYQsAk1HoLbPWSN7l7FkcgR CpFlbIM9eOzpVUOFYWWsHfHiH0sBnZ/yFYuHM3Lpz11zs3BX79qpIydLAEdHPnLODX5A klGKmmZaS2yCvddL7Jyfg4xt57/8IB3haefx0U5ehbeWlfltZQe6AiMPZ30Ao8AQqBBM qj6MDphFTGK076IizMGtRs2G+CQOlzHvRRHYodNyIQfHTlqKoFVLiO40egp56QYA+aIf tUa9qPPbzN7hkIb6Xm64qxQITAMC9b9+s3xQ3wDLiq0mHs0gxdar69SkHAy0Afc6OlY6 KSHg== X-Gm-Message-State: AOAM5300C1fGG3HLLzZOS1E0QUKAZnvI9Ud6ZhWKiXSs37NQvqHokPqn ZD5wxyoFxP+AOPdHAeePo59IrL9xBEiv X-Received: by 2002:a63:f4a:: with SMTP id 10mr7150104pgp.18.1598375576436; Tue, 25 Aug 2020 10:12:56 -0700 (PDT) Received: from PWN ([161.117.80.159]) by smtp.gmail.com with ESMTPSA id g8sm14481455pfo.132.2020.08.25.10.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 10:12:55 -0700 (PDT) Date: Tue, 25 Aug 2020 13:12:49 -0400 From: Peilin Ye To: Greg KH Cc: jslaby@suse.cz, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, syzkaller-bugs@googlegroups.com, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH 15/16] vc_screen: extract vcs_read_buf_header Message-ID: <20200825171249.GA860904@PWN> References: <20200818085706.12163-15-jslaby@suse.cz> <20200825164804.860743-1-yepeilin.cs@gmail.com> <20200825165935.GA1527003@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825165935.GA1527003@kroah.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2020 at 06:59:35PM +0200, Greg KH wrote: > On Tue, Aug 25, 2020 at 12:48:04PM -0400, Peilin Ye wrote: > > Hi all, > > > > Link: https://syzkaller.appspot.com/bug?id=f332576321998d36cd07d09c9c1268cfed1895c9 > > > > As reported by syzbot, vcs_read_buf() is overflowing `con_buf16`, since > > this patch removed the following check: > > > > - if (count > CON_BUF_SIZE) { > > - count = CON_BUF_SIZE; > > - filled = count - pos; > > - } > > > > Decreasing `count` by `min(HEADER_SIZE - pos, count)` bypasses this check. > > Additionally, this patch also removed updates to `skip` and `filled`. > > > > What should we do in order to fix it? > > This patch is already reverted, and it has been discussed a bit as to > how to do this properly if you look at the email where this was reported > to us. Ah, syzbot has reported this issue as two different bugs...I started looking into it without noticing your discussion under another thread. Sorry, Peilin Ye