From patchwork Fri Feb 10 10:09:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jess Frazelle X-Patchwork-Id: 9566407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D8C4F601C3 for ; Fri, 10 Feb 2017 10:09:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4CDC28540 for ; Fri, 10 Feb 2017 10:09:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8F8A28556; Fri, 10 Feb 2017 10:09:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 0093328540 for ; Fri, 10 Feb 2017 10:09:58 +0000 (UTC) Received: (qmail 24542 invoked by uid 550); 10 Feb 2017 10:09:45 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 24459 invoked from network); 10 Feb 2017 10:09:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jessfraz.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SKIfZlKxhXphVO1JHQVOwgMmJMF8pnQRetpmnKaKoQs=; b=MfJAMOuNy7rSMKppZFdBaRPazeTpqnlw/qW+9kUVinRWZC0K3JzHGtajXfE2wd2dxA 7+C8pty9DRsQxGDHCCbpq+Oj8FySTLpDqrsAgX5CWlMeG2IX8YM1zpncbOGY1WvalJcM ZdrRXJHSQJ0TwRieoGnuJJxEGR+VFSTPoR/pE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SKIfZlKxhXphVO1JHQVOwgMmJMF8pnQRetpmnKaKoQs=; b=GDfXuoRFIplX/jl+nMtJn8nMMgddAPsfsZsvcuHVeY74XmEVIfLFfZXL4zvqDVBHBO 2DSz0JbPxBJfF5fFWDGuv9/bJFQWXoE5EbkfUDmHOagSzmbwF3p3w8IM5/cY96Q/RYRr OSL/wofylAGZdZVYR/Soc1dZavbusNXiDUPg4oi+X+c5S2kGSXxpGZ9P9Cv3N522FL0F b25ju+JijN8RA5pQBKmAPw+i3A7WPIJLft6GUOfDdBW3GOko5RfsaVGkEUtdKalYbpid pwQEIhQTP8DB2ED5rEXRs4g5AM+c15OSYQhoMwXtzH1c0br59Tgxz8tkRc5FAQmncHzE c7WA== X-Gm-Message-State: AMke39nQimfRp3w0FcEOAJyYHov4IUFFLezIHacHr8guRQAWRf8oUcq+u7ojNWlqwEYApCva X-Received: by 10.98.223.195 with SMTP id d64mr9217674pfl.80.1486721372089; Fri, 10 Feb 2017 02:09:32 -0800 (PST) From: Jess Frazelle To: kernel-hardening@lists.openwall.com Cc: Jess Frazelle Date: Fri, 10 Feb 2017 02:09:02 -0800 Message-Id: <20170210100902.11765-5-me@jessfraz.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170210100902.11765-1-me@jessfraz.com> References: <20170210100902.11765-1-me@jessfraz.com> Subject: [kernel-hardening] [PATCH 4/4] time: mark syscore_ops as __ro_after_init X-Virus-Scanned: ClamAV using ClamSMTP Marked syscore_ops structs as __ro_after_init when register_syscore_ops was called only during init. Most of the caller functions were already annotated as __init. Suggested-by: Kees Cook Signed-off-by: Jess Frazelle Acked-by: Rik van Riel --- kernel/time/sched_clock.c | 2 +- kernel/time/timekeeping.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index a26036d37a38..5df2fc07300b 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -289,7 +289,7 @@ static void sched_clock_resume(void) rd->read_sched_clock = cd.actual_read_sched_clock; } -static struct syscore_ops sched_clock_ops = { +static struct syscore_ops sched_clock_ops __ro_after_init = { .suspend = sched_clock_suspend, .resume = sched_clock_resume, }; diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index db087d7e106d..467e3021723a 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1756,7 +1756,7 @@ int timekeeping_suspend(void) } /* sysfs resume/suspend bits for timekeeping */ -static struct syscore_ops timekeeping_syscore_ops = { +static struct syscore_ops timekeeping_syscore_ops __ro_after_init = { .resume = timekeeping_resume, .suspend = timekeeping_suspend, };