06 Feb, 2020

2 commits

  • [ Upstream commit 8aaea2b0428b6aad7c7e22d3fddc31a78bb1d724 ]

    When do IPv6 tunnel PMTU update and calls __ip6_rt_update_pmtu() in the end,
    we should not call dst_confirm_neigh() as there is no two-way communication.

    Signed-off-by: Xu Wang
    Signed-off-by: Steffen Klassert
    Signed-off-by: Sasha Levin

    Xu Wang
     
  • [ Upstream commit f042365dbffea98fb8148c98c700402e8d099f02 ]

    With an ebpf program that redirects packets through a xfrm interface,
    packets are dropped because no dst is attached to skb.

    This could also be reproduced with an AF_PACKET socket, with the following
    python script (xfrm1 is a xfrm interface):

    import socket
    send_s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 0)
    # scapy
    # p = IP(src='10.100.0.2', dst='10.200.0.1')/ICMP(type='echo-request')
    # raw(p)
    req = b'E\x00\x00\x1c\x00\x01\x00\x00@\x01e\xb2\nd\x00\x02\n\xc8\x00\x01\x08\x00\xf7\xff\x00\x00\x00\x00'
    send_s.sendto(req, ('xfrm1', 0x800, 0, 0))

    It was also not possible to send an ip packet through an AF_PACKET socket
    because a LL header was expected. Let's remove those LL header constraints.

    Signed-off-by: Nicolas Dichtel
    Signed-off-by: Steffen Klassert
    Signed-off-by: Sasha Levin

    Nicolas Dichtel
     

12 Nov, 2019

1 commit

  • An ESP packet could be decrypted in async mode if the input handler for
    this packet returns -EINPROGRESS in xfrm_input(). At this moment the device
    reference in skb is held. Later xfrm_input() will be invoked again to
    resume the processing.
    If the transform state is still valid it would continue to release the
    device reference and there won't be a problem; however if the transform
    state is not valid when async resumption happens, the packet will be
    dropped while the device reference is still being held.
    When the device is deleted for some reason and the reference to this
    device is not properly released, the kernel will keep logging like:

    unregister_netdevice: waiting for ppp2 to become free. Usage count = 1

    The issue is observed when running IPsec traffic over a PPPoE device based
    on a bridge interface. By terminating the PPPoE connection on the server
    end for multiple times, the PPPoE device on the client side will eventually
    get stuck on the above warning message.

    This patch will check the async mode first and continue to release device
    reference in async resumption, before it is dropped due to invalid state.

    v2: Do not assign address family from outer_mode in the transform if the
    state is invalid

    v3: Release device reference in the error path instead of jumping to resume

    Fixes: 4ce3dbe397d7b ("xfrm: Fix xfrm_input() to verify state is valid when (encap_type < 0)")
    Signed-off-by: Xiaodong Xu
    Reported-by: Bo Chen
    Tested-by: Bo Chen
    Signed-off-by: Steffen Klassert

    Xiaodong Xu
     

07 Nov, 2019

1 commit

  • We leak the page that we use to create skb page fragments
    when destroying the xfrm_state. Fix this by dropping a
    page reference if a page was assigned to the xfrm_state.

    Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible")
    Reported-by: JD
    Reported-by: Paul Wouters
    Signed-off-by: Steffen Klassert

    Steffen Klassert
     

02 Oct, 2019

1 commit

  • commit 174e23810cd31
    ("sk_buff: drop all skb extensions on free and skb scrubbing") made napi
    recycle always drop skb extensions. The additional skb_ext_del() that is
    performed via nf_reset on napi skb recycle is not needed anymore.

    Most nf_reset() calls in the stack are there so queued skb won't block
    'rmmod nf_conntrack' indefinitely.

    This removes the skb_ext_del from nf_reset, and renames it to a more
    fitting nf_reset_ct().

    In a few selected places, add a call to skb_ext_reset to make sure that
    no active extensions remain.

    I am submitting this for "net", because we're still early in the release
    cycle. The patch applies to net-next too, but I think the rename causes
    needless divergence between those trees.

    Suggested-by: Eric Dumazet
    Signed-off-by: Florian Westphal
    Signed-off-by: Pablo Neira Ayuso

    Florian Westphal
     

15 Sep, 2019

1 commit


06 Sep, 2019

