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>] [day] [month] [year] [list]
Date:	Sun, 04 Oct 2009 06:37:39 -0400
From:	William Allen Simpson <william.allen.simpson@...il.com>
To:	netdev@...r.kernel.org
Subject: query: per cpu hash pool spinlock

As the reviewers will notice, the tcp cookie patch skips the problem of
generating proper cookies:

		/* secret recipe not yet implemented */
		get_random_bytes(bakery, tmp_opt.cookie_size);

It wasn't needed for SYNACK data, but is required for the next step
(validation of cookies).  As I read the net/tcp.c TCP_MD5SIG code, there's
more code for handling multiple cpus than for doing the hashing.  I cannot
find sufficient documentation.  I'm stumped.

What I have is two global keys, used for all tcp sockets, no matter the
address family.  These keys are changed periodically.

Can I dispense with a pool, and just spinlock for kmalloc and kfree?

NB, I'm trying to port some 15-year-old fairly simple and straightforward
(single cpu) code that accomplishes the following:

/**
  * Each Responder maintains up to two secret values concurrently for
  * efficient secret rollover.  Each secret value has 4 states:
  *
  * Generating.
  *    Generates new Responder-Cookies, but not yet used for primary
  *    verification.  This is a short-term state, typically lasting only
  *    one round trip time (RTT).
  *
  * Primary.
  *    Used both for generation and primary verification.
  *
  * Retiring.
  *    Used for verification, until the first failure that can be
  *    verified by the newer Generating secret.  At that time, this
  *    cookie's state is changed to Secondary, and the Generating
  *    cookie's state is changed to Primary.  This is a short-term state,
  *    typically lasting only one round trip time (RTT).
  *
  * Secondary.
  *    Used for secondary verification, after primary verification
  *    failures.  This state lasts no more than twice the Maximum Segment
  *    Lifetime (2MSL).  Then, the secret is discarded.
  */
static struct tcp_cookie_key *tcp_cookie_generating = NULL;
static struct tcp_cookie_key *tcp_cookie_primary = NULL;
static struct tcp_cookie_key *tcp_cookie_retiring = NULL;
static struct tcp_cookie_key *tcp_cookie_secondary = NULL;

static struct tcp_cookie_key *tcp_cookie_key_one = NULL;
static struct tcp_cookie_key *tcp_cookie_key_two = NULL;

--
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