From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226QB5SmiMwzT9V85MsAoI/BO5pTfVmUvxKWkzuulVazYTKlwSCX1GJrlTiJd3HS/FLLwQbW ARC-Seal: i=1; a=rsa-sha256; t=1516611103; cv=none; d=google.com; s=arc-20160816; b=YDRDZD8HjJbhIcoGRsbPwjzMtiQ7k9uvuL+1ROA2iZuH0CfLg75mdGJ949qugfsAxE nQn6RGT1fQX5fxtV6I+Pk5yZrdN/LmhztWzpntLt8Lm84EAtzmQ+D13Lom9j8RFD0Mi3 ficDaiiQ40ToE2hFiEJ9ew8N0joRRqZ33mKF9SrGXEVIxDjJzDlTcxOVBmFmj77r6l97 jAamT6gfMAkFosA1iI/9nabkOc2kI+obXjnWtqYaUHmDqiIlQK2pemX8/fkdKDwiTHfQ K1kPsD8iM8lzQLHTSDCvBK2B/3f7uBhywF0QcQWgfrLA0GcLT/J7Z8FzFhUi0VNetLDk WeeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=PrVUzOPk51fy371o8o0/6Ds15gwo6/8Yq90UjA/uD7Q=; b=KCQF8G0e4ZH+uES0h7H/78pS1BnseLL1YzkGrQb/DP9LkcghWRDkPZi6hd6KhulStn MkBJ7ZQogaLxYRZq4Xya9pk9owPgy1Y9wQVw8gDNhUpIMpdiJ4KfYjZF3XgEs/2oGKdi gZYoRtr3mJcwOCkSbcKhbJ3dtQVZuyjWuAy5ooKJ7XoijbporTkYMClIk/swAWVG525u c+Lg6qNxPc3uxjIT5DF9pZIWzKfxwuw6s8dYUMfG0Xdk6TxKO7y13cgFS7EAJBYp1qYT sUn6ejlHYG6PYUKg2rSgGkrjmM6PanutBnUOPXQ51N0aFeaw43JuFkRWs5fWbEMfbJbY SF+g== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Kleen , Thomas Gleixner , David Woodhouse , rusty@rustcorp.com.au, arjan.van.de.ven@intel.com, jeyu@kernel.org, torvalds@linux-foundation.org Subject: [PATCH 4.14 36/89] module: Add retpoline tag to VERMAGIC Date: Mon, 22 Jan 2018 09:45:16 +0100 Message-Id: <20180122083958.260417360@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083954.683903493@linuxfoundation.org> References: <20180122083954.683903493@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281438860319710?= X-GMAIL-MSGID: =?utf-8?q?1590282005231019140?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andi Kleen commit 6cfb521ac0d5b97470883ff9b7facae264b7ab12 upstream. Add a marker for retpoline to the module VERMAGIC. This catches the case when a non RETPOLINE compiled module gets loaded into a retpoline kernel, making it insecure. It doesn't handle the case when retpoline has been runtime disabled. Even in this case the match of the retcompile status will be enforced. This implies that even with retpoline run time disabled all modules loaded need to be recompiled. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Acked-by: David Woodhouse Cc: rusty@rustcorp.com.au Cc: arjan.van.de.ven@intel.com Cc: jeyu@kernel.org Cc: torvalds@linux-foundation.org Link: https://lkml.kernel.org/r/20180116205228.4890-1-andi@firstfloor.org Signed-off-by: Greg Kroah-Hartman --- include/linux/vermagic.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h @@ -31,11 +31,17 @@ #else #define MODULE_RANDSTRUCT_PLUGIN #endif +#ifdef RETPOLINE +#define MODULE_VERMAGIC_RETPOLINE "retpoline " +#else +#define MODULE_VERMAGIC_RETPOLINE "" +#endif #define VERMAGIC_STRING \ UTS_RELEASE " " \ MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \ MODULE_ARCH_VERMAGIC \ - MODULE_RANDSTRUCT_PLUGIN + MODULE_RANDSTRUCT_PLUGIN \ + MODULE_VERMAGIC_RETPOLINE