Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2259540ybv; Fri, 14 Feb 2020 14:56:10 -0800 (PST) X-Google-Smtp-Source: APXvYqz//C59fu06lT+usHeW2zx5zKj+PWq58lGXDlqLbI1xQAbmtLNL3OEue/rASfyvs609QdYj X-Received: by 2002:a9d:6415:: with SMTP id h21mr4278004otl.152.1581720970257; Fri, 14 Feb 2020 14:56:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581720970; cv=none; d=google.com; s=arc-20160816; b=O42R1Sj5s5Lpp1fSm7Uuv6IV2teZQiuwyuFi9Q+fs4O9Be+HFukpZJW8a8MRGOVclL atOay+2jUohx1/bCNnh6j0F9WFUaU2iE9FlgKU7DgWq0nV3B6bHYDTwh1CyreSxj5QHS znT36lSmO1TRTxxv7MRulKnwFHlNKsLswmwcXh5CuCyWpMjzCMQTObQuJgQPDl7dHAHz io8unGM60Q1gVG6++K+MXeUXxGuwmPuWsy/Pi3C7nyzNYVkEE1PBk9TzjajiwzLZ+Kks W7LRqyrd0QiFrH8u4mu5OdOlcQa6ZoQkvHkdXizFlhFmy5Tr1Y0Zd6w/QJI7bLhKiGaN oUKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=9BMR/1ljfo4sHSBuMNZ+z5Tv5CN3Fmzs3LXwrUy/C1M=; b=HcxZ+5YMDU2MvjU4BSGjfaSzYyNRwhTwEqBYrovlTPsf7Ft3TtPnMcebHzTJHA1tnB jt/6dL4lPNaVNgwlOeBgbuQRdcgBHI/96MupPo8KnZOHDMA+o03Ii8ZKyTDFjk4hqExF 9VLXqulABgoWWtPSnWSA/a+t0dzaYVogfUAlLJYY1R1iQNHAwX4xxOuq/eQMbTqZK2Ct ntuxKzgAgMx7nydSz2AagJNP9GEMCjMM1T9jDMcHwGS8RgN98jgrFvsP4iXWb3Pza0bw tY3rwgrt3WCuLGMCKYmzEMu11KaD/lw9msTbj/rmHeVMXAkZm/dJGPcvbR96R8mhNaJN hlfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=lMB9oxYb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si3276274oii.42.2020.02.14.14.55.56; Fri, 14 Feb 2020 14:56:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=lMB9oxYb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727811AbgBNWzj (ORCPT + 99 others); Fri, 14 Feb 2020 17:55:39 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38878 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727529AbgBNWzj (ORCPT ); Fri, 14 Feb 2020 17:55:39 -0500 Received: by mail-pg1-f193.google.com with SMTP id d6so5654913pgn.5 for ; Fri, 14 Feb 2020 14:55:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=9BMR/1ljfo4sHSBuMNZ+z5Tv5CN3Fmzs3LXwrUy/C1M=; b=lMB9oxYbtxwZWaVxgPBrpGz3OfFoEKkkUMWGNVnlsm3iFyaCa0cjEmOXHQj2nzc+VT B7brjzcauvcMJokIGxHtpFuUTSCq4aWZpiHSjdUJRfFz5JX2uXlkKoOxVAUcrCDi4Sh7 bvqG5k2c05sfl0lm44DR7VYwR06+QYS2c3cj12dJiB0nWGMXoYv7Aj0/TIt5f3ES2y8V L47gSEWe9Fi7+BUM9fVN8PhJdR1nZjkoZWXKPIOk5WIMaYlXuik+qdZAipxZ9Q0x60ey 8sk6Wrh7HRmJIoLDhnMYHANbIGBRBpqEdRXpA5FYeTibUOszk1YyV58RCZkD1Fuon4ua 3L+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=9BMR/1ljfo4sHSBuMNZ+z5Tv5CN3Fmzs3LXwrUy/C1M=; b=bysJR5iZWuTWaXxLNifgJEzH8Ei2RoQZCSRFtNZa6YwZ+gMzANAJmYkcLt6k+RkdoH Kfa7aAnHH3ExqDAAXDBULbn4MZPD4vsozLh594KXfy5+lo/ANKsIZ5HJYyMwO3AfcrxH bvx92i/dBe/alZAqvhyBeJaGlxIwBAKATC4kgq2Q7bQgXMrAcwPRmTQy7ukdX7gZ7avx 0/CCLqqK7/lWbxvq1TCbxx1A9Xx0Yt5VxKDILwxGRSCsrnOYAokT0FFx7C6pzy9HR7eB T/Itf6++bK+rhyDGyMHBTgRQzcbbtA0tjVz/ubVoH9xmKwMmtdwru5wSgOgGt/1Mcfxg 350w== X-Gm-Message-State: APjAAAU8TmduT201zXnUInGirMIpBk5h1Rj9DYKDJYPFA+DvciWvJQMh YNuFyzCreDHuw3YbKd8QWZxAow== X-Received: by 2002:a63:4804:: with SMTP id v4mr5710281pga.373.1581720938430; Fri, 14 Feb 2020 14:55:38 -0800 (PST) Received: from nebulus.mtv.corp.google.com ([2620:15c:211:200:5404:91ba:59dc:9400]) by smtp.googlemail.com with ESMTPSA id r9sm8314708pfl.136.2020.02.14.14.55.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Feb 2020 14:55:37 -0800 (PST) Subject: Re: [PATCH 2/3] random: rng-seed source is utf-8 To: "Theodore Y. Ts'o" , Rob Herring Cc: Masami Hiramatsu , "linux-kernel@vger.kernel.org" , Android Kernel Team , Arnd Bergmann , Greg Kroah-Hartman , Richard Henderson , Mark Brown , Kees Cook , Hsin-Yi Wang , Vasily Gorbik , Andrew Morton , Steven Rostedt , Mike Rapoport , Arvind Sankar , Dominik Brodowski , Thomas Gleixner , Alexander Potapenko , Jonathan Corbet , Mauro Carvalho Chehab , Josh Poimboeuf , Pawan Gupta , Juergen Gross , Linux Doc Mailing List References: <158166060044.9887.549561499483343724.stgit@devnote2> <158166062748.9887.15284887096084339722.stgit@devnote2> <20200214224744.GC439135@mit.edu> From: Mark Salyzyn Message-ID: Date: Fri, 14 Feb 2020 14:55:36 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20200214224744.GC439135@mit.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/14/20 2:47 PM, Theodore Y. Ts'o wrote: > On Fri, Feb 14, 2020 at 01:58:35PM -0600, Rob Herring wrote: >> On Fri, Feb 14, 2020 at 12:10 AM Masami Hiramatsu wrote: >>> From: Mark Salyzyn >>> >>> commit 428826f5358c922dc378830a1717b682c0823160 >>> ("fdt: add support for rng-seed") makes the assumption that the data >>> in rng-seed is binary, when it is typically constructed of utf-8 >> Typically? Why is that? >> >>> characters which has a bitness of roughly 6 to give appropriate >>> credit due for the entropy. > This is why I really think what gets specified via the boot command > line, or bootconfig, should specify the bits of entropy and the > entropy seed *separately*, so it can be specified explicitly, instead > of assuming that *everyone knows* that rng-seed is either (a) a binary > string, or (b) utf-8, or (c) a hex string. The fact is, everyone does > *not* know, or everyone will have a different implementation, which > everyone will say is *obviously* the only way to go.... > > - Ted Given that the valid option are between 4 (hex), 6 (utf-8) or 8 (binary), we can either split the difference and accept 6; or take a pass at the values and determine which of the set they belong to [0-9a-fA-F], [!-~] or [\000-\377]  nor need to separately specify. -- Mark