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: <20090219104250.GA9633@gondor.apana.org.au>
Date:	Thu, 19 Feb 2009 18:42:51 +0800
From:	Herbert Xu <herbert@...dor.apana.org.au>
To:	Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com>
Cc:	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: compress - Add pcomp interface

On Thu, Feb 19, 2009 at 10:12:18AM +0100, Geert Uytterhoeven wrote:
>
> IIUC, my setup() routines should decode the parameters using nla_parse()?

Right.

> And the caller of a setup() routine should encode the data. But how? All the
> nla_put*() routines seem to be targeted at skb's.

The callers in the kernel should just lay it out on the stack, e.g.,

	struct {
		struct nlattr foo;
		u32 foo_val;
		struct nlattr bar;
		u32 bar_val;
		...
	};

Note that the netlink alignment is 4 so u32 doesn't need any padding
though u8/u16 would need padding before the next nlattr.  Although
for our purposes u32 should be sufficient.

> The only place where nla_parse() is called with a void */length pair is
> net/sched/em_meta.c:em_meta_change(). But I can find no place where the actual
> TCA_EM_META_* fields are encoded.

For simple things like u32 the format is just header followed by
the u32.  See nla_get_u32 for details.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