Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1093421ybh; Thu, 16 Jul 2020 03:00:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2lC4cjJHGguNT9bRJuBbFeeaYwgFaDlUDejEiOgr46i1wHxnUqd3/49Bj5kAvydYc+OFk X-Received: by 2002:a17:906:4f09:: with SMTP id t9mr2922358eju.110.1594893639249; Thu, 16 Jul 2020 03:00:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594893639; cv=none; d=google.com; s=arc-20160816; b=VA6cmfTRC76vP3yPolvawNU5MpuJDwGJeHPWCiZl2tCmn36yyUsBTvPnpyPboABVbR 8ueNX9v+RP3rAl8/OzOmkvTxs2DnGKGR2ZCkYyg4aPDfb3Uh5PXeIGuC2TivRsJF0u6J x5/qw7wPlIt44zjdlihvQ2ZFqVnF0ajkQaSz+osrLr9ragOJTmIhHBt64Vzep3dD4+nz N+sKW799p9kOkLXPCy9bT+wCBJmvceSHL29bJmlvEHvUoWK6husz+avu6PKGVfHvjuwr jpFP87kyudYkKlSiNh0RACYuxN0mGJse4Nhlp0SZRhjjU0h+KWsuthKN++b9Cnhd0foi kVTw== 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:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=p7ULmXvRXYxCcTo8wTXcMu3x+yaWMQIGr98XOBExKbA=; b=V1de4Pg//nKq0nG0c+eG7L7ZLkmselLHJ3UGcXp2VIrZIMrshdaT1hNEuX5P6Q4peI gi/2nAgXIq4C9zEVF2Yf++pp3Gmf4TgbcvGIKIh0/BbiW5+J2mm9ich8jyUx27ItKqcD ykCpIbwFSmB+bkv29MZymJSEm2u+nwJDRPD3dxq51DhIwK9Ln53AyAb43Qhis+h8fvZG NEkl72mENaRtC/H6UcqHHg2Zk6xU3HdrrDmu1Jc8zi7od3TSOC/p99zkzOFTqPuaXEWt ceYx4yhOyRtjB4YkESay3+d5MITBH76g1ZQ2TiIQTFM5qZf2sbVms+qIoXNUjo3y4yJ+ 6DaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=WiOCEj2a; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg17si2849224edb.606.2020.07.16.03.00.15; Thu, 16 Jul 2020 03:00:39 -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=@ffwll.ch header.s=google header.b=WiOCEj2a; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726585AbgGPKAM (ORCPT + 99 others); Thu, 16 Jul 2020 06:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbgGPKAL (ORCPT ); Thu, 16 Jul 2020 06:00:11 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95396C061755 for ; Thu, 16 Jul 2020 03:00:10 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id o8so9716645wmh.4 for ; Thu, 16 Jul 2020 03:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=p7ULmXvRXYxCcTo8wTXcMu3x+yaWMQIGr98XOBExKbA=; b=WiOCEj2aX2XvOMwJRHGb2nmKLYzIngZK3V8yvoeZMgI50rW5jzQZSaclNCu+hYD2fh W9Ax4Z9wBtrHU6XdeweO1EuJSpp4uBxsxMIvwZ3p2oBWvSvklN2/tqt+R++hmOJph1Pa Cg4wzU0cANnHCT1Vl9YvZXeDnZQsbNhLUpOQE= 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=p7ULmXvRXYxCcTo8wTXcMu3x+yaWMQIGr98XOBExKbA=; b=E75dD0mOnFwKZtn9bE8wUwOoIqhZ/Sm+4bLXTS7oE525zYpxLjC094F3XWjVWzT6c5 DqN7c2bP2XFMzxOdXwtW4oR/0kyQOP3wUkQDWndaJ1xAb6bQ49f8DqehlLMkyAYTrSjM WZVmpIfri82M3TofxxH45HCAPvcKgu7ly4tOf5Ou5d54hAA9pnvaJs0MNHNjwRmW99ZM JlT//Au/SPkOLPHuXYixrx1KkIgS7QG66kTI1hwfXb47NfTzEUHutmdcyxRnbhuhW1F0 XAnDg5D148t9ZIM/+LRZ2dfqLOehKPKU+dgJ8TBlxpn5YpTp/5R0YqM0jVfel4SRndrD 52TA== X-Gm-Message-State: AOAM531mtAQUFk2BvjfEQL6SBLWsOYRoeMhiV0JIyA2CMQbNBoyn29oa abuwLBhRmiF8dKAtis6aBjXeqg== X-Received: by 2002:a05:600c:2249:: with SMTP id a9mr3448422wmm.163.1594893609246; Thu, 16 Jul 2020 03:00:09 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id y16sm8215061wro.71.2020.07.16.03.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 03:00:08 -0700 (PDT) Date: Thu, 16 Jul 2020 12:00:06 +0200 From: Daniel Vetter To: Tetsuo Handa Cc: Dan Carpenter , linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , syzbot , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, George Kennedy , Jiri Slaby , Dmitry Vyukov Subject: Re: [PATCH v2] fbdev: Detect integer underflow at "struct fbcon_ops"->clear_margins. Message-ID: <20200716100006.GN3278063@phenom.ffwll.local> Mail-Followup-To: Tetsuo Handa , Dan Carpenter , linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , syzbot , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, George Kennedy , Jiri Slaby , Dmitry Vyukov References: <20200715015102.3814-1-penguin-kernel@I-love.SAKURA.ne.jp> <20200715094836.GD2571@kadam> <9e6eac10-c5c3-f518-36cc-9ea32fb5d7fe@i-love.sakura.ne.jp> <20200715151220.GE2571@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.6.0-1-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2020 at 12:29:00AM +0900, Tetsuo Handa wrote: > On 2020/07/16 0:12, Dan Carpenter wrote: > > I've complained about integer overflows in fbdev for a long time... > > > > What I'd like to see is something like the following maybe. I don't > > know how to get the vc_data in fbmem.c so it doesn't include your checks > > for negative. > > Yes. Like I said "Thus, I consider that we need more sanity/constraints checks." at > https://lore.kernel.org/lkml/b1e7dd6a-fc22-bba8-0abb-d3e779329bce@i-love.sakura.ne.jp/ , > we want basic checks. That's a task for fbdev people who should be familiar with > necessary constraints. I think the worldwide supply of people who understand fbdev and willing to work on it is roughly 0. So if someone wants to fix this mess properly (which likely means adding tons of over/underflow checks at entry points, since you're never going to catch the driver bugs, there's too many and not enough people who care) they need to fix this themselves. Just to avoid confusion here. > Anyway, my two patches are small and low cost; can we apply these patches regardless > of basic checks? Which two patches where? Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch