Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp370855pxm; Wed, 2 Mar 2022 17:36:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQWcYI1HcrWysMjs/C1aYKgeBdIARJwl1OucKpHAPXJvkA9lp4D/RGLPTCtS0qCb9aSlFI X-Received: by 2002:a17:902:7e08:b0:151:65dd:a2d1 with SMTP id b8-20020a1709027e0800b0015165dda2d1mr18671645plm.66.1646271383713; Wed, 02 Mar 2022 17:36:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646271383; cv=none; d=google.com; s=arc-20160816; b=JlK8dRtNYY9wH5CQewG1msCkOfpnZrvT5sWgw95i8gL4Hd3mPuW6UTSxhTon4uaYXf onZyqqwfYMq/UTw1X39aEoBRYsjFGJlH7Xccct8/OCBfrhXTfIndcfJF7tgSCxjw7jYp +6Lw2IxVL1HRqOBTHAPq+5OS+ZfSN7lzLnjvWuWn8Emh0yzOYyb9mdN4vzCpvl5Uc42F /1J9NhnFOJ1XjNH/cp7Wv14cQyaFr5IGr++7FsBuUqpCuFlMQQ2zUUzHXL4yFGshE3hJ 3Nal9qf5PSm+AXKfrdeiH+TuS/OnlnBxeFf0yL+VYW6ZK4fqn2lqAP+0l4dWD+6tf8br bsdw== 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=FJe6o6kOYUsVDZGZdIQBgO3hTT0nURrPq8TyLaBL26k=; b=IftZEWTN/0nx7mkQG+wYG+YB27FshhrbwTSKIX0FtrEiiv0sX6IungjjYncvRLYUe4 LuoBWA1ha74Yh4t3cVZe5b5sAio26/ksvpZW4+vWujQGwQ/cgnceniJudlXTYqqPxspU vkAkrD7FutaPvxav967voMxvoyZJkBQTF16uUr+2I2UjetVdNsBst3Y0iPpEPYBmaVL8 /bgQPoah/0rn0HKoHNw8d0pbQEJuvMmos6nYH8ysZcGm2iNGZWB7RTmRlD6gDN5kWH4k om6gZoOt5u3rUk4S8yFPhEAdGPsymppeOtR6CSNb4kzq+L593ZH2hjZguCaMmlv6HLGQ 7Q3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ji3otGrQ; 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 t1-20020a17090340c100b00151a703b713si627481pld.187.2022.03.02.17.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 17:36:23 -0800 (PST) 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=Ji3otGrQ; 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 620571AE660; Wed, 2 Mar 2022 17:34:58 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231373AbiCCBfj (ORCPT + 99 others); Wed, 2 Mar 2022 20:35:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231340AbiCCBfg (ORCPT ); Wed, 2 Mar 2022 20:35:36 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E57661AE654; Wed, 2 Mar 2022 17:34:51 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id gb21so3354984pjb.5; Wed, 02 Mar 2022 17:34:51 -0800 (PST) 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=FJe6o6kOYUsVDZGZdIQBgO3hTT0nURrPq8TyLaBL26k=; b=Ji3otGrQQO90v6nf+Pw0zJXjsReY+4IjW093S6IgLizJrTza5WMcsk0sMiXJdviB+j Gh/xZapihQUXk85y5My0tcVzcCuk8AkqgJDrnZXt66EMyzvwySzGDKm5qirXLkCDOLa9 r0BKQJj1PHblhVXqTk5umT/zQ8zvNYJiHOtkv8tWAhAAhXVNf2Mi7GKDitx2OSSr13SG RAJanLoAAPSd6qzFEOEk7LuaUbXGfaPd7BwQT/vCAp2c8r/EFP4NZanbRvyVdZuXbLgT khSadLdadCKnYa5ZhmantnCSs50Jck+Mb67Gu4iDKgfgFndBgWiTGew/b/yokahgewlj YdDw== 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=FJe6o6kOYUsVDZGZdIQBgO3hTT0nURrPq8TyLaBL26k=; b=4qE97CHRdLiEguVp5uJto5xCdm95Pj3ZqLgYwoYTEwjc7O04f21XK8CiI6uZlPi7+e fGWEN5palfGCNw5BDhX+yalkOS60yCyRmAgFwv0M6Y7Qrd+rGJ8EZwX/2SMVljW/X1Qh 9x+NsnkFM777QlhO5eo2TVMtsWixuVOBmm1vnMUQWK6GvrFJ+DQce6DwPXTqLn6x539Z 1PqX92L8gbYtr5kmcRV14eiFEQr5yy6vqUtMrsJJ/pRWXn8etnBlU8t8FU1Cbtl2lqh9 7NMGTTPi0Z0JkW+l/khL1GfdueOdLGMpKdckSUf83+Uclein7wRSNrcgqHVdLKZj4SW5 mNUQ== X-Gm-Message-State: AOAM532csGb2HqYD4HUIV80GBMrKNJufXwAAsf7oafZAaD9+myqnOFKF KSS104v3oubWHfUTe3wE7udiUhovJNOqH5wHSg== X-Received: by 2002:a17:902:8a91:b0:14f:969b:f6be with SMTP id p17-20020a1709028a9100b0014f969bf6bemr33826185plo.161.1646271291341; Wed, 02 Mar 2022 17:34:51 -0800 (PST) MIME-Version: 1.0 References: <20220302143311.2109322-1-zheyuma97@gmail.com> <666d1565-0467-bb21-916b-073392129e1a@gmx.de> In-Reply-To: <666d1565-0467-bb21-916b-073392129e1a@gmx.de> From: Zheyu Ma Date: Thu, 3 Mar 2022 09:34:40 +0800 Message-ID: Subject: Re: [PATCH] video: fbdev: sm712fb: Fix crash in smtcfb_write() To: Helge Deller Cc: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, 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 Hi, On Thu, Mar 3, 2022 at 12:49 AM Helge Deller wrote: > > On 3/2/22 15:33, Zheyu Ma wrote: > > When the sm712fb driver writes three bytes to the framebuffer, the > > driver will crash: > > > > BUG: unable to handle page fault for address: ffffc90001ffffff > > RIP: 0010:smtcfb_write+0x454/0x5b0 > > Call Trace: > > vfs_write+0x291/0xd60 > > ? do_sys_openat2+0x27d/0x350 > > ? __fget_light+0x54/0x340 > > ksys_write+0xce/0x190 > > do_syscall_64+0x43/0x90 > > entry_SYSCALL_64_after_hwframe+0x44/0xae > > > > Fix it by removing the open-coded endianness fixup-code. > > > > Signed-off-by: Zheyu Ma > > Thanks... it's already in the fbdev git tree and queued up for v5.18... > https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git/commit/?h=for-next&id=bd771cf5c4254511cc4abb88f3dab3bd58bdf8e8 This patch fixes the crash in smtcfb_read(), but there is a similar bug in smtcfb_write(), and I mocked up your patch a wrote a new patch for it. So we should fix two bugs with two patches. Regards, Zheyu Ma