From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iRxKp-0002OD-C3 for mharc-grub-devel@gnu.org; Tue, 05 Nov 2019 06:49:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49154) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRxKm-0002NX-Ap for grub-devel@gnu.org; Tue, 05 Nov 2019 06:49:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRxKl-0007AN-7J for grub-devel@gnu.org; Tue, 05 Nov 2019 06:49:16 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57086 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iRxKl-00079q-3w for grub-devel@gnu.org; Tue, 05 Nov 2019 06:49:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572954554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uBprg0tD9ME6VZ+uPunzcCozl9Jh/vPPHsHGXwQ8WcI=; b=Rg2a/Gk466JoxsWWxTOrC7bbUlxfdEMUPqO2GhomR1kA8DeIOAARyrO09rIVl65ycZSgC8 JDD2hH84V8mK1hiSn3HeezSuuKU5rZWDaclZOcEag6ITlO7HnRht0b7op9S086jB7M0xuh gtItnUHM/Wwdz/Lw6UNr6aNNOkThXmQ= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-8DJSsaczN3q6QmU7pXUDwA-1; Tue, 05 Nov 2019 06:49:12 -0500 Received: by mail-wm1-f69.google.com with SMTP id y14so6245597wmi.4 for ; Tue, 05 Nov 2019 03:49:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5OvILHWxta5NCq/EcberyW/XCf7+C7k9+R4YSgNB3ZI=; b=hLBOEU7diFCn1oUK/i7nEE/UVBp/e5QHBT+bSUeZXWtUKVAQWOjRQdjIG6WWvGa9BV PEZqEKXSLldGTgLTEYb55+7vDdGZSbw+ouUGtRjMaAUO/GT9z0/8MOSmFLQv2NIwVrvT y85r5yxbRfjzbDi3TLi017TPpoDDcIns1N+RnvqqEAzaiZVPu7iy6v3WQnXs8Ku2cWbb mVX3R6TKjxF7cihzcR27rssVyTQEawhLqKtgPcYVVcttK6BW+uJ9mbLOptWoiE45V0I/ +Zz6vFggwEePFTPtM+vuonBKpAg/FDjjVeGld9xrMOVQ99Pi2LbKJ2isx81GYCY5zVqI 4Zyw== X-Gm-Message-State: APjAAAUiONKVmSgR+NFJtazHNtkCPrmpEkM2wjUdi2raeDP7bPmm+JXr 1p9FgdRCjE1YHiV1hDlcnzUzxlE//ZlLL/rL5ffduyhoHaxR5BhkcCAfnwwBzt1QOQnOeBuEA/+ CgsAnWMGmsZw= X-Received: by 2002:adf:fc86:: with SMTP id g6mr24315497wrr.74.1572954550408; Tue, 05 Nov 2019 03:49:10 -0800 (PST) X-Google-Smtp-Source: APXvYqztASymKgaq4n+XqD6+KayUAmrV2CRWb5AEVHErpGY2dl3QCMvyHPc3P6s3B16J7q2qBkabqA== X-Received: by 2002:adf:fc86:: with SMTP id g6mr24315476wrr.74.1572954550165; Tue, 05 Nov 2019 03:49:10 -0800 (PST) Received: from [192.168.1.14] ([90.168.169.92]) by smtp.gmail.com with ESMTPSA id m13sm7702543wmc.41.2019.11.05.03.49.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Nov 2019 03:49:09 -0800 (PST) Subject: Re: [PATCH] Warn the user to edit environment block by grub-editenv To: The development of GNU GRUB , Michael Chang References: <20191105092010.29652-1-mchang@suse.com> From: Javier Martinez Canillas Message-ID: Date: Tue, 5 Nov 2019 12:49:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191105092010.29652-1-mchang@suse.com> Content-Language: en-US X-MC-Unique: 8DJSsaczN3q6QmU7pXUDwA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 11:49:17 -0000 Hello Michael, On 11/5/19 10:20 AM, Michael Chang wrote: > The environment block is a preallocated 1024-byte file serves as persiste= nt > storage for environment variables. It has its own format which is sensiti= ve to > corruption if using editor doesn't know how to process it. Besides the ed= itor > may inadvertantly change size allocation that could have it sparse the > filesystem which could lead to unexpected outcome. > Yes, we also get reports about this issue: https://bugzilla.redhat.com/show= _bug.cgi?id=3D1625124 =20 > This patch adds message in grubenv file to warn the user from editing it = by > tools other than grub-editenv. >=20 Agreed that users should be warned that the file should only be edited with the GRUB tools. I also wonder if grub-editenv can't be made more robust and correct a grube= nv file (i.e: filling the missing # characters / removing any extra # characte= r) if is found to be corrupted and not having the expected size. > Signed-off-by: Michael Chang > --- > util/editenv.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) >=20 The patch looks good to me. Reviewed-by: Javier Martinez Canillas Best regards, --=20 Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat