11 Oct, 2007
19 commits
-
Each netlink socket will live in exactly one network namespace,
this includes the controlling kernel sockets.This patch updates all of the existing netlink protocols
to only support the initial network namespace. Request
by clients in other namespaces will get -ECONREFUSED.
As they would if the kernel did not have the support for
that netlink protocol compiled in.As each netlink protocol is updated to be multiple network
namespace safe it can register multiple kernel sockets
to acquire a presence in the rest of the network namespaces.The implementation in af_netlink is a simple filter implementation
at hash table insertion and hash table look up time.Signed-off-by: Eric W. Biederman
Signed-off-by: David S. Miller -
Every user of the network device notifiers is either a protocol
stack or a pseudo device. If a protocol stack that does not have
support for multiple network namespaces receives an event for a
device that is not in the initial network namespace it quite possibly
can get confused and do the wrong thing.To avoid problems until all of the protocol stacks are converted
this patch modifies all netdev event handlers to ignore events on
devices that are not in the initial network namespace.As the rest of the code is made network namespace aware these
checks can be removed.Signed-off-by: Eric W. Biederman
Signed-off-by: David S. Miller -
This patch modifies the current ipsec audit layer
by breaking it up into purpose driven audit calls.So far, the only audit calls made are when add/delete
an SA/policy. It had been discussed to give each
key manager it's own calls to do this, but I found
there to be much redundnacy since they did the exact
same things, except for how they got auid and sid, so I
combined them. The below audit calls can be made by any
key manager. Hopefully, this is ok.Signed-off-by: Joy Latten
Signed-off-by: David S. Miller -
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
These functions are only used once and are a lot easier to understand if
inlined directly into the function.Fixes by Masahide NAKAMURA.
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Increases readability a lot.
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
nlmsg_parse() puts attributes at array[type] so the indexing
method can be simpilfied by removing the obscuring "- 1".Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Adds a policy defining the minimal payload lengths for all the attributes
allowing for most attribute validation checks to be removed from in
the middle of the code path. Makes updates more consistent as many format
errors are recognised earlier, before any changes have been attempted.Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Uses nlmsg_parse() to parse the attributes. This actually changes
behaviour as unknown attributes (type > MAXTYPE) no longer cause
an error. Instead unknown attributes will be ignored henceforth
to keep older kernels compatible with more recent userspace tools.Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Moves all complex message size calculation into own inlined helper
functions and makes use of the type-safe netlink interface.Using nlmsg_new() simplifies the calculation itself as it takes care
of the netlink header length by itself.Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Moves all of the SUB_POLICY ifdefs related to the attribute size
calculation into a function.Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Adds alg_len() to calculate the properly padded length of an
algorithm attribute to simplify the code.Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Also makes use of copy_sec_ctx() in another place and removes
duplicated code.Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
This simplifies successful return codes from >0 to 0.
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller -
Signed-off-by: Thomas Graf
Signed-off-by: David S. Miller
14 Aug, 2007
1 commit
-
This patch cleans up duplicate includes in
net/xfrm/Signed-off-by: Jesper Juhl
Signed-off-by: Andrew Morton
Signed-off-by: David S. Miller
02 Aug, 2007
1 commit
-
The security_secid_to_secctx() function returns memory that must be freed
by a call to security_release_secctx() which was not always happening. This
patch fixes two of these problems (all that I could find in the kernel source
at present).Signed-off-by: Paul Moore
Acked-by: Stephen Smalley
Signed-off-by: James Morris
31 Jul, 2007
2 commits
-
This patch modifies the xfrm state selection logic to use the inner
addresses where the outer have been (incorrectly) used. This is
required for beet mode in general and interfamily setups in both
tunnel and beet mode.Signed-off-by: Joakim Koskela
Signed-off-by: Herbert Xu
Signed-off-by: Diego Beltrami
Signed-off-by: Miika Komu
Acked-by: Patrick McHardy
Signed-off-by: David S. Miller -
Similar to the issue we had with template families which
specified the inner families of policies, we need to set
the inner families of states as the main xfrm user Openswan
leaves it as zero.af_key is unaffected because the inner family is set by it
and not the KM.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller
20 Jul, 2007
1 commit
-
Slab destructors were no longer supported after Christoph's
c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
BUGs for both slab and slub, and slob never supported them
either.This rips out support for the dtor pointer from kmem_cache_create()
completely and fixes up every single callsite in the kernel (there were
about 224, not including the slab allocator definitions themselves,
or the documentation references).Signed-off-by: Paul Mundt
19 Jul, 2007
1 commit
-
Signed-off-by: YOSHIFUJI Hideaki
18 Jul, 2007
1 commit
-
XFRM expects xfrm_dst->u.next to be same pointer as dst->next, which
was broken by the dst_entry reordering in commit 1e19e02c~, causing
an oops in xfrm_bundle_ok when walking the bundle upwards.Kill xfrm_dst->u.next and change the only user to use dst->next instead.
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller
11 Jul, 2007
1 commit
-
This allows other in-kernel functions to do SAD lookups.
The only known user at the moment is pktgen.Signed-off-by: Jamal Hadi Salim
Signed-off-by: David S. Miller
19 Jun, 2007
1 commit
-
My IPsec MTU optimization patch introduced a regression in MTU calculation
for non-ESP SAs, the SA's header_len needs to be subtracted from the MTU if
the transform doesn't provide a ->get_mtu() function.Reported-and-tested-by: Marco Berizzi
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller
08 Jun, 2007
1 commit
-
Currently we check for permission before deleting entries from SAD and
SPD, (see security_xfrm_policy_delete() security_xfrm_state_delete())
However we are not checking for authorization when flushing the SPD and
the SAD completely. It was perhaps missed in the original security hooks
patch.This patch adds a security check when flushing entries from the SAD and
SPD. It runs the entire database and checks each entry for a denial.
If the process attempting the flush is unable to remove all of the
entries a denial is logged the the flush function returns an error
without removing anything.This is particularly useful when a process may need to create or delete
its own xfrm entries used for things like labeled networking but that
same process should not be able to delete other entries or flush the
entire database.Signed-off-by: Joy Latten
Signed-off-by: Eric Paris
Signed-off-by: James Morris
31 May, 2007
2 commits
-
Signed-off-by: David S. Miller
-
Signed-off-by: David S. Miller
25 May, 2007
1 commit
-
The current IPSEC rule resolution behavior we have does not work for a
lot of people, even though technically it's an improvement from the
-EAGAIN buisness we had before.Right now we'll block until the key manager resolves the route. That
works for simple cases, but many folks would rather packets get
silently dropped until the key manager resolves the IPSEC rules.We can't tell these folks to "set the socket non-blocking" because
they don't have control over the non-block setting of things like the
sockets used to resolve DNS deep inside of the resolver libraries in
libc.With that in mind I coded up the patch below with some help from
Herbert Xu which provides packet-drop behavior during larval state
resolution, controllable via sysctl and off by default.This lays the framework to either:
1) Make this default at some point or...
2) Move this logic into xfrm{4,6}_policy.c and implement the
ARP-like resolution queue we've all been dreaming of.
The idea would be to queue packets to the policy, then
once the larval state is resolved by the key manager we
re-resolve the route and push the packets out. The
packets would timeout if the rule didn't get resolved
in a certain amount of time.Signed-off-by: David S. Miller
23 May, 2007
1 commit
-
This patch adds some casts to shut up the warnings introduced by my
last patch that added a common interator function for xfrm algorightms.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller
20 May, 2007
1 commit
-
This is a natural extension of the changeset
[XFRM]: Probe selected algorithm only.
which only removed the probe call for xfrm_user. This patch does exactly
the same thing for af_key. In other words, we load the algorithm requested
by the user rather than everything when adding xfrm states in af_key.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller
14 May, 2007
2 commits
-
Multi-page allocations are always likely to fail. Since such failures
are expected and non-critical in xfrm_hash_alloc, we shouldn't warn about
them.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller -
The function xfrm_policy_byid takes a dir argument but finds the policy
using the index instead. We only use the dir argument to update the
policy count for that direction. Since the user can supply any value
for dir, this can corrupt our policy count.I know this is the problem because a few days ago I was deleting
policies by hand using indicies and accidentally typed in the wrong
direction. It still deleted the policy and at the time I thought
that was cool. In retrospect it isn't such a good idea :)I decided against letting it delete the policy anyway just in case
we ever remove the connection between indicies and direction.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller
05 May, 2007
2 commits
-
Aggregate the SPD info TLVs.
Signed-off-by: Jamal Hadi Salim
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Aggregate the SAD info TLVs.
Signed-off-by: Jamal Hadi Salim
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller
30 Apr, 2007
1 commit
-
On MIPv6 usage, XFRM sub policy is enabled.
When main (IPsec) and sub (MIPv6) policy selectors have the same
address set but different upper layer information (i.e. protocol
number and its ports or type/code), multiple bundle should be created.
However, currently we have issue to use the same bundle created for
the first time with all flows covered by the case.It is useful for the bundle to have the upper layer information
to be restructured correctly if it does not match with the flow.1. Bundle was created by two policies
Selector from another policy is added to xfrm_dst.
If the flow does not match the selector, it goes to slow path to
restructure new bundle by single policy.2. Bundle was created by one policy
Flow cache is added to xfrm_dst as originated one. If the flow does
not match the cache, it goes to slow path to try searching another
policy.Signed-off-by: Masahide NAKAMURA
Signed-off-by: David S. Miller
29 Apr, 2007
1 commit
-
With this patch you can use iproute2 in user space to efficiently see
how many policies exist in different directions.Signed-off-by: Jamal Hadi Salim
Signed-off-by: David S. Miller