lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 13 Dec 2017 14:24:49 -0800
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Eric Dumazet <eric.dumazet@...il.com>
Cc:     Eric Dumazet <edumazet@...gle.com>,
        Tariq Toukan <tariqt@...lanox.com>,
        "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        "Eric W . Biederman" <ebiederm@...ssion.com>,
        Majd Dibbiny <majd@...lanox.com>,
        Yonatan Cohen <yonatanc@...lanox.com>,
        Eran Ben Elisha <eranbe@...lanox.com>
Subject: Re: [PATCH v2 net-next 0/7] net: speedup netns create/delete time

On Wed, Dec 13, 2017 at 1:52 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> On Wed, 2017-12-13 at 13:43 -0800, Dmitry Torokhov wrote:
>> Hi Eric,
>>
>> On Thu, Oct 19, 2017 at 7:11 AM, Eric Dumazet <edumazet@...gle.com> wrote:
>> >
>> > On Thu, Oct 19, 2017 at 4:48 AM, Tariq Toukan <tariqt@...lanox.com> wrote:
>> > >
>> > > Hi Eric,
>> > >
>> > > I just wanted to check if this is solved already, as I don't want to keep an
>> > > unnecessary revert patch in our internal branches.
>> > > According to my check bug still exists.
>> > >
>> >
>> > I will handle this today, thanks for the reminder.
>>
>> Did you have a chance to do this? It looks like the original change
>> landed on mainline and causes modules to be autoloaded on KOBJ_UNBIND
>> again.
>>
>> Thanks!
>
> I sent the following to Tariq, and he tested it successfully.
>
> I will submit this formally.
>
> diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
> index c3e84edc47c965d40199b652ba78876cdaa9c70c..0795482b15d5a8f1b65b570a071aa1419cb923d8 100644
> --- a/lib/kobject_uevent.c
> +++ b/lib/kobject_uevent.c
> @@ -346,19 +346,25 @@ static int kobject_uevent_net_broadcast(struct kobject *kobj,
>  static void zap_modalias_env(struct kobj_uevent_env *env)
>  {
>         static const char modalias_prefix[] = "MODALIAS=";
> +       size_t offset = 0, len;
>         int i;
>
>         for (i = 0; i < env->envp_idx;) {
> +               len = strlen(env->envp[i]) + 1;
>                 if (strncmp(env->envp[i], modalias_prefix,
>                             sizeof(modalias_prefix) - 1)) {
>                         i++;
> +                       offset += len;
>                         continue;
>                 }
>
> -               if (i != env->envp_idx - 1)
> +               env->buflen -= len;
> +               if (i != env->envp_idx - 1) {
> +                       memmove(env->envp[i], env->envp[i + 1],
> +                               env->buflen - offset);
>                         memmove(&env->envp[i], &env->envp[i + 1],
>                                 sizeof(env->envp[i]) * env->envp_idx - 1);
> -
> +               }
>                 env->envp_idx--;
>         }
>  }
>

As I mentioned in the other thread, that works for netlink, but breaks
if you actually using env->envp pointers, as they also need to be
adjusted. I have a patch that fixes it properly.

Thanks!


-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