Received: from list by lists.gnu.org with archive (Exim 4.71) id 1f6YEG-0003lw-0a for mharc-grub-devel@gnu.org; Thu, 12 Apr 2018 05:09:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6YED-0003l7-9c for grub-devel@gnu.org; Thu, 12 Apr 2018 05:09:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6YEA-0008BO-J1 for grub-devel@gnu.org; Thu, 12 Apr 2018 05:09:13 -0400 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:46742) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f6YEA-0008An-7q for grub-devel@gnu.org; Thu, 12 Apr 2018 05:09:10 -0400 Received: by mail-lf0-x229.google.com with SMTP id j68-v6so6597788lfg.13 for ; Thu, 12 Apr 2018 02:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=northern.tech; s=google; h=subject:to:references:cc:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LVWriETWDLo1mykt6kSvgRYujJfmQvFMe3Gh21XVACc=; b=d1QTES3l4VUwZzcE6VOszOuZ+4QgDrhMv3h45hSSoXnpPEZPiGY9C5qgwno7QsWi9P Pp0ih2l1FTrwprK66rsm1A4Yz4NCfU1B6lFpNKIQ2z5/E9BppCSfrdd1eFbXyLdIpLmP e1z7wGJRcxIqB4ZqcKm7MATPDlPqeosqCYIfvEKHRfOAmAR9LPRphCGB2+ikW9tESe8j OOdfd3TE1xGdOVF4ddPFISC4FMLeSbfBypseYAoa5XZgp6g0tYoqEunWOabDsKKkseop atozCLXh1zk1kJy/Usdl/o4ywcmv0vdULmQnzORXBE6gxnrpWaUiujDhNBDiTrDwM/EE x8VA== 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:cc:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=LVWriETWDLo1mykt6kSvgRYujJfmQvFMe3Gh21XVACc=; b=S/1+Yktp7gTwTQ0VcG5tZzYfW9DkhY2yKZKyP6Hf0gxituKbpgKRVvKzBEXFd2714/ DsP0zA4SaIS6FWmuCD0ELFCw8PHW8xpPSG77K2wxGaLE/EH8RlVFhHwwIGr9MK1NI3OX Fygnq0eqpDzDOS8u64ShOWh0Bt7xyFqZT4kZJ6k0KOTRNFXh4UU8ihFObElqxn5jGEQ+ rALXuq8LYsAWBj9CPhtrxz3c3c7S8f8iRTyjfXv/J044v9gbKK9ZBOzqSY+NN3tyFjuD LUcZoyZN0ViG4wGRvmTd7PsLEPSUvFKjvS4ZsK3HbppiG0aFxnjKYxUqGlVUgB/pzP3H EYgA== X-Gm-Message-State: ALQs6tClOH5qq0wTtCyMfObdfVLQFUtbN/AXRudStjUC3mWoWyM2FeMi 4voLlPEHevz6hQ5sFllHg3j5qA== X-Google-Smtp-Source: AIpwx4//3sa11sBgtU3wGpjgeLTShu3bFaNfv75NyDWtAjqLbg3ltV0aYNyvHMBZOfq3eptSH7Ylog== X-Received: by 10.46.32.154 with SMTP id g26mr70430lji.71.1523524148924; Thu, 12 Apr 2018 02:09:08 -0700 (PDT) Received: from [10.20.33.225] ([195.159.234.190]) by smtp.googlemail.com with ESMTPSA id a19sm510215lji.65.2018.04.12.02.09.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Apr 2018 02:09:08 -0700 (PDT) Subject: Re: Checksummed environments To: Daniel Kiper References: <20180406123535.GB22814@router-fw-old.local.net-space.pl> <0cb713c1-1605-eb86-8e48-86f900397394@northern.tech> <20180410210933.GD25917@router-fw-old.local.net-space.pl> <20180412083320.GA12846@router-fw-old.local.net-space.pl> <3713e9e0-5ffe-0058-78c1-beb151d792f7@northern.tech> <20180412085859.GA13145@router-fw-old.local.net-space.pl> Cc: grub-devel@gnu.org From: Kristian Amlie Openpgp: preference=signencrypt Autocrypt: addr=kristian.amlie@northern.tech; keydata= xsBNBFO1KB4BCADPoBKVUtAQJWjK6xQ7LaQsbDyhvF1cNsa0Le2JmBD5HbPVjr1M+5nOIDFa cYV48JjElddEEB4kGT47RSYNxqJCnsi5rlpDnu4BoDvKYfm84lSXalvCcQLVe2ZWYx4fFOHG sf67Mm0igQHX50Rav0XaRzigPrZN+kokEjrtQ6LIEZ9JAxBt2/aDhBZQRzKPzR/WntfkYZz/ i0Bxg4K+kzffKQX+6xagGEhBLNr0Z4WnGMTuBtXTumoG3WTZW56QCelrIy39sPlLizfrk87W LjWtH5pR2ZMP4vRdLQgGZHFyzy+vrqyTa7lyTXwNP+EySkYvRh+Z0J/tFBM68+OLT8onABEB AAHNLUtyaXN0aWFuIEFtbGllIDxrcmlzdGlhbi5hbWxpZUBub3J0aGVybi50ZWNoPsLAgAQT AQgAKgIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAUJB/YYJwUCWrisXwIZAQAKCRD0ZEB8 mWrwPyKACACS3BmkFQPJGCzh6zZHPg4OY4PD5975f0AEsCelumWr6utc5Fv/FAA8LxmfTMlp cCgCWRIJYz2ed3Wlv0ij5gJGV+P+paxJo7OnHRXuE0j4R7/EqOaVbb4/ugIJBjCpbDw9NHQf a+pE7CMQTiteLhrcR/CvkCMKPwS3YqrcPgiHQhl3+bdkhS+EtgaoYsl7takvoJj79zyVEmD+ ongc5mQCl/bWPw9r4O74uByAoIBAfptlZIy12RIiQrwqKoSxeG3LG9IlU8E5Kt0QljK0zn39 6rwtyOIZkyBnp9luba2qMxJAAk3xhSBvYSw5B++oYH096MSOIrYaGV4CzCVm0BeIzsBNBFO1 KB4BCADesp6XBc9c5FJ232qIDZQa/4ySJ8xTikMt3PcKIamqag1llMHxD5yZ9XU1ljpRNFTJ w+ZQ0LGwpe8TAPa0cbvCmlMUCVgjSLzPCdR2GeTCKNY1O/H7MfIzJ8PU0cZfSQc9WuXsExUt d6UuaOTdI1yobZpebC9LkjTJGxqMLa5Oih5paAvxchw6dv0ZBUq27lo++fsO8Cm7c1N+0+yk o//BdFOq8W4ekfKFpQGtfOojgXEQHnwSQ6bj5S+lKHtTgXlR1t6tqbAGD9O+qNCgULdL15vj yfSNDlt7qFZKdy+xlfU1K5e3AXCtur7Z/CmYjzuInAciJJe6MBpRFRR8uUxpABEBAAHCwGUE GAECAA8CGwwFAlq4rCYFCQf2GAgACgkQ9GRAfJlq8D9jdQf/WY5NHcCY88jB6CWT1o4qpqF6 qxlDgFqMn/X5Q+IG6fjCmmUQw303PynPW9q+Qqaj8gA5yuOP4rdE3vpCMuIpSIqM9BgFlD1A P35TyZER9qgPSmiyjqLWJcBNu91Zrd1etYQeaPtI40H+8x7vy+RHN3Gln8yz5gUkr0Xeh8Hn zaqP5wMlWn6mKZ8dq1iC8XqS9iR0JUwRJUoMj0OfaP1tGuDcv8OrY2LKgfsXOq3hv1JaJU4O K2jkPsiqjF4v8528DSlWqThAsQtR5G0Mwr3HWtauW46Ne0fcDaC/++MVw5/QO6TVIY07zm4V 6hiVosSQLqAS/nqT9/20uQaNj41w9Q== Message-ID: <0fc2043f-05c6-3fe0-812e-e1def40362d9@northern.tech> Date: Thu, 12 Apr 2018 11:09:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180412085859.GA13145@router-fw-old.local.net-space.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::229 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 09:09:14 -0000 On 12/04/18 10:58, Daniel Kiper wrote: > On Thu, Apr 12, 2018 at 10:35:06AM +0200, Kristian Amlie wrote: >> On 12/04/18 10:33, Daniel Kiper wrote: >>> On Tue, Apr 10, 2018 at 11:09:33PM +0200, Daniel Kiper wrote: >>>> On Fri, Apr 06, 2018 at 03:08:23PM +0200, Kristian Amlie wrote: >>>>> On 06/04/18 14:35, Daniel Kiper wrote: >>>>>> On Fri, Apr 06, 2018 at 11:25:22AM +0200, Kristian Amlie wrote: >>>>>>> This is an important safety criterion for us, so we've been thinking of >>>>>>> developing environment block checksumming as an extension to the >>>>>>> existing save_env and load_env commands. The most likely approach will >>>>>>> be to grab X amount of bytes at the end of the block and use these for >>>>>>> the checksum. >>>>>> >>>>>> Could you tell us more about that? >>>>> >>>>> The idea comes from U-Boot [1], which uses a dedicated block on a >>>>> storage device to store data, and uses a CRC32 checksum to make sure it >>>>> is consistent. The motivation is to be able to detect that the block is >>>>> corrupt, rather than accepting a block of data that may have incorrect >>>>> data in if a write was interrupted midway by a powerloss. You can read >>>>> more about it in the link. >>>>> >>>>> [2] https://www.denx.de/wiki/DULG/UBootEnvVariables >>>> >>>> I am OK with the idea. However, I think that the feature should have >>>> a kind of switch to turn it off/on. At first sight it looks that new >>>> environment variable is sufficient for it. >>> >>> And/Or an argument for save_env/load_env... >> >> Yes, I'm fine with either. How about a variable that determines the >> default, and you can override it with flags? > > Works for me. However, I would assume that this feature is by default off. Of course, we need to maintain full backwards compatibility! :-) -- Kristian