Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1002643pxa; Sat, 1 Aug 2020 13:23:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6ihuL38kjyFRlUe04kUia5Pf3/mrWgddxVZKB7WBrG3nGc4FkS8by/sJVgyJ1PIrHAk6N X-Received: by 2002:a05:6402:1c86:: with SMTP id cy6mr9250772edb.30.1596313412309; Sat, 01 Aug 2020 13:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596313412; cv=none; d=google.com; s=arc-20160816; b=EiOup2jqxEso5HocyZYT2/U0bBNbS2iDMg4F4ocnPBSu8FiZRdzMq6qO53/1ByNH6I pw/JOT4PIVh/2NY+mmPRG7K44bPyjCItIS20JKNwZFn5fLHQnvfppzB1WaBmnB0Hvrs2 wjsEHHr25C2EHsQsYVecV2f6Z5ZaE+PkCbWM5ci3gxRWOHjuKYsoO80fnAZNg/bKB25b uBn3KXv+WTOMT+iPZNF1lUtTOYExFIBb+5YVg1RWQ1nXeNzKlsbB+RVseXSiQW0IHdzI H3zE+fws3mTp1dzJb07iXYE2DKALVNRykYkDh22SAStE3LEFa8e8wqyw06iLouR7O2Q1 B45w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DpdyXRkNBFG6+sXGVp5popQlf9jPzy3fYXE2HQTaqO8=; b=BQqNwcYG7so6IflGP/kcwMFrk+YLx+kbi73+mmUHlmd8N2EVoLpMQNIyBIb48Euxed W9ahUPo8pKj1Z2Wdc7Tu4nunewQ9nuUSSASvUWToDL/vzL8A6m0EMRVv9LJUd9UYEczM YqSZX+gpMxaBgwEYx/n0jTHqewhyIDIBYkJBqArgrY7nk+YbpWZoprpZkEViyd8rfA83 s0uyhCrV5UjCaDAvb2AMwU0zsQdYwuAeqorv0DUiDaeAplJgFCmynVZzYupzNMT3j66Z TexykbyWS6LjgEP9w8knnTzpXx/rlwDvNtQGMB9Wk3sFelX8oEo6H7xjTxqT3Tic7MDy b1DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=A+0JKxQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si7618782ejm.717.2020.08.01.13.23.08; Sat, 01 Aug 2020 13:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=A+0JKxQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726624AbgHAUVa (ORCPT + 99 others); Sat, 1 Aug 2020 16:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbgHAUVa (ORCPT ); Sat, 1 Aug 2020 16:21:30 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3C54C06174A for ; Sat, 1 Aug 2020 13:21:29 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id i26so21313572edv.4 for ; Sat, 01 Aug 2020 13:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DpdyXRkNBFG6+sXGVp5popQlf9jPzy3fYXE2HQTaqO8=; b=A+0JKxQ5QCsn8gb7+xJ85umagCwJG/uw+1NzJiFLUjpgcXRR4gjtb5HE4aFnaPwzu1 HMjppwxQrBwv5i/v5lo63Hwjufzk5fxMThw+JV19D63g7GccUmHqIwIGmAnQ8+2VlPK0 wlC23XmHDRwDfW8thWYWg42PE0sDGTQ9GU2+ZVhQSHA1/ESReQTWSVYpwC3bzdJOansx QVuuXFViM3gppuKL3Ly+bii6ahTj51ywLoc2sWZgUd8ndRaK3an8o4+tZTxO/W4Rc4vn Q/dQ+ycq7cZdxFuoxGiRUVklqJCRKqWT+YiQFJQ61wAc7DKIKX90YQSB2XfED9dnYjnO eXBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DpdyXRkNBFG6+sXGVp5popQlf9jPzy3fYXE2HQTaqO8=; b=p3wIChUAsZ0yji6mPuOx6FAXfScDJCkARbMc1387d6w8LQAheaYHl/fHFrGjjZ/UAt Mw1BX5W6rH5xhhsc0Fkkpj/niBk91IrolQYYdP9z3SFbWqgBmGtFcrRh+nwFZQfzv9bE 57yCNOMH5C00Cr1kHTRbUc5Yb2pDwfCBPjp+9tQRn0CbKF/SxpsRTgOTpxDl8CcVuw/3 mLcpvAogFLhhtQBg8gjBZU1Ho/OLjFEZ5ASvAuURWeik59BZIpLo+Ym3bkCyeA4iefxv KSmjM7ovfZaDpLcy14oGdtCRL3mmdso0xhtH8E/OjsT2o7h0p4p2Ukzkqq1eppKEAbCl e5KQ== X-Gm-Message-State: AOAM531TpGIdSDiBg64oB+5ghw3BJIzteRIHOu2BxHnEDlPPTHrlNZaZ lRcGj8VqbuvC0+/b5JL/Tfyhqz0XS8Fe3oXRe+IC X-Received: by 2002:aa7:db10:: with SMTP id t16mr9125634eds.196.1596313287057; Sat, 01 Aug 2020 13:21:27 -0700 (PDT) MIME-Version: 1.0 References: <20200801184603.310769-1-jbi.octave@gmail.com> <20200801184603.310769-4-jbi.octave@gmail.com> In-Reply-To: <20200801184603.310769-4-jbi.octave@gmail.com> From: Paul Moore Date: Sat, 1 Aug 2020 16:21:15 -0400 Message-ID: Subject: Re: [PATCH 3/4] audit: uninitialize static variables To: Jules Irenge Cc: linux-kernel@vger.kernel.org, Eric Paris , "moderated list:AUDIT SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 1, 2020 at 2:46 PM Jules Irenge wrote: > > Checkpatch tool reports an error at variable declaration > > "ERROR: do not initialise statics to 0" > > This is due to the fact that these variables are stored in the buffer > In the .bss section, one can not set an initial value > Here we can trust the compiler to automatically set them to zero. > The variable has since been uninitialized. > > Signed-off-by: Jules Irenge > --- > kernel/audit.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) In general this is fine, but it will have to wait until after the merge window closes. > diff --git a/kernel/audit.c b/kernel/audit.c > index 7b1a38a211a9..7d79ecb58b01 100644 > --- a/kernel/audit.c > +++ b/kernel/audit.c > @@ -311,8 +311,8 @@ void audit_panic(const char *message) > > static inline int audit_rate_check(void) > { > - static unsigned long last_check = 0; > - static int messages = 0; > + static unsigned long last_check; > + static int messages; > static DEFINE_SPINLOCK(lock); > unsigned long flags; > unsigned long now; > @@ -348,7 +348,7 @@ static inline int audit_rate_check(void) > */ > void audit_log_lost(const char *message) > { > - static unsigned long last_msg = 0; > + static unsigned long last_msg; > static DEFINE_SPINLOCK(lock); > unsigned long flags; > unsigned long now; > @@ -713,7 +713,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid, > { > int rc = 0; > struct sk_buff *skb; > - static unsigned int failed = 0; > + static unsigned int failed; > > /* NOTE: kauditd_thread takes care of all our locking, we just use > * the netlink info passed to us (e.g. sk and portid) */ > -- > 2.26.2 -- paul moore www.paul-moore.com