Message ID | 20230517131102.934196-5-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1133966vqo; Wed, 17 May 2023 06:24:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5PBQi7LRTfvBf1W7Nu97cqsOOlnpXxZWh7BvIFkUHtdFxPrWhyJWzUpb2NAYi4kPBZFk+l X-Received: by 2002:a17:90b:3b86:b0:253:5375:bf54 with SMTP id pc6-20020a17090b3b8600b002535375bf54mr264964pjb.0.1684329889848; Wed, 17 May 2023 06:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329889; cv=none; d=google.com; s=arc-20160816; b=W8LPqE9xk+QCEP00yYkuuXS9FZ3HOqMA4fNN9iSRqD5L4ZcFItPRTeBg+2U89/IShc uUvFjbEa7lD2hsAImV8Ub06qEXIby0YhpvSDuYyJr6ojm7D0L0JF9MCg7iVs8IHBztmk BOvZsF11MwOUUqVO6tR1zSvJI330zylB1jiv5OoBbKZkw/DcXqa7/DgnfbKjge7kzY1o 0xSxzJmGEDQCDS+k7ziMZX+rLrdgtpycU0mWAE+yOyfYCb/kc6aaCmD1h67pdivz77di L5GaElcXLvyzrAI65Tr4dJpaNZCGI2soO8jfUClpl3cqdu+19HchGu9Iwg9W/+GSwmMQ gjzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FtDFA91ypS9ZA0IR38/PvWFBEIGzGOUQK4+dY24nL+I=; b=NqhPotXCq9e64KK2pyeA4jTvkifNg2nyMCqxMD52J1vCAVtjCSoN9kHRUKGuv+yoIw teawcRBIXfVGQ5qFzWy4WFjF8qby+eP8RenuIlvFwB+kIgq1Fj38zwkPhzcN8fL062bg a1u8rgpAwn7aLMvTyR0+IIgFxtu44xtqPw9MdFHkXWkPLbc9D7Qxyz70Um88I3HS6uZ2 oVT+pjLvuZWC5cmVj0M1qiadf0PZ51p53nyfL4r4s2gwvNZKPlo0ygLzreotFuVNRvAa sKnzxV+Gn/pYWtAGU9ACeykzfNOfGvz10fruhTB6KYicJIingJjd3vv03b19qae2SEuP Jtew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I6TCINxJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h24-20020a17090aa89800b00250a2e130ecsi1791317pjq.87.2023.05.17.06.24.33; Wed, 17 May 2023 06:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I6TCINxJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S231969AbjEQNMX (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Wed, 17 May 2023 09:12:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230418AbjEQNMR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 17 May 2023 09:12:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 859842D73; Wed, 17 May 2023 06:12:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F292064711; Wed, 17 May 2023 13:12:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E219C433A8; Wed, 17 May 2023 13:12:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684329129; bh=m4CC8jzjsL/DB4zhl/Y597jyiUuMzUYclEl5YRgzTWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6TCINxJI0woqSGR6ssIvaSj6epLLVO81LOzyVaPT8/vzZI9AB8IWfkQCSXQEHhXj emmu7MtAnphbx6efp3NtZZlhdUPe7PobFSbrgE0GW1MxwsjqRKhXtsARowKgI7TJl1 M8K+xUmMlgWQeI0sMhDqBlo2KcTRfdwZaRrzSuAmdzwi2gCudljKNjdsRsUPUgknLD dFngQPAXjy/SCR0E/q5jywBkSs9H4bdCiuKXgEHWHkpEKogI02+rydRudhNs/4FwF/ rKa/Win+V5kAOFnp1Q7tVYGNdR9eUslE6Gou6+cruOq5EcoezzwmGP3r8Tp1Dhm35i hSLiw0TbCv7FA== From: Arnd Bergmann <arnd@kernel.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org, Arnd Bergmann <arnd@arndb.de>, Russell King <linux@armlinux.org.uk>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Michal Simek <monstr@monstr.eu>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Helge Deller <deller@gmx.de>, Michael Ellerman <mpe@ellerman.id.au>, Palmer Dabbelt <palmer@dabbelt.com>, Heiko Carstens <hca@linux.ibm.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, x86@kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>, Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>, Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@linux.com>, Pavel Machek <pavel@ucw.cz>, Peter Zijlstra <peterz@infradead.org>, Waiman Long <longman@redhat.com>, Boqun Feng <boqun.feng@gmail.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, audit@vger.kernel.org, linux-pm@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Subject: [PATCH 04/14] audit: avoid missing-prototype warnings Date: Wed, 17 May 2023 15:10:52 +0200 Message-Id: <20230517131102.934196-5-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517131102.934196-1-arnd@kernel.org> References: <20230517131102.934196-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766147898853060067?= X-GMAIL-MSGID: =?utf-8?q?1766147898853060067?= |
Series |
mm/init/kernel: missing-prototypes warnings
|
|
Commit Message
Arnd Bergmann
May 17, 2023, 1:10 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> Building with 'make W=1' reveals two function definitions without a previous prototype in the audit code: lib/compat_audit.c:32:5: error: no previous prototype for 'audit_classify_compat_syscall' [-Werror=missing-prototypes] kernel/audit.c:1813:14: error: no previous prototype for 'audit_serial' [-Werror=missing-prototypes] The first one needs a declaration from linux/audit.h but cannot include that header without causing conflicting (compat) syscall number definitions, so move the it into linux/audit_arch.h. The second one is declared conditionally based on CONFIG_AUDITSYSCALL but needed as a local function even when that option is disabled, so move the declaration out of the #ifdef block. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- include/linux/audit.h | 2 -- include/linux/audit_arch.h | 2 ++ kernel/audit.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Comments
On May 17, 2023 Arnd Bergmann <arnd@kernel.org> wrote: > > Building with 'make W=1' reveals two function definitions without > a previous prototype in the audit code: > > lib/compat_audit.c:32:5: error: no previous prototype for 'audit_classify_compat_syscall' [-Werror=missing-prototypes] > kernel/audit.c:1813:14: error: no previous prototype for 'audit_serial' [-Werror=missing-prototypes] > > The first one needs a declaration from linux/audit.h but cannot > include that header without causing conflicting (compat) syscall number > definitions, so move the it into linux/audit_arch.h. > > The second one is declared conditionally based on CONFIG_AUDITSYSCALL > but needed as a local function even when that option is disabled, so > move the declaration out of the #ifdef block. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > include/linux/audit.h | 2 -- > include/linux/audit_arch.h | 2 ++ > kernel/audit.h | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/linux/audit.h b/include/linux/audit.h > index 31086a72e32a..6a3a9e122bb5 100644 > --- a/include/linux/audit.h > +++ b/include/linux/audit.h > @@ -130,8 +130,6 @@ extern unsigned compat_dir_class[]; > extern unsigned compat_chattr_class[]; > extern unsigned compat_signal_class[]; > > -extern int audit_classify_compat_syscall(int abi, unsigned syscall); > - > /* audit_names->type values */ > #define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */ > #define AUDIT_TYPE_NORMAL 1 /* a "normal" audit record */ > diff --git a/include/linux/audit_arch.h b/include/linux/audit_arch.h > index 8fdb1afe251a..0e34d673ef17 100644 > --- a/include/linux/audit_arch.h > +++ b/include/linux/audit_arch.h > @@ -21,4 +21,6 @@ enum auditsc_class_t { > AUDITSC_NVALS /* count */ > }; > > +extern int audit_classify_compat_syscall(int abi, unsigned syscall); > + > #endif > diff --git a/kernel/audit.h b/kernel/audit.h > index c57b008b9914..94738bce40b2 100644 > --- a/kernel/audit.h > +++ b/kernel/audit.h > @@ -259,8 +259,8 @@ extern struct tty_struct *audit_get_tty(void); > extern void audit_put_tty(struct tty_struct *tty); > > /* audit watch/mark/tree functions */ > -#ifdef CONFIG_AUDITSYSCALL > extern unsigned int audit_serial(void); > +#ifdef CONFIG_AUDITSYSCALL > extern int auditsc_get_stamp(struct audit_context *ctx, > struct timespec64 *t, unsigned int *serial); We probably should move the audit_serial() and auditsc_get_stamp() away from the watch/mark/tree functions, but that isn't your problem. Anyway, this looks okay to me; do you have a problem if I merge this via the audit/next branch or were you hoping to have this go in through a different tree? -- paul-moore.com
On Wed, May 17, 2023, at 16:33, Paul Moore wrote: > On May 17, 2023 Arnd Bergmann <arnd@kernel.org> wrote: > We probably should move the audit_serial() and auditsc_get_stamp() > away from the watch/mark/tree functions, but that isn't your problem. > > Anyway, this looks okay to me; do you have a problem if I merge this > via the audit/next branch or were you hoping to have this go in > through a different tree? Merging it through your tree is probably best, Andrew can either pick the ones that nobody else took, or I can resend the rest. Arnd
On Wed, May 17, 2023 at 10:51 AM Arnd Bergmann <arnd@arndb.de> wrote: > On Wed, May 17, 2023, at 16:33, Paul Moore wrote: > > On May 17, 2023 Arnd Bergmann <arnd@kernel.org> wrote: > > > We probably should move the audit_serial() and auditsc_get_stamp() > > away from the watch/mark/tree functions, but that isn't your problem. > > > > Anyway, this looks okay to me; do you have a problem if I merge this > > via the audit/next branch or were you hoping to have this go in > > through a different tree? > > Merging it through your tree is probably best, Andrew can either > pick the ones that nobody else took, or I can resend the rest. Easy enough, merged to audit/next, thanks.
diff --git a/include/linux/audit.h b/include/linux/audit.h index 31086a72e32a..6a3a9e122bb5 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -130,8 +130,6 @@ extern unsigned compat_dir_class[]; extern unsigned compat_chattr_class[]; extern unsigned compat_signal_class[]; -extern int audit_classify_compat_syscall(int abi, unsigned syscall); - /* audit_names->type values */ #define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */ #define AUDIT_TYPE_NORMAL 1 /* a "normal" audit record */ diff --git a/include/linux/audit_arch.h b/include/linux/audit_arch.h index 8fdb1afe251a..0e34d673ef17 100644 --- a/include/linux/audit_arch.h +++ b/include/linux/audit_arch.h @@ -21,4 +21,6 @@ enum auditsc_class_t { AUDITSC_NVALS /* count */ }; +extern int audit_classify_compat_syscall(int abi, unsigned syscall); + #endif diff --git a/kernel/audit.h b/kernel/audit.h index c57b008b9914..94738bce40b2 100644 --- a/kernel/audit.h +++ b/kernel/audit.h @@ -259,8 +259,8 @@ extern struct tty_struct *audit_get_tty(void); extern void audit_put_tty(struct tty_struct *tty); /* audit watch/mark/tree functions */ -#ifdef CONFIG_AUDITSYSCALL extern unsigned int audit_serial(void); +#ifdef CONFIG_AUDITSYSCALL extern int auditsc_get_stamp(struct audit_context *ctx, struct timespec64 *t, unsigned int *serial);