From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Guy Briggs Subject: Re: [PATCH 1/2] audit: print error message when fail to create audit socket Date: Thu, 19 Dec 2013 20:34:51 -0500 Message-ID: <20131220013451.GB14944@madcap2.tricolour.ca> References: <1387249842-27793-1-git-send-email-gaofeng@cn.fujitsu.com> <1387295792.23829.86.camel@flatline.rdu.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1387295792.23829.86.camel@flatline.rdu.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Eric Paris Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org List-Id: linux-audit@redhat.com On 13/12/17, Eric Paris wrote: > On Tue, 2013-12-17 at 11:10 +0800, Gao feng wrote: > > print the error message and then return -ENOMEM. > > > > Signed-off-by: Gao feng > > Haha. If it's NULL return. No no, if it's REALLY null audit_panic(). Wow, who committed *that* crap!?! :P Thanks for the catch. > Acked-by: Eric Paris > > --- > > kernel/audit.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/kernel/audit.c b/kernel/audit.c > > index 2a0ed0b..041b951 100644 > > --- a/kernel/audit.c > > +++ b/kernel/audit.c > > @@ -1083,12 +1083,11 @@ static int __net_init audit_net_init(struct net *net) > > pr_info("audit: initializing netlink socket in namespace\n"); > > > > aunet->nlsk = netlink_kernel_create(net, NETLINK_AUDIT, &cfg); > > - if (aunet->nlsk == NULL) > > - return -ENOMEM; > > - if (!aunet->nlsk) > > + if (aunet->nlsk == NULL) { > > audit_panic("cannot initialize netlink socket in namespace"); > > - else > > - aunet->nlsk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; > > + return -ENOMEM; > > + } > > + aunet->nlsk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; > > return 0; > > } - RGB -- Richard Guy Briggs Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat Remote, Ottawa, Canada Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545