Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp409869lqo; Fri, 10 May 2024 03:53:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJTjpLkbYoeqm1j0oPjGLYaCNXT1/iCaQoh96mKKOEix4aHaERpF3uGJWoTKj1aXRfiF904Fqtsmm2lsn1iRoqmUsg/GNROQjS5Q+CMg== X-Google-Smtp-Source: AGHT+IFp6QEnI5tKBXYACvZGKKy8AizK/DL3aC8hyF2JKw9RCQ/o05Aj0Asy9gcPx4lrpKjdH1tB X-Received: by 2002:a50:d7c2:0:b0:570:3b8:a990 with SMTP id 4fb4d7f45d1cf-5734d7038ddmr1595065a12.39.1715338393528; Fri, 10 May 2024 03:53:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715338393; cv=pass; d=google.com; s=arc-20160816; b=k4aNhGufjKJ66Eb65OjTMCxeDFIvrQUb8rRbPDMo79KZU2Vrn/GVDuGld00tI5J/8v +DEIwjsVwe69DDzVKDeM590Z8tYuMcdcc2V89ugDQeHWqrKWfam0xKrxZV4zl/eiqXIa d9n16EbvOb0WC5YxZHwACm4F1hqGOWSGJGpmDht8IwXCtkuP3eTZS4UPyV5dBplySe/q XJSkdQtg8v/QbS8o3710sxMNxF+d5cW2poYQ2JjmM4lcuQkmpkwoHpgYhqsexFWpzR7S HasZEbYNoqpUXHIybk1if0xYcg0cBe08yUrZm1prqMZnweePS5KDaXYLEHu/vBjdM3EA nQ2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dV82l8+rQwUODd1PTfl1jodR6A0HfguIqZ7t3eMq8bc=; fh=nmsLau6kHJ6QNd8OnvSweM1o4xWeigvVbtAuutynPqc=; b=c0R6lU86F2XMuX0i6+coa0rLX1BvHWl5WBWztnogcOSK6TjgktUN6p4cg/chd72HWr xLJNPeGnW1V8P4XtzWtfUphMLp/frhZfdmxrCkBqAAkeD1K8R6GJKh+/EJWmOvNO6GBw 2A+tOfGq1Og538hLoyGdAu3UMliqNmcJagOmg+qAr1qC/+3X91/xCwoS0/UWkuanCIxk vZZiTi0yRyKzMhB35vuTaosgiABvThAmT+KY9vHDNHtURrIxoYCeDRlAk8uYHKhAIJB1 qJ36HrtH+OE8zZdcB4ESXHzPZztELKAyAT+OXdwU5dHQ8lv1gINnSHVXXFP1YXGSIGDR D2HQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@linuxfoundation.org header.s=korg header.b=txLTVpp2; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-crypto+bounces-4104-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4104-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c365eb6si1770974a12.534.2024.05.10.03.53.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 03:53:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4104-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail header.i=@linuxfoundation.org header.s=korg header.b=txLTVpp2; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-crypto+bounces-4104-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4104-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 445301F22384 for ; Fri, 10 May 2024 10:53:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6858316C43B; Fri, 10 May 2024 10:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="txLTVpp2" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25AE0168AFA for ; Fri, 10 May 2024 10:53:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715338387; cv=none; b=XBOoxZ5RW6EmBYrutRkKuNq8f7unzdJVf1HWpxWECB76VbQdJWdElKe8+WCUFNpv3Og5EeOFnmkMjQxuRNVTFaUWczQqj7r60XUbDWeWoKjmC6kaMD0PXsfc04UcNOBgfNcZdrsRxa89xM53e2CR3CvBYaWamjlvtfYamXfccwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715338387; c=relaxed/simple; bh=F1zc5yZJOXB7Tu6k40pMSpQ4O1l6Top2RS5ppzJazas=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ayHpUVl8YhOdHM93hpCFMDSWqB+tbelmkmbnl1qxCXAuc/o0kE0jIrl8SVfjT4Y3xiZjQTttul/1/+IIOG8rrUeLAyFB88FbeywiNHLEOl2LPVorgMJAthWAc7TccYcpMAAaPTlo5YLhUUaukxnxbiiHwoEkJi6AAgGCpF9tBds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=txLTVpp2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54A73C113CC; Fri, 10 May 2024 10:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715338386; bh=F1zc5yZJOXB7Tu6k40pMSpQ4O1l6Top2RS5ppzJazas=; h=Date:From:To:List-Id:Cc:Subject:References:In-Reply-To:From; b=txLTVpp2Fx37xGuPPYNZ/lrIaNXIWlB0UgMN9Y8OFUKoOh1mHcYqkOhB5EOOiSL6I RwiLTuWMi+Ua3OnEgJD0/bBr/aMFwGYWIZuVT49QzpmzVCrCz+/081yKk9JWjoG9Cn GjLMKx1zkEuyBkDdV7W0Nx7uxwVSd+UIpeEaVfp8= Date: Fri, 10 May 2024 11:52:56 +0100 From: Greg Kroah-Hartman To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: Gregory CLEMENT , Arnd Bergmann , soc@kernel.org, arm@kernel.org, Andy Shevchenko , Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , linux-crypto@vger.kernel.org, Dan Carpenter Subject: Re: [PATCH v10 7/9] platform: cznic: turris-omnia-mcu: Add support for digital message signing via debugfs Message-ID: <2024051007-rendering-borrowing-ffc5@gregkh> References: <20240510101819.13551-1-kabel@kernel.org> <20240510101819.13551-8-kabel@kernel.org> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240510101819.13551-8-kabel@kernel.org> On Fri, May 10, 2024 at 12:18:17PM +0200, Marek Beh?n wrote: > Add support for digital message signing with private key stored in the > MCU. Boards with MKL MCUs have a NIST256p ECDSA private key created > when manufactured. The private key is not readable from the MCU, but > MCU allows for signing messages with it and retrieving the public key. > > As described in a similar commit 50524d787de3 ("firmware: > turris-mox-rwtm: support ECDSA signatures via debugfs"): > The optimal solution would be to register an akcipher provider via > kernel's crypto API, but crypto API does not yet support accessing > akcipher API from userspace (and probably won't for some time, see > https://www.spinics.net/lists/linux-crypto/msg38388.html). > > Therefore we add support for accessing this signature generation > mechanism via debugfs for now, so that userspace can access it. Having a "real" user/kernel api in debugfs feels wrong here, why would you not do this properly? On most, if not all, systems, debugfs is locked down so you do not have access to it, as it is only there for debugging. So how is a user supposed to use this feature if they can't get access to it? And debugfs files can be changed at any time, so how can you ensure that your new api will always be there? In other words, please solve this properly, do not just add a hack into debugfs that no one can use as that is not a good idea. thanks, greg k-h