14 Apr, 2008

8 commits


13 Apr, 2008

3 commits

  • David S. Miller
     
  • The xfrm_get_policy() and xfrm_add_pol_expire() put some rather large structs
    on the stack to work around the LSM API. This patch attempts to fix that
    problem by changing the LSM API to require only the relevant "security"
    pointers instead of the entire SPD entry; we do this for all of the
    security_xfrm_policy*() functions to keep things consistent.

    Signed-off-by: Paul Moore
    Acked-by: James Morris
    Signed-off-by: David S. Miller

    Paul Moore
     
  • Smack doesn't have the need to create a private copy of the LSM "domain" when
    setting NetLabel security attributes like SELinux, however, the current
    NetLabel code requires a private copy of the LSM "domain". This patches fixes
    that by letting the LSM determine how it wants to pass the domain value.

    * NETLBL_SECATTR_DOMAIN_CPY
    The current behavior, NetLabel assumes that the domain value is a copy and
    frees it when done

    * NETLBL_SECATTR_DOMAIN
    New, Smack-friendly behavior, NetLabel assumes that the domain value is a
    reference to a string managed by the LSM and does not free it when done

    Signed-off-by: Paul Moore
    Acked-by: James Morris
    Signed-off-by: David S. Miller

    Paul Moore
     

12 Apr, 2008

6 commits


10 Apr, 2008

6 commits

  • Allow the use of SACK and window scaling when syncookies are used
    and the client supports tcp timestamps. Options are encoded into
    the timestamp sent in the syn-ack and restored from the timestamp
    echo when the ack is received.

    Based on earlier work by Glenn Griffin.
    This patch avoids increasing the size of structs by encoding TCP
    options into the least significant bits of the timestamp and
    by not using any 'timestamp offset'.

    The downside is that the timestamp sent in the packet after the synack
    will increase by several seconds.

    changes since v1:
    don't duplicate timestamp echo decoding function, put it into ipv4/syncookie.c
    and have ipv6/syncookies.c use it.
    Feedback from Glenn Griffin: fix line indented with spaces, kill redundant if ()

    Reviewed-by: Hagen Paul Pfeifer
    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • 1) Standlaone ip6_null_entry is no longer needed as it is replaced by
    the ip6_null_entry member of ipv6 (instance of struct netns_ipv6) in
    struct net (as a result of Network Namespaces patches).

    2) These 3 methods from this same header are not defined anywhere:
    ip6_rt_addr_add(), ip6_rt_addr_del(), rt6_sndmsg()

    Signed-off-by: Rami Rosen
    Signed-off-by: David S. Miller

    Rami Rosen
     
  • SKF_ADF_NLATTR searches for a netlink attribute, which avoids manually
    parsing and walking attributes. It takes the offset at which to start
    searching in the 'A' register and the attribute type in the 'X' register
    and returns the offset in the 'A' register. When the attribute is not
    found it returns zero.

    A top-level attribute can be located using a filter like this
    (example for nfnetlink, using struct nfgenmsg):

    ...
    {
    /* A = offset of first attribute */
    .code = BPF_LD | BPF_IMM,
    .k = sizeof(struct nlmsghdr) + sizeof(struct nfgenmsg)
    },
    {
    /* X = CTA_PROTOINFO */
    .code = BPF_LDX | BPF_IMM,
    .k = CTA_PROTOINFO,
    },
    {
    /* A = netlink attribute offset */
    .code = BPF_LD | BPF_B | BPF_ABS,
    .k = SKF_AD_OFF + SKF_AD_NLATTR
    },
    {
    /* Exit if not found */
    .code = BPF_JMP | BPF_JEQ | BPF_K,
    .k = 0,
    .jt =
    },
    ...

    A nested attribute below the CTA_PROTOINFO attribute would then
    be parsed like this:

    ...
    {
    /* A += sizeof(struct nlattr) */
    .code = BPF_ALU | BPF_ADD | BPF_K,
    .k = sizeof(struct nlattr),
    },
    {
    /* X = CTA_PROTOINFO_TCP */
    .code = BPF_LDX | BPF_IMM,
    .k = CTA_PROTOINFO_TCP,
    },
    {
    /* A = netlink attribute offset */
    .code = BPF_LD | BPF_B | BPF_ABS,
    .k = SKF_AD_OFF + SKF_AD_NLATTR
    },
    ...

    The data of an attribute can be loaded into 'A' like this:

    ...
    {
    /* X = A (attribute offset) */
    .code = BPF_MISC | BPF_TAX,
    },
    {
    /* A = skb->data[X + k] */
    .code = BPF_LD | BPF_B | BPF_IND,
    .k = sizeof(struct nlattr),
    },
    ...

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • This patch removes two unused method declarations in
    include/net/ndisc.h: ndisc_forwarding_on(void) and
    ndisc_forwarding_off(void);

    Also igmp6_cleanup(void) appears twice in this header, so one
    igmp6_cleanup(void) declaration is removed.

    Signed-off-by: Rami Rosen
    Signed-off-by: David S. Miller

    Rami Rosen
     
  • The sk_filter function is too big to be inlined. This saves 2296 bytes
    of text on allyesconfig.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • Some minor style cleanups:
    * Move __KERNEL__ definitions to one place in filter.h
    * Use const for sk_filter_len
    * Line wrapping
    * Put EXPORT_SYMBOL next to function definition

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

09 Apr, 2008

6 commits


08 Apr, 2008

1 commit


05 Apr, 2008

3 commits


04 Apr, 2008

7 commits