Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp216532pxh; Thu, 7 Apr 2022 19:26:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxheu1NM2kUuc71SbOrFxXD93EkSoOCbLamP4tcjwvVSDHgsruxbWmVzOwgbzNrK+FxLVl X-Received: by 2002:a17:902:d091:b0:156:860d:6856 with SMTP id v17-20020a170902d09100b00156860d6856mr16933416plv.120.1649384803196; Thu, 07 Apr 2022 19:26:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649384803; cv=none; d=google.com; s=arc-20160816; b=lUC0kvUqx6/Gwfdo1hHm5lNWCg7DewCFRVGfJkoCkPTSHFGO0xaoP+Bv8SEvhRiYb2 RuBRSXnfR7NNUsraibyIGuj0T40xq33jgUAxz/7GpCK5xqUIDEh643t+DHQiSox9V8/o sHy+/0e7dbqPFLlBDskjgfoQ41iGR18aN0BH6ATFvGE5npmo3mwFNSeB9PzPFahBV1MJ A3UFZ6Iha2u2PTzSbmnJdK0CWf8OltJST+50Gq5yhk/6waJu/VnHbnfZ2LCs4l6fs5xA 15GplspeXT4COW/w2jRs8ktlqBcbdYujk8oz87RVBhbZDm94trhJ0FnygcrZTbkZ9V0Y nMVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QDV7vyVJua5x627okL/E8Nxi+qH90boTSsIqmiOxLwI=; b=suVPKzh8aOJUU3z8YMNKWlUm+pYDeknEAjTYa+aD/X9OfIh0cjpM0Nv8EuTj4D6hAp kUE0E8Z+KX3BlFXqSrbfQR2RN+Wp3lznUv2igHgZ++VBR0IcRZF4Iz5oueW0DgRg1R4Z Gx+R6Ia0kjNaCr2c9ukQEoUisysYFwQpPF1BNM4NP5Rk933Y9NJmNr4qy7UnhCP3Xdjz JGIsCpW3cY9HmgKY91hEp5V80DjNhKf8b20+l0qFDWpZafPGOfnYlylvkD7EZgIR3J5H B/M+jCBv8BAHn9AbThOiGNeSROYwXxEWgOpp7Aib7bERuuHej8s07H4XFYONkk8DYBIo WgBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bLbexJ08; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a24-20020a63e858000000b0039caaf68536si32119pgk.365.2022.04.07.19.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 19:26:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bLbexJ08; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E8821CB02; Thu, 7 Apr 2022 18:58:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233570AbiDHCA2 (ORCPT + 99 others); Thu, 7 Apr 2022 22:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbiDHCAX (ORCPT ); Thu, 7 Apr 2022 22:00:23 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89FBF63C3; Thu, 7 Apr 2022 18:58:21 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id n8so6665088plh.1; Thu, 07 Apr 2022 18:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QDV7vyVJua5x627okL/E8Nxi+qH90boTSsIqmiOxLwI=; b=bLbexJ08nK+TWPoYlGxZS1ziMwfEiNM87Hlc5Aqszi3h8/f4qux0ng/XTX6ol5mTaA H39eWUpuBI9MAYKqMhrxBkAJXd52jvhwp24o4jqVANR7oNkQyNLbPtpOD6TtXAPtRsot tIH7+M+u8k5IeGu584A4sF9KCmBn1U3AgmNw0A2vw4VlZ88ynwh2bf0eafSvudh3JkIS wDu5j/BMfPTn8yrUGJkMLGFOl5PkBfsD/iH+TJo0R+MOzqC24PSr+HmDAwfKYIly7Lpj 3OQSIPP6arO/QbH6GuLkzGcBkdH5LD2+lWvUxI/SAW0qm0T/fcc5hgoCMF5pzDBHwGPx OBVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QDV7vyVJua5x627okL/E8Nxi+qH90boTSsIqmiOxLwI=; b=XjdMjyJ+i9NxTg4QLTqN3U37p3GGb9L4XrTl4lrzMXzVWEo83Q0kviQyz5/J/d4D3E 8f8v6YeJctmjFjgver1quvJo6GuQcCYiRd2kJfg/Hg8Rvf8h/KF0SjEKbXSVGbdDORfK joqo+5Txt3ibwJGupgEAh75Ss4XY/N/B3WBtmTUPVTCcYTVhdACBdXDtDEiDDaHR0KpL s+Z3/jJH/EJ0V7mqCA6fo9s02+vYUII8UtUP019HDFLNcZ4lvUi4tYlHCnXti8Fg4FzS iv5jhraTVwtuQLmZz6Tz/6oRWkNHd3ZAR1LlAtUgzIEF3GmOIj74EJ3HPyFxLanPoVWd v7pw== X-Gm-Message-State: AOAM531tVwPfUVi/Q0Y5TqIWVn9e80Hqjk0IHgnm/pavsOQUNJ9GzWeh gTVFUAAcjpHs3eYKDBz8PMbKyY3wCcwmyMBaRn4RDMM9gNSw X-Received: by 2002:a17:90a:5407:b0:1bf:43ce:f11b with SMTP id z7-20020a17090a540700b001bf43cef11bmr19285418pjh.31.1649383101050; Thu, 07 Apr 2022 18:58:21 -0700 (PDT) MIME-Version: 1.0 References: <20220404084723.79089-1-zheyuma97@gmail.com> <20220404084723.79089-2-zheyuma97@gmail.com> In-Reply-To: From: Zheyu Ma Date: Fri, 8 Apr 2022 09:58:10 +0800 Message-ID: Subject: Re: [PATCH 1/7] video: fbdev: i740fb: Error out if 'pixclock' equals zero To: Helge Deller Cc: Linux Fbdev development list , DRI Development , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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:739 > > 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! Thanks, Zheyu Ma