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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 22 Aug 2012 15:56:16 -0700
From:	Francesco Ruggeri <fruggeri@...stanetworks.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org, "Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH 1/1] ipv4: ipmr_expire_timer causes crash when removing
 net namespace

On Mon, Aug 20, 2012 at 10:29 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> On Mon, 2012-08-20 at 17:15 -0700, Francesco Ruggeri wrote:
>> I
>> +static void ipmr_free_table(struct mr_table *mrt)
>> +{
>> +     del_timer(&mrt->ipmr_expire_timer);
>> +     mroute_clean_tables(mrt);
>> +     kfree(mrt);
>> +}
>
> Seems racy to me.
>
> del_timer() doesnt make sure timer is completely disabled.
>
> Probably need spin_lock_bh(&mfc_unres_lock) /
> spin_unlock_bh(&mfc_unres_lock), and maybe del_timer_sync()
>

I see your point, del_timer_sync should be used to take care of any
pending timers.
I am not sure about the need for further locking though. This function
simply replaces a direct call to kfree(mrt), so I assume by this point
today's code already makes sure no one is going to access this
structure (including to start the timer), or we have a bigger problem
than just the timer.
Maybe someone familiar with ipmr can comment.

Francesco

>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