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] [thread-next>] [day] [month] [year] [list]
Message-ID: <45239.81.105.127.245.1165964614.squirrel@www.solinno.co.uk>
Date:	Tue, 12 Dec 2006 23:03:34 -0000 (GMT)
From:	"Leigh Brown" <leigh@...inno.co.uk>
To:	"David Miller" <davem@...emloft.net>
Cc:	netdev@...r.kernel.org
Subject: Re: kernel panic with the newly merged md5 signature support

On Tue, December 12, 2006 10:25 pm, David Miller said:
> From: "Leigh Brown" <leigh@...inno.co.uk>
> Date: Tue, 12 Dec 2006 22:22:13 -0000 (GMT)
>
>> I'm not sure what the correct way forward is.  Could these functions
>> not be just:
>>
>> struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu)
>> {
>>         struct tcp_md5sig_pool **p = tcp_md5_sig_pool;
>> 	BUG_ON(!p);
>> 	return *per_cpu_ptr(p, cpu);
>> }
>>
>> void __tcp_put_md5sig_pool(void) {
>>         /* nuffin */
>> }
>>
>> In other words, can we assume that the pool is allocated when we call
>> tcp_get_md5sig_pool?
>
> I think the issue is that we need to get a balanced get_cpu()/put_cpu()
> in there somehow.

Well, the inline functions seem okay in that regard, but I'll bow to
your superior judgement.

static inline
struct tcp_md5sig_pool          *tcp_get_md5sig_pool(void)
{
        int cpu = get_cpu();
        struct tcp_md5sig_pool *ret = __tcp_get_md5sig_pool(cpu);
        if (!ret)
                put_cpu();
        return ret;
}

static inline void              tcp_put_md5sig_pool(void)
{
        __tcp_put_md5sig_pool();
        put_cpu();
}

-
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