Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4245086yba; Tue, 7 May 2019 14:53:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+waLCFhLNnShW2aZI2K8IcCsW1HK5KEN9xz7V+MHQaSdTPfiVN5F0hikrp9h6YzfDE4XC X-Received: by 2002:a17:902:bd86:: with SMTP id q6mr8703340pls.152.1557265996870; Tue, 07 May 2019 14:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557265996; cv=none; d=google.com; s=arc-20160816; b=FJKrSVPuxCsxHhF7XRu11SLjR+juGIAAu5klMP1OJ+sVz5/uMBckJie1JtgXliiHRh bCn+BdW1RUZzalGOZC1PJt2FJ2JV2QwEH1ncCRQOjsy2cOQKm5NgZQ12hrHCM8ZZRta4 64W1jv41KDKUUVFEHmaygwOMvCgr6dY5JNpDBIQADiFpkDGxaWP24C5BNvxTSomc5rGA DFGYLeDTYG4CPDcSTBc9YOexVkevc0Ab5RYJFKGlhSinfh73AoIVzKTvpYC7lbuexSul BgFsI2GjbAI3ztOGJORx+Ez7zGPK+KFBnaXHpJ8q626Fbn8Mmdv2jNtx+9bOh9xlIKEe /hmQ== 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:dkim-signature; bh=Jq3wA/mitI9TD3zK1T/6zzbjr4c9wW4v0GS5ICcyLfU=; b=DLuhzzXqaEI+zSkgEvQBiooQIfjnuEVMC2qYRTlKXmwNXq0QOfM2CX6AXw6z/CLFo4 KJcIbdsUNKCELtDDyZxO5rw87iW1gO6Vh2NXSJSoJDj9CeXepQW6zY4RWDXZ7kWS9qrF JjfT6qsX/ZbeE7liOY3FIxX5AWKcoPJq1E8BPAMAOoDYuFb4ib14ycR4TLciMFqjRWQ9 zrQV85dkkIOxjZ3xXMJBzXp0gxOwMIlKoo6RBPchjrFVhTSq9f9mqqkyhI9pDdfrAW/t Ym5FM1Mu92at5N4DQwwekiFR9oJtDvWa0RPHDvRlYZw+25pSzDD+px5CP23zP/vfSw3y ZQSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rqnk5JzD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o24si9285261pgh.375.2019.05.07.14.52.53; Tue, 07 May 2019 14:53:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Rqnk5JzD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726997AbfEGVut (ORCPT + 99 others); Tue, 7 May 2019 17:50:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:32776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726650AbfEGVut (ORCPT ); Tue, 7 May 2019 17:50:49 -0400 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C5A5B205C9; Tue, 7 May 2019 21:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557265848; bh=zwUU7Cwiyys6DAoOpuq7iSsRZqfkjqn6hEoJovHAlwE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rqnk5JzDrfY9glVqL1a7PcVtn6erwFFmSp9rNpcGHp4qUmLK6E1B00oWj5k0+NbNl wZxhQXcg4F2SrSPKeFCoh46WsmySBgok6IaMTz7Qd8f4m+3Bzf61xkG03YhKehGAhe 1nPmbAaywKzyiSwXkobbL+yuNKnOChPtEKEzdhS4= Date: Tue, 7 May 2019 14:50:46 -0700 From: Eric Biggers To: Kees Cook Cc: Herbert Xu , Joao Moreira , Ingo Molnar , Thomas Gleixner , Borislav Petkov , X86 ML , linux-crypto , LKML , Kernel Hardening Subject: Re: [PATCH v3 0/7] crypto: x86: Fix indirect function call casts Message-ID: <20190507215045.GA7528@sol.localdomain> References: <20190507161321.34611-1-keescook@chromium.org> <20190507170039.GB1399@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, May 07, 2019 at 02:07:51PM -0700, Kees Cook wrote: > On Tue, May 7, 2019 at 10:00 AM Eric Biggers wrote: > > > Given the above, the current efforts to improve the Linux security, > > > and the upcoming kernel support to compilers with CFI features, this > > > creates macros to be used to build the needed function definitions, > > > to be used in camellia, cast6, serpent, twofish, and aesni. > > > > So why not change the function prototypes to be compatible with common_glue_*_t > > instead, rather than wrapping them with another layer of functions? Is it > > because indirect calls into asm code won't be allowed with CFI? > > I don't know why they're not that way to begin with. But given that > the casting was already happening, this is just moving it to a place > where CFI won't be angry. :) > > > > crypto: x86/crypto: Use new glue function macros > > > > This one should be "x86/serpent", not "x86/crypto". > > Oops, yes, that's my typo. I'll fix for v4. Do the conversions > themselves look okay (the changes are pretty mechanical)? If so, > Herbert, do you want a v4 with the typo fix, or do you want to fix > that up yourself? > > Thanks! > I don't know yet. It's difficult to read the code with 2 layers of macros. Hence why I asked why you didn't just change the prototypes to be compatible. - Eric