Received: by 10.192.165.156 with SMTP id m28csp716791imm; Mon, 16 Apr 2018 07:37:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/xHfLpInHzLLRRkqYyrElrb6adLny0fQsxjzR90jZ3TPoYqDJOv+LtthjL6BLtSIyA1msY X-Received: by 2002:a17:902:bf05:: with SMTP id bi5-v6mr9698289plb.235.1523889449118; Mon, 16 Apr 2018 07:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523889449; cv=none; d=google.com; s=arc-20160816; b=apCgIYpRJWA765u2oizS2/jQi+klipFV1LPTWDrLYyBUfwzfZaS7tUB8WXn7sO4qnp 5YFxzztTuJJl2X/nda8UlAcz532q2V8CifgZ1WP5yFJEgfLAp/8b5dWaM0mXyuOaQ8Ec 7d7kytsb/o1L4Y44G3obmKUx3SMlkgK7Ua71f1x0MydhwbZcl9i1nTZH6w4+iB8tkh2X PJmd9nbT5ENSuY5gJuj6bhlvRN+r4XhKI/R01IJ+qN70SQp1FVlokl6kcYMBSxvsmFG1 TChMDf0N10cIwd5Oh40sD29AiG3cm+Zl6r8RX/QmL2TQgmNRhisZOysAACV7Cw3HRLL5 Qt3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=maSq/7FoCVcAWFxKbwBj5y4yEuRd2WJLi1Hr8fpeBl0=; b=xoadAUj6dXZrTqgk/Kbk63+9/+S9p8Vom+PF1gBwsXsdGur2PFpLL/NHmc2AawUe5V h6lfvrZV63NU7u2X9OG7OO2B2vOye2hVvC9PCg7OUVKQAkdgxpG9i8x6B9UAXFj6sxRc JtP+ZzC20A0QhngxOngWRjnEl60kKFHxeRPModa15iUlvrqsRRb6tHUhxjYWk0IbKwFe AM+4+rrEjNSxsT48ihHPYuc3xkns0sjowQwu+RT3Ltn3cCnsJ35hmAD099tC09ZSokRn vrD8BzTmJZp0QQrtJWAjJWLK0DqGsKm0RaKRVXTmi3vhNAEAyeFvYQiA4dTSrYlPqIm1 In1g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si12536308plz.562.2018.04.16.07.37.15; Mon, 16 Apr 2018 07:37:29 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752736AbeDPOgL (ORCPT + 99 others); Mon, 16 Apr 2018 10:36:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:56126 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708AbeDPOgJ (ORCPT ); Mon, 16 Apr 2018 10:36:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3E8CFABC8; Mon, 16 Apr 2018 14:36:08 +0000 (UTC) Subject: Re: [PATCH 1/4] x86/crypto: camellia: Fix function prototypes To: Ingo Molnar Cc: kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, x86@kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, gregkh@linuxfoundation.org, keescook@chromium.org References: <20180415041542.5364-1-jmoreira@suse.de> <20180415041542.5364-2-jmoreira@suse.de> <20180416061044.z6eb4psw2sbszemb@gmail.com> From: =?UTF-8?Q?Jo=c3=a3o_Moreira?= Message-ID: <15bd0d05-e046-1b35-9f14-91e507e6b162@suse.de> Date: Mon, 16 Apr 2018 11:35:58 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180416061044.z6eb4psw2sbszemb@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> +static inline void camellia_enc_blk(void *ctx, u8 *dst, const u8 *src) >> { >> - __camellia_enc_blk(ctx, dst, src, false); >> + __camellia_enc_blk((struct camellia_ctx *) ctx, dst, src, false); >> } > > I don't see how this is an improvement: instead of having a proper type there's > now an opaque type and an ugly (and dangerous) type cast. > > What does "compatible with CFI requirements" mean? For "compatible with CFI requirements", I meant: given a set of functions that are invoked through a given set of pointers, all functions and pointers in these sets have the same prototype. I added a note about this CFI heuristic in the cover letter, but I guess I should have been clearer there and added something more substantial to the commit message. Regarding the changes, this was the most straight-forward way I found to make the sources compliant with the above, not requiring deeper semantic changes to the underneath invoking code. On the other hand, I agree that there is a collateral damage and that an ideal fix would be the other way around -- removing the opaque type from the pointer instead of adding it to the functions. I'll try to think of another way and send if I come to something. Tks, João.