1 commit

  • Steffen Klassert says:

    ====================
    pull request (net): ipsec 2019-09-05

    1) Several xfrm interface fixes from Nicolas Dichtel:
    - Avoid an interface ID corruption on changelink.
    - Fix wrong intterface names in the logs.
    - Fix a list corruption when changing network namespaces.
    - Fix unregistation of the underying phydev.

    2) Fix a potential warning when merging xfrm_plocy nodes.
    From Florian Westphal.

    Please pull or let me know if there are problems.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

28 Aug, 2019

1 commit


25 Aug, 2019

1 commit

  • In decode_session{4,6} there is a possibility that the skb dst dev is NULL,
    e,g, with tunnel collect_md mode, which will cause kernel crash.
    Here is what the code path looks like, for GRE:

    - ip6gre_tunnel_xmit
    - ip6gre_xmit_ipv6
    - __gre6_xmit
    - ip6_tnl_xmit
    - if skb->len - t->tun_hlen - eth_hlen > mtu; return -EMSGSIZE
    - icmpv6_send
    - icmpv6_route_lookup
    - xfrm_decode_session_reverse
    - decode_session4
    - oif = skb_dst(skb)->dev->ifindex; dev->ifindex; dev to NULL by default.
    We could not fix it in __metadata_dst_init() as there is no dev supplied.
    On the other hand, the skb_dst(skb)->dev is actually not needed as we
    called decode_session{4,6} via xfrm_decode_session_reverse(), so oif is not
    used by: fl4->flowi4_oif = reverse ? skb->skb_iif : oif;

    So make a dst dev check here should be clean and safe.

    v4: No changes.

    v3: No changes.

    v2: fix the issue in decode_session{4,6} instead of updating shared dst dev
    in {ip_md, ip6}_tunnel_xmit.

    Fixes: 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels")
    Signed-off-by: Hangbin Liu
    Tested-by: Jonathan Lemon
    Signed-off-by: David S. Miller

    Hangbin Liu
     

20 Aug, 2019

1 commit

  • syzbot reported a splat:
    xfrm_policy_inexact_list_reinsert+0x625/0x6e0 net/xfrm/xfrm_policy.c:877
    CPU: 1 PID: 6756 Comm: syz-executor.1 Not tainted 5.3.0-rc2+ #57
    Call Trace:
    xfrm_policy_inexact_node_reinsert net/xfrm/xfrm_policy.c:922 [inline]
    xfrm_policy_inexact_node_merge net/xfrm/xfrm_policy.c:958 [inline]
    xfrm_policy_inexact_insert_node+0x537/0xb50 net/xfrm/xfrm_policy.c:1023
    xfrm_policy_inexact_alloc_chain+0x62b/0xbd0 net/xfrm/xfrm_policy.c:1139
    xfrm_policy_inexact_insert+0xe8/0x1540 net/xfrm/xfrm_policy.c:1182
    xfrm_policy_insert+0xdf/0xce0 net/xfrm/xfrm_policy.c:1574
    xfrm_add_policy+0x4cf/0x9b0 net/xfrm/xfrm_user.c:1670
    xfrm_user_rcv_msg+0x46b/0x720 net/xfrm/xfrm_user.c:2676
    netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2477
    xfrm_netlink_rcv+0x74/0x90 net/xfrm/xfrm_user.c:2684
    netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
    netlink_unicast+0x809/0x9a0 net/netlink/af_netlink.c:1328
    netlink_sendmsg+0xa70/0xd30 net/netlink/af_netlink.c:1917
    sock_sendmsg_nosec net/socket.c:637 [inline]
    sock_sendmsg net/socket.c:657 [inline]

    There is no reproducer, however, the warning can be reproduced
    by adding rules with ever smaller prefixes.

    The sanity check ("does the policy match the node") uses the prefix value
    of the node before its updated to the smaller value.

    To fix this, update the prefix earlier. The bug has no impact on tree
    correctness, this is only to prevent a false warning.

    Reported-by: syzbot+8cc27ace5f6972910b31@syzkaller.appspotmail.com
    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     

31 Jul, 2019

1 commit


17 Jul, 2019

