Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp598878pxr; Mon, 11 Apr 2022 02:08:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/PWOFLcRyEcxy+FSBTlrRrPWxjkGSxEX3LpYio26xEt16n0YgsCcaF15VAFJaDrKfei4S X-Received: by 2002:a17:906:5d04:b0:6db:7262:570e with SMTP id g4-20020a1709065d0400b006db7262570emr28869097ejt.8.1649668130223; Mon, 11 Apr 2022 02:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649668130; cv=none; d=google.com; s=arc-20160816; b=S/8PjCtbkoKa2rhMpkY6NrBaJLxzOmO69vFGBZGlFZksvEoATcYq7Nc41Xl9FcoqHo 0PBGuQPC9OZn/5q/MemBxRXxO3W9UBS5O+hN9iufUNUQy1W/c1vaoZ7F2ZsOFHik+LBF JUKZCAPo37eN14UmpSLk/s45j1cwwf4I1gostawPYvy2UJa6aTC37II5WsXOmKwaxdZg nH7vrKNRifgkhXn8TUdqznqlclXqgryrit/vrst+SlOPrP27PBm/WzRDk2OjgzwwDHON wT6aWCEADFwTzil7cQLvSNvrc0CH5bvfx0DY/xjJ6DKNQ4xUfkn3Tavyfv/p/7YTgOhI 56AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Dl6BHgZheV/01Rbyhx3jC8IomoCHcIRSOzsHgIURB0k=; b=cS6aprxDVJkn7ihzLa5Y4uxL73Tvr7wq5vOKlZyIPIbm8+gH4GrWjNJ29L1oOfMPpV p2B/aoV4xXUklBxeRP6nbJ2hwkQGa062DnCUUtgRkbPK8Dayou8E+7KaUT6msmUZTQAn 6vCB3Q1+BU+5ccBb3sozDa5cXpLs1Y7Cxsnq3oq+VDRoXqZjOmzUGGpvHWZrQFk5h7AY Ihpn5LsYn9JP783JkQB0YWmqv0KvbIZjfhbxVzDwlECeAxFA/qnkZleSdahLkmUwHl1/ nOzPkLA8QPaASUBgqkyc6NLtUr/grboBxY6lSvaeV/pY7lapXzx3A1/XE/UylIKhJZ/o Xxjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=LXG4o5ID; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a17090617c500b006e8427b3b7dsi6098992eje.348.2022.04.11.02.08.24; Mon, 11 Apr 2022 02:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=LXG4o5ID; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241559AbiDKGWP (ORCPT + 99 others); Mon, 11 Apr 2022 02:22:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244879AbiDKGWN (ORCPT ); Mon, 11 Apr 2022 02:22:13 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E49B23D1DF; Sun, 10 Apr 2022 23:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1649657995; bh=sfEMxueHlINxP3Ft9h3uCgQL3x0NL57EBnCByLr9WHw=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=LXG4o5IDHO3ef5fr2tCKvvAdmWy6WIOep7bK3zPAw1v0pOte4O2KeD1jEN7hX5ct4 IcwhR6sh4VZBXqQfqgaSM9+8BW5vCFjVtyaGLZZVttgDs/8q7oGwGLU+PTHciFrDh2 adcuO0ETsyF73Pz5sk0MlqsJzWhDmnmrfh/Fm57M= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.145.57]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MvK0R-1nuukM0DMv-00rHOG; Mon, 11 Apr 2022 08:19:55 +0200 Message-ID: Date: Mon, 11 Apr 2022 08:18:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 1/7] video: fbdev: i740fb: Error out if 'pixclock' equals zero Content-Language: en-US To: Ondrej Zary , Zheyu Ma Cc: Linux Fbdev development list , DRI Development , Linux Kernel Mailing List References: <20220404084723.79089-1-zheyuma97@gmail.com> <202204101102.13505.linux@zary.sk> From: Helge Deller In-Reply-To: <202204101102.13505.linux@zary.sk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:7UMRgaQGw+lmVxgdw35JNxFmQ8/erZc7B2ZAznUL56KFExbyAyL eozhZDqrTS640g+EG/wkbxyUl8tATZwLYGBClGzFD5kDMy1zVp8ncsOPrHKCShmztq59eXl 43nNT+8gxU1B2smqyyhJrXqFFnQ5TDJsLNhcWI8Uh+nsFWnporQ37jdkOTraCUBwf05DeQm egEJBdtNlJbsWoNHbWn6w== X-UI-Out-Filterresults: notjunk:1;V03:K0:wz+exaJD4EU=:qCbHUBMR0eECdtBeg75SJM U4Thoi+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ai+BNEoqpVuk8noaVYKyCKBV76Bi iV/iWoQhb/7Iw0= X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/10/22 11:02, Ondrej Zary wrote: > On Friday 08 April 2022 03:58:10 Zheyu Ma wrote: >> On Fri, Apr 8, 2022 at 3:50 AM Helge Deller wrote: >>> >>> On 4/4/22 10:47, Zheyu Ma wrote: >>>> The userspace program could pass any values to the driver through >>>> ioctl() interface. If the driver doesn't check the value of 'pixclock= ', >>>> it may cause divide error. >>>> >>>> Fix this by checking whether 'pixclock' is zero in the function >>>> i740fb_check_var(). >>>> >>>> The following log reveals it: >>>> >>>> divide error: 0000 [#1] PREEMPT SMP KASAN PTI >>>> RIP: 0010:i740fb_decode_var drivers/video/fbdev/i740fb.c:444 [inline] >>>> RIP: 0010:i740fb_set_par+0x272f/0x3bb0 drivers/video/fbdev/i740fb.c:7= 39 >>>> Call Trace: >>>> fb_set_var+0x604/0xeb0 drivers/video/fbdev/core/fbmem.c:1036 >>>> do_fb_ioctl+0x234/0x670 drivers/video/fbdev/core/fbmem.c:1112 >>>> fb_ioctl+0xdd/0x130 drivers/video/fbdev/core/fbmem.c:1191 >>>> vfs_ioctl fs/ioctl.c:51 [inline] >>>> __do_sys_ioctl fs/ioctl.c:874 [inline] >>>> >>>> Signed-off-by: Zheyu Ma >>> >>> Hello Zheyu, >>> >>> I've applied the patches #2-#7 of this series, but left >>> out this specific patch (for now). >>> As discussed on the mailing list we can try to come up with a >>> better fix (to round up the pixclock when it's invalid). >>> If not, I will apply this one later. >> >> I'm also looking forward to a more appropriate patch for this driver! > > I was not able to reproduce it at first but finally found it: the > monitor must be unplugged. If a valid EDID is present, > fb_validate_mode() call in i740fb_check_var() will refuse zero > pixclock. > > Haven't found any obvious way to correct zero pixclock value. Most other= drivers simply return -EINVAL. Thanks for checking, Ondrej! So, I'll apply the EINVAL-patch from Zheyu for now. Helge