Received: by 10.192.165.156 with SMTP id m28csp2329078imm; Sat, 14 Apr 2018 21:19:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+/br+X583gwU27jEI1qtP8Mb3aManOyvYq1L1FxYkVIYm7x4LOg6lXE4tvrtcFlMiRJQhM X-Received: by 10.101.64.201 with SMTP id u9mr9082431pgp.142.1523765945432; Sat, 14 Apr 2018 21:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523765945; cv=none; d=google.com; s=arc-20160816; b=NdLxyocxrg5wdXkaSslakND7Tu3ujmxM4gZ8wcfBeV/BFAnkA9Cs8pTissrBgzImI4 g704NAmZWt8u52KC4uqNqoXTgrnACz4k8wQ139VdLaBfiBImIi8Yv+dM8lGSJ8jv3DGB kGhZYHhqX4lJ8rLm17XnGuqeLrbRhcedcu+vw3xF9e8hJKd2hd9tQ3lc0d49bD0zPmEt No78RtwybRUdKtZbei+77wo+0n7Aek2wxSq0xsHBYzyoYEvo6qMSsijoGLxjVZhfNmNe rAmjonghTW9sqnSHRdYrJSqjXLwSOtUctkfaPa2XVWZ2d2/pCjc64UqYT9jW2gZ7Gz19 /uFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=WhlZErktiGxOcB+8ULB3KTi22gnO899ozs147RPZzlk=; b=V0ig3rejUqhnFmMT+j22S8dOMczt5r8cqVDmpqH9wgekJDpHDdHYWMAiBb6v3Y4k5i 2oQMgNCdcA/h/VWBuVuGfa3k9D6p9xYU3OxLFp76rN5tyt+e4nOW1iDJhVg5mo+4ihRm /xXux+l8wPcX8w4G6hw8MejyH2bnv7JUxSCAp1VFgoGadUGr8ZmdwBhzzXS95xSDwioS rVzP8LHqw6d4i8qdFMrL0qerSB5DEUk1I+fjyH/RavDQaMMBJ/c1fZ5rh/hlrGTjK/aa mcJWVdsjvv0kxYKm5g8bQTCvlQUxtZjoX7QVp8KQ6neDRFx7N49E0ZhuEdlN9oKKYB8Q hXDA== 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 x8-v6si9226194plw.251.2018.04.14.21.18.51; Sat, 14 Apr 2018 21:19:05 -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 S1752258AbeDOEPz (ORCPT + 99 others); Sun, 15 Apr 2018 00:15:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:41906 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbeDOEPy (ORCPT ); Sun, 15 Apr 2018 00:15:54 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 35129AEB8; Sun, 15 Apr 2018 04:15:53 +0000 (UTC) From: Joao Moreira To: kernel-hardening@lists.openwall.com Cc: 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 Subject: [PATCH 0/4] x86/crypto: Fix function prototypes Date: Sun, 15 Apr 2018 01:15:38 -0300 Message-Id: <20180415041542.5364-1-jmoreira@suse.de> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is possible to indirectly invoke functions with prototypes that do not match those of the respectively used function pointers by using void types. This feature is frequently used as a way of relaxing function invocation, making it possible that different data structures are passed to different functions through the same pointer. Despite the benefits, this can lead to a situation where functions with a given prototype are invoked by pointers with a different prototype, what is undesirable as it may prevent the use of heuristics such as prototype matching-based Control-Flow Integrity, which can be used to prevent ROP-based attacks. One way of fixing this situation is through converting the function prototypes to the one used in the pointer declaration, what means converting function arguments from a given ' *' to a 'void *', and later casting its uses accordingly throughout the function scope. Given the above, the current efforts to improve the Linux security, and the upcoming kernel support to compilers with CFI features, fix prototypes in x86/crypto algorithms: camellia, cast6, serpent, and twofish. This patch does not introduce semantic changes to the cryptographic algorithms, yet, if someone finds relevant, the affected algorithms were tested with the help of tcrypt.ko without any visible harm. Joao Moreira (4): x86/crypto: camellia: Fix function prototypes x86/crypto: cast6: Fix function prototypes x86/crypto: serpent: Fix function prototypes x86/crypto: twofish: Fix function prototypes arch/x86/crypto/camellia_aesni_avx2_glue.c | 25 ++++++++--------- arch/x86/crypto/camellia_aesni_avx_glue.c | 21 +++++++-------- arch/x86/crypto/camellia_glue.c | 6 ++--- arch/x86/crypto/cast6_avx_glue.c | 22 ++++++--------- arch/x86/crypto/serpent_avx2_glue.c | 14 +++++----- arch/x86/crypto/serpent_avx_glue.c | 19 ++++++------- arch/x86/crypto/twofish_avx_glue.c | 30 +++++++++------------ arch/x86/crypto/twofish_glue.c | 7 +++-- arch/x86/crypto/twofish_glue_3way.c | 10 +++---- arch/x86/include/asm/crypto/camellia.h | 43 +++++++++++++----------------- arch/x86/include/asm/crypto/serpent-avx.h | 25 ++++++++--------- arch/x86/include/asm/crypto/serpent-sse2.h | 30 +++++++++------------ arch/x86/include/asm/crypto/twofish.h | 9 +++---- 13 files changed, 108 insertions(+), 153 deletions(-) -- 2.12.0