4 commits

  • With the current implementation, phydev cannot be removed:

    $ ip link add dummy type dummy
    $ ip link add xfrm1 type xfrm dev dummy if_id 1
    $ ip l d dummy
    kernel:[77938.465445] unregister_netdevice: waiting for dummy to become free. Usage count = 1

    Manage it like in ip tunnels, ie just keep the ifindex. Not that the side
    effect, is that the phydev is now optional.

    Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces")
    Signed-off-by: Nicolas Dichtel
    Tested-by: Julien Floret
    Signed-off-by: Steffen Klassert

    Nicolas Dichtel
     
  • dev_net(dev) is the netns of the device and xi->net is the link netns,
    where the device has been linked.
    changelink() must operate in the link netns to avoid a corruption of
    the xfrm lists.

    Note that xi->net and dev_net(xi->physdev) are always the same.

    Before the patch, the xfrmi lists may be corrupted and can later trigger a
    kernel panic.

    Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces")
    Reported-by: Julien Floret
    Signed-off-by: Nicolas Dichtel
    Tested-by: Julien Floret
    Signed-off-by: Steffen Klassert

    Nicolas Dichtel
     
  • The ifname is copied when the interface is created, but is never updated
    later. In fact, this property is used only in one error message, where the
    netdevice pointer is available, thus let's use it.

    Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces")
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: Steffen Klassert

    Nicolas Dichtel
     
  • The new parameters must not be stored in the netdev_priv() before
    validation, it may corrupt the interface. Note also that if data is NULL,
    only a memset() is done.

    $ ip link add xfrm1 type xfrm dev lo if_id 1
    $ ip link add xfrm2 type xfrm dev lo if_id 2
    $ ip link set xfrm1 type xfrm dev lo if_id 2
    RTNETLINK answers: File exists
    $ ip -d link list dev xfrm1
    5: xfrm1@lo: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/none 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 minmtu 68 maxmtu 1500
    xfrm if_id 0x2 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

    => "if_id 0x2"

    Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces")
    Signed-off-by: Nicolas Dichtel
    Tested-by: Julien Floret
    Signed-off-by: Steffen Klassert

    Nicolas Dichtel
     

09 Jul, 2019

1 commit


06 Jul, 2019

2 commits

  • Steffen Klassert says:

    ====================
    pull request (net-next): ipsec-next 2019-07-05

    1) A lot of work to remove indirections from the xfrm code.
    From Florian Westphal.

    2) Fix a WARN_ON with ipv6 that triggered because of a
    forgotten break statement. From Florian Westphal.

    3) Remove xfrmi_init_net, it is not needed.
    From Li RongQing.

    Please pull or let me know if there are problems.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Steffen Klassert says:

    ====================
    pull request (net): ipsec 2019-07-05

    1) Fix xfrm selector prefix length validation for
    inter address family tunneling.
    From Anirudh Gupta.

    2) Fix a memleak in pfkey.
    From Jeremy Sowden.

    3) Fix SA selector validation to allow empty selectors again.
    From Nicolas Dichtel.

    4) Select crypto ciphers for xfrm_algo, this fixes some
    randconfig builds. From Arnd Bergmann.

    5) Remove a duplicated assignment in xfrm_bydst_resize.
    From Cong Wang.

    6) Fix a hlist corruption on hash rebuild.
    From Florian Westphal.

    7) Fix a memory leak when creating xfrm interfaces.
    From Nicolas Dichtel.

    Please pull or let me know if there are problems.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

03 Jul, 2019

