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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 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 80F76C55ABD for ; Fri, 13 Nov 2020 18:03:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F39C208D5 for ; Fri, 13 Nov 2020 18:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbgKMSDJ (ORCPT ); Fri, 13 Nov 2020 13:03:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:55738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgKMSDJ (ORCPT ); Fri, 13 Nov 2020 13:03:09 -0500 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BFA89208D5; Fri, 13 Nov 2020 18:03:07 +0000 (UTC) Date: Fri, 13 Nov 2020 13:03:05 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Ingo Molnar , Masami Hiramatsu , Chen Yu Subject: Re: [GIT PULL] bootconfig: Extend the magic check range to the preceding 3 bytes Message-ID: <20201113130305.42284c27@oasis.local.home> In-Reply-To: References: <20201113082930.27da4612@oasis.local.home> <20201113125419.3656d001@oasis.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Nov 2020 09:57:54 -0800 Linus Torvalds wrote: > On Fri, Nov 13, 2020 at 9:54 AM Steven Rostedt wrote: > > > > The issue is that grub padded the end of the ramdisk after loading it > > into memory. I'm not sure how the bootconfig tool can fix this. Perhaps > > make sure the ram disk size is 4 bytes aligned? > > Exactly. Since - as far as I can tell - the _only_ thing that actually > generates that BOOTCONFIG_MAGIC marker is the bootconfig tool, you > control the vertical and the horizontal. No need for some "heuristic" > and searching for things. > > And then that thing needs to be documented, so that if somebody else > starts generating BOOTCONFIG_MAGIC markers, we have a hard rule in > place that "look, the bootconfig is always aligned". > > Might as well align it more than 4 bytes while at it and make it even stricter. > OK, yes I agree with this. Masami, can you send a patch to fix the bootconfig tool to make sure that when it appends to the initrd that it makes sure the file size is aligned. Would 32 bytes be big enough for an alignment? -- Steve