Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8004942ybi; Tue, 9 Jul 2019 07:39:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqySqVDugJpjY7ROkYs3y1JrA67dYRb1Agys/pTnWtoN3MAOMU+TTegHZ9iSM2nwAh9+GGOr X-Received: by 2002:a65:6454:: with SMTP id s20mr31145952pgv.15.1562683143256; Tue, 09 Jul 2019 07:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562683143; cv=none; d=google.com; s=arc-20160816; b=0bI6MmAtHWK15qPdsF53vFFGrmdjuOvawIzoBw3WiunAOvXB91trN54r5DGoBCs2i+ taDGtPqu9Di6qlJgNT83HkdyYLvKEAAOwabuJczCAx9SYOxpbKxuQWGzDXLXw+IGV/oi ypiez5qnfoe/gf7XUwzMbimhXVR+zN9K6oONd4Z+ID5ztSIP1O1IYVEnejWcO0CC38sU +ni2nrW049JyggdZTPkTEKvz5LbU5RCg2KEzQRqrwEOYneQnURoBeWHy0h2+Uc/RKVBv eAoD2HfpcadE/aOVJOZLCB1IayQb8jFeFxPUQT8zVCvTzu/2LiZPDROQVBeVzlw3AskX sBjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tX9ORWvvKIHVvYCRemjBnuURW4CVbmKhGhs8R1Dvid4=; b=fr1cbsItXCN+kr/G4pRlOEouDXTGUgVnziRWbjlzjXR4rMiJo5GvaLvwPhzqPOoBGB GuX9AJqIJyhRtpUxB8lAvGCKORUSpL3/wzMZKnESMhg058WE1Bs+EHZtT8sIfGSRkTcb a/Lpi9qQ4U6DW05biZGTNE9AuKekNNG/RK3Xui49DpQacRbEIvG76W2BeuPHjVkGLQw8 oDcBHOhEGTc/SsSdCj8KWTnCwqPC6kfrwdOqMgx2IURYhRcwHzfwXJVG7aKpDyhV8O0T e4g37XKiWmuv4/Z7d+4S3/MaIsV6NnyBzWFITYII8Y6BkdKLKVzRJguUQnOd28ncMttR rxzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8si19400552pgg.228.2019.07.09.07.38.42; Tue, 09 Jul 2019 07:39:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726126AbfGIOij (ORCPT + 99 others); Tue, 9 Jul 2019 10:38:39 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:57992 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfGIOij (ORCPT ); Tue, 9 Jul 2019 10:38:39 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hkrGP-00033V-Ot; Tue, 09 Jul 2019 22:38:37 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hkrGK-0002HA-G4; Tue, 09 Jul 2019 22:38:32 +0800 Date: Tue, 9 Jul 2019 22:38:32 +0800 From: Herbert Xu To: Ondrej Mosnacek Cc: linux-crypto@vger.kernel.org, netdev@vger.kernel.org, "David S . Miller" , Stephan Mueller , Steffen Klassert , Don Zickus Subject: Re: [PATCH] crypto: user - make NETLINK_CRYPTO work inside netns Message-ID: <20190709143832.hej23rahmb4basy6@gondor.apana.org.au> References: <20190709111124.31127-1-omosnace@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190709111124.31127-1-omosnace@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Jul 09, 2019 at 01:11:24PM +0200, Ondrej Mosnacek wrote: > Currently, NETLINK_CRYPTO works only in the init network namespace. It > doesn't make much sense to cut it out of the other network namespaces, > so do the minor plumbing work necessary to make it work in any network > namespace. Code inspired by net/core/sock_diag.c. > > Tested using kcapi-dgst from libkcapi [1]: > Before: > # unshare -n kcapi-dgst -c sha256 libkcapi - Error: Netlink error: sendmsg failed > libkcapi - Error: Netlink error: sendmsg failed > libkcapi - Error: NETLINK_CRYPTO: cannot obtain cipher information for hmac(sha512) (is required crypto_user.c patch missing? see documentation) > 0 > > After: > # unshare -n kcapi-dgst -c sha256 32 > > [1] https://github.com/smuellerDD/libkcapi > > Signed-off-by: Ondrej Mosnacek Should we really let root inside a namespace manipulate crypto algorithms which are global? I think we should only allow the query operations without deeper surgery. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt