From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B47BC00A89 for ; Mon, 2 Nov 2020 16:23:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F28FD208B6 for ; Mon, 2 Nov 2020 16:23:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BBdNLRdm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PixVJiQv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F28FD208B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t8iMVwx28Zvao7BM+C/MV4GdlUa7YEvfWO9mSfblFOw=; b=BBdNLRdmAHyQAtmV+v6La7rGg RGPvphVSHkBnaQXdxNnH9FMY91czkrERBkKN1dEd5tFFLmvpCtG7Kgc1JRoeioQ2Q3sYXsEj6Kvxb 5cpoDeIs7Kt404n+oV6DZa/sQhgxek+jtZJMJg3nNqj0tAxYXQyAInvhSi0j3Mxcto9z1oI/SGoYe gVAaPmlFTUVuO+UJIC90xIFRJvFhvDMtQwIsXnhHeqNZtZiTb9cqY1SYR4EXYN2Hko56hd1FTAT3W A7+OumQA1Gn/FnzSkzZgh2rmEIxKBDWwdRf6lZDPpNfmo2NsQ/BT+RmVY1YACrIv5CEOIS/GM6Cl2 V35j5fBVw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZcbS-0007DU-BV; Mon, 02 Nov 2020 16:22:42 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZcRR-0002Zt-71 for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2020 16:12:27 +0000 Received: by mail-pl1-x641.google.com with SMTP id b12so7050510plr.4 for ; Mon, 02 Nov 2020 08:12:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rmFpankWLJheBPHzQ8xk4lfNURwOLXv70XaVIKZdiwQ=; b=PixVJiQveY36P8J7rMawey5rmPa9eaEgULEO6TUxwJFITNeIuTFCWNDFPAqR68Hv0A CKlf7b+vfM/4YiksEHZqi+ai+c5QIeR3GsvNY3pmFpjV6ApUdeh8y8m8lPe7ZC7qfrQM Gd6HLqKQoRrz/UwtZXOyYuxLs1TmGmFTDrV9JV9fua2hN7IsPx4rtXxKeIOqw7xBxtYa 86YcV8Q+PEn25+UprntpeFHhyK9LEwrWKoOOQrt6fdIhoBUGzit/TJoNLUS2iv55KY/s NqceMtCSEQAGMa2tVnl1FkomlDEft1Yy4G9FMo1QxCrVWF6CKvMBg4ZyBMkLd+T02UXb L+Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rmFpankWLJheBPHzQ8xk4lfNURwOLXv70XaVIKZdiwQ=; b=YX8mTv3zrx6+C4GVemwi41bBDy7ReMAvE+5XjazOTs6UgTMqo0yWLblOXp0/iMFbFa LDem+QLApfOWoHzMnJDSvN2A58DJV/hDgndLomdLcFLYqjj6Lfxjw2X9Jq0mXByAGxEt I3TRjQ22srVtboW9ffhNjkGLFo/OaMu5HWt2iVzaAdDP4x3L84kr3zxX/C0VxY5RkIVx Vnj5007E4OuOI7eLKiEbZCvIRXpBA2xKqMly3A+TXdsR1lleEaBHxyJDr4i7dew2xCUw R/06C6uWujtKv9QLCSj1+ZTiRtkqGeJ1Dnx3bJOQna5NN7bfuYtHDR/Xo/4Zw4Ap/n3y yDEQ== X-Gm-Message-State: AOAM533JtG9W6cTlH1rJSgk6CkIGcjpdPBz7/MUcfE/CeU2IhydaZ60V 26HwPkCYnE4wOfjdGvwKM66XB7k0f7I0 X-Google-Smtp-Source: ABdhPJwOe7sZoHnAXjluowvFrA5C+q7qIO9nN9eYgaojlB/SsctUFflBl6Y/wkyBgtLlEnq9QD0t+g== X-Received: by 2002:a17:902:eacd:b029:d6:cc2f:a18 with SMTP id p13-20020a170902eacdb02900d6cc2f0a18mr5588685pld.36.1604333534512; Mon, 02 Nov 2020 08:12:14 -0800 (PST) Received: from PWN (59-125-13-244.HINET-IP.hinet.net. [59.125.13.244]) by smtp.gmail.com with ESMTPSA id hg15sm12318541pjb.39.2020.11.02.08.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 08:12:13 -0800 (PST) Date: Mon, 2 Nov 2020 11:12:03 -0500 From: Peilin Ye To: Russell King - ARM Linux admin Subject: Re: [PATCH 1/1] Fonts: font_acorn_8x8: Replace discarded const qualifier Message-ID: <20201102161203.GA1561792@PWN> References: <20201030181822.570402-1-lee.jones@linaro.org> <20201031102709.GH1551@shell.armlinux.org.uk> <20201101131122.GD4127@dell> <20201102102343.GK1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201102102343.GK1551@shell.armlinux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201102_111221_762601_DF5C4560 X-CRM114-Status: GOOD ( 27.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org, stable@vger.kernel.org, gregkh@linuxfoundation.org, Lee Jones , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Russell, On Mon, Nov 02, 2020 at 10:23:43AM +0000, Russell King - ARM Linux admin wrote: > On Sun, Nov 01, 2020 at 01:11:22PM +0000, Lee Jones wrote: > > On Sat, 31 Oct 2020, Russell King - ARM Linux admin wrote: > > > > > On Fri, Oct 30, 2020 at 06:18:22PM +0000, Lee Jones wrote: > > > > Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for > > > > > > Your commit ID does not exist in mainline kernels, which makes this > > > confusing. The commit ID you should be using is 6735b4632def. > > > > Ah yes, quite right. That is the ID from android-3.18 where this > > issue was first seen and fixed against. I will fix it up for > > Mainline. > > > > Does the fix look okay to you though Russell? > > Frankly, I don't know. Looking at the commit itself, it looks safe, > but it depends what this "extra" data is being used for. From what > I can see, the commit in question just adds the additional opaque > data as a member named "extra", and one is left to guess what it's > use as. Thank you very much for looking into this. I apologize for the trouble and confusion it has caused. The motivation behind this commit, and commit 5af08640795b ("fbcon: Fix global-out-of-bounds read in fbcon_get_font()") was to fix a decades-old out-of-bounds access bug in the framebuffer layer. However the framebuffer layer is doing bounds checking in a very strange way, by hiding the buffer length before the buffer, then access it using a negative-indexing macro: #define FNTSIZE(fd) (((int *)(fd))[-2]) Other "extra" (so-called by the framebuffer layer) fields include: #define REFCOUNT(fd) (((int *)(fd))[-1]) #define FNTCHARCNT(fd) (((int *)(fd))[-3]) #define FNTSUM(fd) (((int *)(fd))[-4]) ...representing reference count, character count and checksum, respectively. The commit in question (6735b4632def) prepends the buffer length to each of the built-in font buffers, so other functions in the framebuffer layer can use FNTSIZE() on them. 5af08640795b uses it to fix that out-of-bounds bug. > I'd have thought a small structure with named members would have > been the minimum given our standards for in-kernel code. Yes, this is a temporary bug fix, and is far from satisfactory. We are trying to replace these magic macros using a structure with properly named members. It is taking more time than I imagined, but one day this temporary fix will disappear from the kernel, I hope. > Why was the "const" dropped in the first place? Does this "extra" > member get written to somewhere? No, I will try to come up with a solution without these fields being writable. > So, sorry, no idea. This looks to me like a very unsatisfactory > commit, and probably something that got a very poor review. I hope this helps explain it. Again, I apologize for all the troubles. I will do more thorough testing and practice writing a commit message. Thank you! Sincerely, Peilin Ye _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel