Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp365645imn; Thu, 4 Aug 2022 08:58:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR4vH9Y11lA9+cKE+jXrr9SstATRIjzOvffFDdNblTe4vJhILgUJEMeNXyobko7D6nZNYYdB X-Received: by 2002:a17:902:e549:b0:16d:d024:2de2 with SMTP id n9-20020a170902e54900b0016dd0242de2mr2546481plf.66.1659628686197; Thu, 04 Aug 2022 08:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659628686; cv=none; d=google.com; s=arc-20160816; b=iLBojoNDiqlyeOlU3lOwhdaz7UerAFo3ZrWcR/Ghgtm2kcBFGxdvnZnRHXdElbpNkV sudyFLXX2vD2vdGrGEQ+1TbrBoLcRvK+Zoqiy97f151N7OEhRoYSuyYpPykf0T73OUy4 pV/4CKA2cpKZ7Ii2kU1YFbhy+LW6f4V7GpAZULs8a2kS39YOqPRKCFy7N8QpEUVUJucp n0mk2zJalTcG2M2CPbl4k2QxeRizTn9QVlXDBTqCVgbSekHl5VLdJFSc4ToeXnkpKc6W 20PJjKT5jDQ4czNCk0Ihotmaty+Aqxmo/gXttb4DAbSzbAerzQhONB4rpwphn589/AdE q57Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=4szX0x1AZ94kz3K3aHO1BiCITOi8FaCdbwghIwcTECQ=; b=AHzDdpwmxaPCyek7z+9XUouC0H2qgMD8KcimIv4BRdO9ho4KO8RC4wzh9HoexwBy0z Jit7+eNWPEsRKU9Wt/YPfXjDK7J3CtJ3su0GZ6ZtkmBh3o8g5hapLZVak8GxRjk+YzRx 5nb+FIw+PR9hJx2zKZ4JM015rJwN4BnUd/4Fx6E1/qcOzwIfpe9BTlq+uWzENLhmm8sy leFL529hjrwl7te+nXpnSzTXwynhipCprmBkrjchecd0OBYUWzr7PMz0K99pKiwRpkKC gRAjNGNT+wyWmMQvbPSoUjOc0pR6YGsQOwE8r99M0RFqgiEapqHH7MTpqCVfTecJcfiK 4BYg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s22-20020a639256000000b00419b27d0a83si123048pgn.476.2022.08.04.08.57.50; Thu, 04 Aug 2022 08:58:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240078AbiHDOwS (ORCPT + 99 others); Thu, 4 Aug 2022 10:52:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240062AbiHDOwK (ORCPT ); Thu, 4 Aug 2022 10:52:10 -0400 X-Greylist: delayed 497 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 04 Aug 2022 07:52:07 PDT Received: from mail.crfreenet.org (varda.crfreenet.org [185.133.240.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F329F2A25D; Thu, 4 Aug 2022 07:52:07 -0700 (PDT) Received: from finarfin (slizka.chapadla.cz [93.99.228.74]) by mail.crfreenet.org (Postfix) with ESMTP id 9C74B2C230E; Thu, 4 Aug 2022 16:43:47 +0200 (CEST) Date: Thu, 4 Aug 2022 16:43:47 +0200 From: Ondrej Zajicek To: Zheyu Ma Cc: deller@gmx.de, adaplas@gmail.com, akpm@linux-foundation.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/3] Fix bugs in *_set_par() caused by user input Message-ID: References: <20220804124125.3506755-1-zheyuma97@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220804124125.3506755-1-zheyuma97@gmail.com> X-Operating-System: Debian GNU/Linux X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 Thu, Aug 04, 2022 at 08:41:22PM +0800, Zheyu Ma wrote: > In the function *_set_par(), the value of 'screen_size' is > calculated by the user input. If the user provides the improper value, > the value of 'screen_size' may larger than 'info->screen_size', which > may cause a bug in the memset_io(). Hi I did not saw fbdev code in years, but should not this be already checked by *_check_var() ? arkfb_check_var(): ... /* Check whether have enough memory */ mem = ((var->bits_per_pixel * var->xres_virtual) >> 3) * var->yres_virtual; if (mem > info->screen_size) ... -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."