Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp781785pxm; Thu, 3 Mar 2022 04:39:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9WHx04tq9kKWW0ORhUIPyNapR6xl9KzvogOq9xVylXO51V6R4VB3pyo09tutwMfGOpHso X-Received: by 2002:a05:6402:50d2:b0:413:1cd8:e08e with SMTP id h18-20020a05640250d200b004131cd8e08emr34368654edb.276.1646311151174; Thu, 03 Mar 2022 04:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646311151; cv=none; d=google.com; s=arc-20160816; b=PFk+6IW1/wHDYiA9grzd8kkhquWpEStFR5zp4Lgb0Glb03RQajRRQzJqj1tQ88K64H JDpClXggEJ/m61V7w8iRtjU1FQ5+AWFG1cnsTH6dzhj79CltQiQ6nqhGUztM2jJwDAOV +9iNJJhy97CbvZ9vOnDYXuSIn1cwf648qu/xD9++orb+xJr/C9Gu4myLVls4nMOwYGyS 25PJbDmdIrdiZVhTzKCjGq2GaeSF+f0X0f2NF0Via3cm5s13jLHkELxWC+bzkaI2hocs FQ8TFpWvZlWM0innGXGNukfGTIEp/2B1fDzZ1zWtoKQ6ldRq2k2TmXpUkoS0Pb6qbB2+ jiYg== 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=yfdD7oXI2O4m8bk+0yeKZddLQxBnM9uABkC3H7pnIbk=; b=0qoHdUtDXng9z/vBod9+ki4nZnCMqz4gOh738zAJkcs0S1OKFatF2pXT2Bqhhb85Ln Pi+RZcYdtRkdOvFMtfh9fenH58dSLnUihj/yWiqHj594w6eIteOvmmGI7ThyUz9XomMO PHdHdHMQznPhTfvazsWcNh47fkc/B5EN6fqE6sJpg5XmSrXfKG0T/QPmQIq8n8ma0e8p sQXcAhKfXRdSthdDGO6TIp34NRy3dSfheDxZrW0biNiFSqUryTczxeGlZpQupom7peSH PdGb0/lf1uT0Xa8OsaJ+qtAQHJQr5z8l7em0SY8QTMUhCUqKKi4y5sKxuyOerfvcJ1lF ZGig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=jqnKQY8Q; 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 z22-20020a1709063a1600b006cea7059d8fsi1196711eje.947.2022.03.03.04.38.47; Thu, 03 Mar 2022 04:39:11 -0800 (PST) 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=jqnKQY8Q; 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 S232224AbiCCKSz (ORCPT + 99 others); Thu, 3 Mar 2022 05:18:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231436AbiCCKSx (ORCPT ); Thu, 3 Mar 2022 05:18:53 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5B6F43EEF; Thu, 3 Mar 2022 02:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646302675; bh=yNu5aV72kAVxWE9AEOpRwhvXEvz9REi7V2L5i8b9h3s=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=jqnKQY8QLOza54CSQbVUOmiQNlvoH/SQ3tAXO3JCVh1otqSL05CaQe7NMWApUEI2P PouLUKOwI8kjcNnVO98rScBjHK1x7721Iu+pmTOX+yUMA4n9YhOE2vNPXgYDeqCDLp ZzC/aUE9MkCTBwO9KVvb9oE7Q9eQYs3lwXUHPFeM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.242.61] ([80.187.120.72]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mj8mb-1o4WrG29AL-00f7DI; Thu, 03 Mar 2022 11:17:55 +0100 Message-ID: <3c08fd49-75e6-7016-a686-06a761cc679a@gmx.de> Date: Thu, 3 Mar 2022 11:16:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] video: fbdev: sm712fb: Fix crash in smtcfb_write() Content-Language: en-US To: Zheyu Ma Cc: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Linux Kernel Mailing List References: <20220302143311.2109322-1-zheyuma97@gmail.com> <666d1565-0467-bb21-916b-073392129e1a@gmx.de> From: Helge Deller In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:sAuAfXYVTz6VzBrsH0AZ6HYOL+QvuzH6C6VJQMmPCQOOf7g6N8V 8fkZrdNxVTACopONE1EiqqXi4q0t4n1GveqG93hk6YSmhwZirDXLAarWnen/abTWi9qfYI4 zlTaMeHpviWUsI+OYubD/B5rTs/Co0x1YEwJAM4ZLzsBf5WtKMa614rthfCexDC5wVtPFFD vNfnoyjY+0Kl52myht5Wg== X-UI-Out-Filterresults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 4P90OY6QTe8cQrChV5L7nRLjNoqv8OB8eFmIRFCtsMut2VWrKkbW7c2PcbieTuAHakiZxhBxZ P8JUPgbpvREqPY= X-Spam-Status: No, score=-2.6 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 3/3/22 02:34, Zheyu Ma wrote: > 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=3Dfor-next&id=3Dbd771cf5c4254511cc4abb88f3dab3bd58bdf8e8 > > 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. Right, I missed the read() code. I applied your patch now to the fbdev for-next git tree. Thanks! Helge > > Regards, > Zheyu Ma