All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Paul Moore <pmoore@redhat.com>
Cc: linux-security-module@vger.kernel.org,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: sel_netif_init: 'err' is used uninitialized (was: Re: selinux: reduce the number of calls to synchronize_net() when flushing caches)
Date: Thu, 7 Aug 2014 12:31:15 +0200	[thread overview]
Message-ID: <CAMuHMdV4VpaH1nHYO5hr66Xib5o_Pib863JzGRtg2kYcjMp2TQ@mail.gmail.com> (raw)

On Wed, Aug 6, 2014 at 6:27 PM, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/;a=commit;h=615e51fdda6f274e94b1e905fcaf6111e0d9aa20
> Commit:     615e51fdda6f274e94b1e905fcaf6111e0d9aa20
> Parent:     f31e799459659ae88c341aeac16a8a5efb1271d4
> Refname:    refs/heads/master
> Author:     Paul Moore <pmoore@redhat.com>
> AuthorDate: Thu Jun 26 14:33:56 2014 -0400
> Committer:  Paul Moore <pmoore@redhat.com>
> CommitDate: Thu Jun 26 14:33:56 2014 -0400
>
>     selinux: reduce the number of calls to synchronize_net() when flushing caches
>
>     When flushing the AVC, such as during a policy load, the various
>     network caches are also flushed, with each making a call to
>     synchronize_net() which has shown to be expensive in some cases.
>     This patch consolidates the network cache flushes into a single AVC
>     callback which only calls synchronize_net() once for each AVC cache
>     flush.

> --- a/security/selinux/netif.c
> +++ b/security/selinux/netif.c

> @@ -291,10 +282,6 @@ static __init int sel_netif_init(void)
>
>         register_netdevice_notifier(&sel_netif_netdev_notifier);
>
> -       err = avc_add_callback(sel_netif_avc_callback, AVC_CALLBACK_RESET);
> -       if (err)
> -               panic("avc_add_callback() failed, error %d\n", err);
> -
>         return err;

security/selinux/netif.c: In function ‘sel_netif_init’:
/scratch/geert/linux/linux-m68k/security/selinux/netif.c:285: warning:
‘err’ is used uninitialized in this function

Should it just return 0, like before?
Or should it return the return value of register_netdevice_notifier() instead,
which also returns an error code? Or is that failure non-critical?

>  }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Paul Moore <pmoore@redhat.com>
Cc: linux-security-module@vger.kernel.org,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: sel_netif_init: 'err' is used uninitialized (was: Re: selinux: reduce the number of calls to synchronize_net() when flushing caches)
Date: Thu, 7 Aug 2014 12:31:15 +0200	[thread overview]
Message-ID: <CAMuHMdV4VpaH1nHYO5hr66Xib5o_Pib863JzGRtg2kYcjMp2TQ@mail.gmail.com> (raw)

On Wed, Aug 6, 2014 at 6:27 PM, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/;a=commit;h=615e51fdda6f274e94b1e905fcaf6111e0d9aa20
> Commit:     615e51fdda6f274e94b1e905fcaf6111e0d9aa20
> Parent:     f31e799459659ae88c341aeac16a8a5efb1271d4
> Refname:    refs/heads/master
> Author:     Paul Moore <pmoore@redhat.com>
> AuthorDate: Thu Jun 26 14:33:56 2014 -0400
> Committer:  Paul Moore <pmoore@redhat.com>
> CommitDate: Thu Jun 26 14:33:56 2014 -0400
>
>     selinux: reduce the number of calls to synchronize_net() when flushing caches
>
>     When flushing the AVC, such as during a policy load, the various
>     network caches are also flushed, with each making a call to
>     synchronize_net() which has shown to be expensive in some cases.
>     This patch consolidates the network cache flushes into a single AVC
>     callback which only calls synchronize_net() once for each AVC cache
>     flush.

> --- a/security/selinux/netif.c
> +++ b/security/selinux/netif.c

> @@ -291,10 +282,6 @@ static __init int sel_netif_init(void)
>
>         register_netdevice_notifier(&sel_netif_netdev_notifier);
>
> -       err = avc_add_callback(sel_netif_avc_callback, AVC_CALLBACK_RESET);
> -       if (err)
> -               panic("avc_add_callback() failed, error %d\n", err);
> -
>         return err;

security/selinux/netif.c: In function ‘sel_netif_init’:
/scratch/geert/linux/linux-m68k/security/selinux/netif.c:285: warning:
‘err’ is used uninitialized in this function

Should it just return 0, like before?
Or should it return the return value of register_netdevice_notifier() instead,
which also returns an error code? Or is that failure non-critical?

>  }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2014-08-07 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07 10:31 Geert Uytterhoeven [this message]
2014-08-07 10:31 ` sel_netif_init: 'err' is used uninitialized (was: Re: selinux: reduce the number of calls to synchronize_net() when flushing caches) Geert Uytterhoeven
2014-08-07 14:26 ` Paul Moore
2014-08-07 14:57   ` Geert Uytterhoeven
2014-08-07 19:04   ` sel_netif_init: 'err' is used uninitialized David Miller
2014-08-07 19:04     ` David Miller
2014-08-08  1:01     ` Paul Moore
2014-08-08  1:01       ` Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdV4VpaH1nHYO5hr66Xib5o_Pib863JzGRtg2kYcjMp2TQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pmoore@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.