2 commits

  • The following commands produce a backtrace and return an error but the xfrm
    interface is created (in the wrong netns):
    $ ip netns add foo
    $ ip netns add bar
    $ ip -n foo netns set bar 0
    $ ip -n foo link add xfrmi0 link-netnsid 0 type xfrm dev lo if_id 23
    RTNETLINK answers: Invalid argument
    $ ip -n bar link ls xfrmi0
    2: xfrmi0@lo: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/none 00:00:00:00:00:00 brd 00:00:00:00:00:00

    Here is the backtrace:
    [ 79.879174] WARNING: CPU: 0 PID: 1178 at net/core/dev.c:8172 rollback_registered_many+0x86/0x3c1
    [ 79.880260] Modules linked in: xfrm_interface nfsv3 nfs_acl auth_rpcgss nfsv4 nfs lockd grace sunrpc fscache button parport_pc parport serio_raw evdev pcspkr loop ext4 crc16 mbcache jbd2 crc32c_generic ide_cd_mod ide_gd_mod cdrom ata_$
    eneric ata_piix libata scsi_mod 8139too piix psmouse i2c_piix4 ide_core 8139cp mii i2c_core floppy
    [ 79.883698] CPU: 0 PID: 1178 Comm: ip Not tainted 5.2.0-rc6+ #106
    [ 79.884462] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
    [ 79.885447] RIP: 0010:rollback_registered_many+0x86/0x3c1
    [ 79.886120] Code: 01 e8 d7 7d c6 ff 0f 0b 48 8b 45 00 4c 8b 20 48 8d 58 90 49 83 ec 70 48 8d 7b 70 48 39 ef 74 44 8a 83 d0 04 00 00 84 c0 75 1f 0b e8 61 cd ff ff 48 b8 00 01 00 00 00 00 ad de 48 89 43 70 66
    [ 79.888667] RSP: 0018:ffffc900015ab740 EFLAGS: 00010246
    [ 79.889339] RAX: ffff8882353e5700 RBX: ffff8882353e56a0 RCX: ffff8882353e5710
    [ 79.890174] RDX: ffffc900015ab7e0 RSI: ffffc900015ab7e0 RDI: ffff8882353e5710
    [ 79.891029] RBP: ffffc900015ab7e0 R08: ffffc900015ab7e0 R09: ffffc900015ab7e0
    [ 79.891866] R10: ffffc900015ab7a0 R11: ffffffff82233fec R12: ffffc900015ab770
    [ 79.892728] R13: ffffffff81eb7ec0 R14: ffff88822ed6cf00 R15: 00000000ffffffea
    [ 79.893557] FS: 00007ff350f31740(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
    [ 79.894581] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [ 79.895317] CR2: 00000000006c8580 CR3: 000000022c272000 CR4: 00000000000006f0
    [ 79.896137] Call Trace:
    [ 79.896464] unregister_netdevice_many+0x12/0x6c
    [ 79.896998] __rtnl_newlink+0x6e2/0x73b
    [ 79.897446] ? __kmalloc_node_track_caller+0x15e/0x185
    [ 79.898039] ? pskb_expand_head+0x5f/0x1fe
    [ 79.898556] ? stack_access_ok+0xd/0x2c
    [ 79.899009] ? deref_stack_reg+0x12/0x20
    [ 79.899462] ? stack_access_ok+0xd/0x2c
    [ 79.899927] ? stack_access_ok+0xd/0x2c
    [ 79.900404] ? __module_text_address+0x9/0x4f
    [ 79.900910] ? is_bpf_text_address+0x5/0xc
    [ 79.901390] ? kernel_text_address+0x67/0x7b
    [ 79.901884] ? __kernel_text_address+0x1a/0x25
    [ 79.902397] ? unwind_get_return_address+0x12/0x23
    [ 79.903122] ? __cmpxchg_double_slab.isra.37+0x46/0x77
    [ 79.903772] rtnl_newlink+0x43/0x56
    [ 79.904217] rtnetlink_rcv_msg+0x200/0x24c

    In fact, each time a xfrm interface was created, a netdev was allocated
    by __rtnl_newlink()/rtnl_create_link() and then another one by
    xfrmi_newlink()/xfrmi_create(). Only the second one was registered, it's
    why the previous commands produce a backtrace: dev_change_net_namespace()
    was called on a netdev with reg_state set to NETREG_UNINITIALIZED (the
    first one).

    CC: Lorenzo Colitti
    CC: Benedict Wong
    CC: Steffen Klassert
    CC: Shannon Nelson
    CC: Antony Antony
    CC: Eyal Birger
    Fixes: f203b76d7809 ("xfrm: Add virtual xfrm interfaces")
    Reported-by: Julien Floret
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: Steffen Klassert

    Nicolas Dichtel
     
  • syzbot reported following spat:

    BUG: KASAN: use-after-free in __write_once_size include/linux/compiler.h:221
    BUG: KASAN: use-after-free in hlist_del_rcu include/linux/rculist.h:455
    BUG: KASAN: use-after-free in xfrm_hash_rebuild+0xa0d/0x1000 net/xfrm/xfrm_policy.c:1318
    Write of size 8 at addr ffff888095e79c00 by task kworker/1:3/8066
    Workqueue: events xfrm_hash_rebuild
    Call Trace:
    __write_once_size include/linux/compiler.h:221 [inline]
    hlist_del_rcu include/linux/rculist.h:455 [inline]
    xfrm_hash_rebuild+0xa0d/0x1000 net/xfrm/xfrm_policy.c:1318
    process_one_work+0x814/0x1130 kernel/workqueue.c:2269
    Allocated by task 8064:
    __kmalloc+0x23c/0x310 mm/slab.c:3669
    kzalloc include/linux/slab.h:742 [inline]
    xfrm_hash_alloc+0x38/0xe0 net/xfrm/xfrm_hash.c:21
    xfrm_policy_init net/xfrm/xfrm_policy.c:4036 [inline]
    xfrm_net_init+0x269/0xd60 net/xfrm/xfrm_policy.c:4120
    ops_init+0x336/0x420 net/core/net_namespace.c:130
    setup_net+0x212/0x690 net/core/net_namespace.c:316

    The faulting address is the address of the old chain head,
    free'd by xfrm_hash_resize().

    In xfrm_hash_rehash(), chain heads get re-initialized without
    any hlist_del_rcu:

    for (i = hmask; i >= 0; i--)
    INIT_HLIST_HEAD(odst + i);

    Then, hlist_del_rcu() gets called on the about to-be-reinserted policy
    when iterating the per-net list of policies.

    hlist_del_rcu() will then make chain->first be nonzero again:

    static inline void __hlist_del(struct hlist_node *n)
    {
    struct hlist_node *next = n->next; // address of next element in list
    struct hlist_node **pprev = n->pprev;// location of previous elem, this
    // can point at chain->first
    WRITE_ONCE(*pprev, next); // chain->first points to next elem
    if (next)
    next->pprev = pprev;

    Then, when we walk chainlist to find insertion point, we may find a
    non-empty list even though we're supposedly reinserting the first
    policy to an empty chain.

    To fix this first unlink all exact and inexact policies instead of
    zeroing the list heads.

    Add the commands equivalent to the syzbot reproducer to xfrm_policy.sh,
    without fix KASAN catches the corruption as it happens, SLUB poisoning
    detects it a bit later.

    Reported-by: syzbot+0165480d4ef07360eeda@syzkaller.appspotmail.com
    Fixes: 1548bc4e0512 ("xfrm: policy: delete inexact policies from inexact list on hash rebuild")
    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     

02 Jul, 2019

1 commit


01 Jul, 2019

1 commit


21 Jun, 2019

1 commit

  • kernelci.org reports failed builds on arc because of what looks
    like an old missed 'select' statement:

    net/xfrm/xfrm_algo.o: In function `xfrm_probe_algs':
    xfrm_algo.c:(.text+0x1e8): undefined reference to `crypto_has_ahash'

    I don't see this in randconfig builds on other architectures, but
    it's fairly clear we want to select the hash code for it, like we
    do for all its other users. As Herbert points out, CRYPTO_BLKCIPHER
    is also required even though it has not popped up in build tests.

    Fixes: 17bc19702221 ("ipsec: Use skcipher and ahash when probing algorithms")
    Signed-off-by: Arnd Bergmann
    Acked-by: Herbert Xu
    Signed-off-by: Steffen Klassert

    Arnd Bergmann
     

17 Jun, 2019

1 commit

  • After commit b38ff4075a80, the following command does not work anymore:
    $ ip xfrm state add src 10.125.0.2 dst 10.125.0.1 proto esp spi 34 reqid 1 \
    mode tunnel enc 'cbc(aes)' 0xb0abdba8b782ad9d364ec81e3a7d82a1 auth-trunc \
    'hmac(sha1)' 0xe26609ebd00acb6a4d51fca13e49ea78a72c73e6 96 flag align4

    In fact, the selector is not mandatory, allow the user to provide an empty
    selector.

    Fixes: b38ff4075a80 ("xfrm: Fix xfrm sel prefix length validation")
    CC: Anirudh Gupta
    Signed-off-by: Nicolas Dichtel
    Acked-by: Herbert Xu
    Signed-off-by: Steffen Klassert

    Nicolas Dichtel
     

14 Jun, 2019

1 commit

  • Pointer members of an object with static storage duration, if not
    explicitly initialized, will be initialized to a NULL pointer. The
    net namespace API checks if this pointer is not NULL before using it,
    it are safe to remove the function.

    Signed-off-by: Li RongQing
    Signed-off-by: Steffen Klassert

    Li RongQing
     

12 Jun, 2019

1 commit

  • net/xfrm/xfrm_input.c:378:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
    skb->protocol = htons(ETH_P_IPV6);

    ... the fallthrough then causes a bogus WARN_ON().

    Reported-by: Stephen Rothwell
    Fixes: 4c203b0454b ("xfrm: remove eth_proto value from xfrm_state_afinfo")
    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     

06 Jun, 2019

3 commits

  • Only a handful of xfrm_types exist, no need to have 512 pointers for them.

    Reduces size of afinfo struct from 4k to 120 bytes on 64bit platforms.

    Also, the unregister function doesn't need to return an error, no single
    caller does anything useful with it.

    Just place a WARN_ON() where needed instead.

    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • xfrm_prepare_input needs to lookup the state afinfo backend again to fetch
    the address family ethernet protocol value.

    There are only two address families, so a switch statement is simpler.
    While at it, use u8 for family and proto and remove the owner member --
    its not used anywhere.

    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • No module dependency, placing this in xfrm_state.c avoids need for
    an indirection.

    This also removes the state spinlock -- I don't see why we would need
    to hold it during sorting.

    This in turn allows to remove the 'net' argument passed to
    xfrm_tmpl_sort. Last, remove the EXPORT_SYMBOL, there are no modular
    callers.

    For the CONFIG_IPV6=m case, vmlinux size increase is about 300 byte.

    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     

05 Jun, 2019

4 commits

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 51 franklin st fifth floor boston ma 02110
    1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 111 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.567572064@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • There is only one implementation of this function; just call it directly.

    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • same as previous patch: just place this in the caller, no need to
    have an indirection for a structure initialization.

    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • Simple initialization, handle it in the caller.

    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

28 May, 2019

1 commit

  • Family of src/dst can be different from family of selector src/dst.
    Use xfrm selector family to validate address prefix length,
    while verifying new sa from userspace.

    Validated patch with this command:
    ip xfrm state add src 1.1.6.1 dst 1.1.6.2 proto esp spi 4260196 \
    reqid 20004 mode tunnel aead "rfc4106(gcm(aes))" \
    0x1111016400000000000000000000000044440001 128 \
    sel src 1011:1:4::2/128 sel dst 1021:1:4::2/128 dev Port5

    Fixes: 07bf7908950a ("xfrm: Validate address prefix lengths in the xfrm selector.")
    Signed-off-by: Anirudh Gupta
    Acked-by: Herbert Xu
    Signed-off-by: Steffen Klassert

    Anirudh Gupta
     

22 May, 2019

1 commit

  • Pull SPDX update from Greg KH:
    "Here is a series of patches that add SPDX tags to different kernel
    files, based on two different things:

    - SPDX entries are added to a bunch of files that we missed a year
    ago that do not have any license information at all.

    These were either missed because the tool saw the MODULE_LICENSE()
    tag, or some EXPORT_SYMBOL tags, and got confused and thought the
    file had a real license, or the files have been added since the
    last big sweep, or they were Makefile/Kconfig files, which we
    didn't touch last time.

    - Add GPL-2.0-only or GPL-2.0-or-later tags to files where our scan
    tools can determine the license text in the file itself. Where this
    happens, the license text is removed, in order to cut down on the
    700+ different ways we have in the kernel today, in a quest to get
    rid of all of these.

    These patches have been out for review on the linux-spdx@vger mailing
    list, and while they were created by automatic tools, they were
    hand-verified by a bunch of different people, all whom names are on
    the patches are reviewers.

    The reason for these "large" patches is if we were to continue to
    progress at the current rate of change in the kernel, adding license
    tags to individual files in different subsystems, we would be finished
    in about 10 years at the earliest.

    There will be more series of these types of patches coming over the
    next few weeks as the tools and reviewers crunch through the more
    "odd" variants of how to say "GPLv2" that developers have come up with
    over the years, combined with other fun oddities (GPL + a BSD
    disclaimer?) that are being unearthed, with the goal for the whole
    kernel to be cleaned up.

    These diffstats are not small, 3840 files are touched, over 10k lines
    removed in just 24 patches"

    * tag 'spdx-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (24 commits)
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 25
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 24
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 23
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 22
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 21
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 20
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 19
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 18
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 17
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 15
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 14
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 12
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 11
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 10
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 9
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 7
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 5
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 3
    ...

    Linus Torvalds
     

21 May, 2019

3 commits

  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have MODULE_LICENCE("GPL*") inside which was used in the initial
    scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

17 May, 2019

1 commit

  • This resurrects commit 8742dc86d0c7a9628
    ("xfrm4: Fix uninitialized memory read in _decode_session4"),
    which got lost during a merge conflict resolution between ipsec-next
    and net-next tree.

    c53ac41e3720 ("xfrm: remove decode_session indirection from afinfo_policy")
    in ipsec-next moved the (buggy) _decode_session4 from
    net/ipv4/xfrm4_policy.c to net/xfrm/xfrm_policy.c.
    In mean time, 8742dc86d0c7a was applied to ipsec.git and fixed the
    problem in the "old" location.

    When the trees got merged, the moved, old function was kept.
    This applies the "lost" commit again, to the new location.

    Fixes: a658a3f2ecbab ("Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next")
    Reported-by: Stephen Rothwell
    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal