2014-01-08 00:53:39

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 1/2] audit: print error message when fail to create audit socket

On Tue, 17 Dec 2013 11:10:41 +0800 Gao feng <[email protected]> wrote:

> print the error message and then return -ENOMEM.
>
> ...
>
> --- 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;
> }

What kernel version are these against? Something ancient, I expect -
audit_net_init() doesn't exist.

Please check current kernels, redo and resend the patches if anything
needs changing?


2014-01-08 01:17:17

by Gao feng

[permalink] [raw]
Subject: Re: [PATCH 1/2] audit: print error message when fail to create audit socket

On 01/08/2014 08:53 AM, Andrew Morton wrote:
> On Tue, 17 Dec 2013 11:10:41 +0800 Gao feng <[email protected]> wrote:
>
>> print the error message and then return -ENOMEM.
>>
>> ...
>>
>> --- 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;
>> }
>
> What kernel version are these against? Something ancient, I expect -
> audit_net_init() doesn't exist.
>
> Please check current kernels, redo and resend the patches if anything
> needs changing?

This patch is against Richard Guy Briggs's audit tree. the current kernel
doesn't have this problem.

BTW, Richard & Eric, when do you plan to push these changes to the upstream?
there are a lot of changes in Richard's tree.

2014-01-08 03:30:27

by Richard Guy Briggs

[permalink] [raw]
Subject: Re: [PATCH 1/2] audit: print error message when fail to create audit socket

On 14/01/08, Gao feng wrote:
> On 01/08/2014 08:53 AM, Andrew Morton wrote:
> > On Tue, 17 Dec 2013 11:10:41 +0800 Gao feng <[email protected]> wrote:
> >
> >> print the error message and then return -ENOMEM.
> >>
> >> ...
> >>
> >> --- 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;
> >> }
> >
> > What kernel version are these against? Something ancient, I expect -
> > audit_net_init() doesn't exist.
> >
> > Please check current kernels, redo and resend the patches if anything
> > needs changing?
>
> This patch is against Richard Guy Briggs's audit tree. the current kernel
> doesn't have this problem.
>
> BTW, Richard & Eric, when do you plan to push these changes to the upstream?
> there are a lot of changes in Richard's tree.

Planning for this merge window.

- RGB

--
Richard Guy Briggs <[email protected]>
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