1. 26 Oct, 2018 4 commits
    • Amir Goldstein's avatar
      ovl: fix recursive oi->lock in ovl_link() · 6cd07870
      Amir Goldstein authored
      linking a non-copied-up file into a non-copied-up parent results in a
      nested call to mutex_lock_interruptible(&oi->lock). Fix this by copying up
      target parent before ovl_nlink_start(), same as done in ovl_rename().
      
      ~/unionmount-testsuite$ ./run --ov -s
      ~/unionmount-testsuite$ ln /mnt/a/foo100 /mnt/a/dir100/
      
       WARNING: possible recursive locking detected
       --------------------------------------------
       ln/1545 is trying to acquire lock:
       00000000bcce7c4c (&ovl_i_lock_key[depth]){+.+.}, at:
           ovl_copy_up_start+0x28/0x7d
       but task is already holding lock:
       0000000026d73d5b (&ovl_i_lock_key[depth]){+.+.}, at:
           ovl_nlink_start+0x3c/0xc1
      
      [SzM: this seems to be a false positive, but doing the copy-up first is
      harmless and removes the lockdep splat]
      
      Reported-by: syzbot+3ef5c0d1a5cb0b21e6be@syzkaller.appspotmail.com
      Fixes: 5f8415d6 ("ovl: persistent overlay inode nlink for...")
      Cc: <stable@vger.kernel.org> # v4.13
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      6cd07870
    • Amir Goldstein's avatar
      vfs: fix FIGETBSZ ioctl on an overlayfs file · 8f97d1e9
      Amir Goldstein authored
      Some anon_bdev filesystems (e.g. overlayfs, ceph) don't have s_blocksize
      set. Returning zero from FIGETBSZ ioctl results in a Floating point
      exception from the e2fsprogs utility filefrag, which divides the size of
      the file with the value returned by FIGETBSZ.
      
      Fix the interface by returning -EINVAL for these filesystems.
      
      Fixes: d1d04ef8 ("ovl: stack file ops")
      Cc: <stable@vger.kernel.org> # v4.19
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      8f97d1e9
    • Miklos Szeredi's avatar
      ovl: clean up error handling in ovl_get_tmpfile() · 1f244dc5
      Miklos Szeredi authored
      If security_inode_copy_up() fails, it should not set new_creds, so no need
      for the cleanup (which would've Oops-ed anyway, due to old_creds being
      NULL).
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      1f244dc5
    • Amir Goldstein's avatar
      ovl: fix error handling in ovl_verify_set_fh() · babf4770
      Amir Goldstein authored
      We hit a BUG on kfree of an ERR_PTR()...
      
      Reported-by: syzbot+ff03fe05c717b82502d0@syzkaller.appspotmail.com
      Fixes: 8b88a2e6 ("ovl: verify upper root dir matches lower root dir")
      Cc: <stable@vger.kernel.org> # v4.13
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      babf4770
  2. 22 Oct, 2018 8 commits
  3. 21 Oct, 2018 3 commits
  4. 20 Oct, 2018 11 commits
  5. 19 Oct, 2018 13 commits
  6. 18 Oct, 2018 1 commit
    • Stefano Brivio's avatar
      ip6_tunnel: Fix encapsulation layout · d4d576f5
      Stefano Brivio authored
      Commit 058214a4 ("ip6_tun: Add infrastructure for doing
      encapsulation") added the ip6_tnl_encap() call in ip6_tnl_xmit(), before
      the call to ipv6_push_frag_opts() to append the IPv6 Tunnel Encapsulation
      Limit option (option 4, RFC 2473, par. 5.1) to the outer IPv6 header.
      
      As long as the option didn't actually end up in generated packets, this
      wasn't an issue. Then commit 89a23c8b ("ip6_tunnel: Fix missing tunnel
      encapsulation limit option") fixed sending of this option, and the
      resulting layout, e.g. for FoU, is:
      
      .-------------------.------------.----------.-------------------.----- - -
      | Outer IPv6 Header | UDP header | Option 4 | Inner IPv6 Header | Payload
      '-------------------'------------'----------'-------------------'----- - -
      
      Needless to say, FoU and GUE (at least) won't work over IPv6. The option
      is appended by default, and I couldn't find a way to disable it with the
      current iproute2.
      
      Turn this into a more reasonable:
      
      .-------------------.----------.------------.-------------------.----- - -
      | Outer IPv6 Header | Option 4 | UDP header | Inner IPv6 Header | Payload
      '-------------------'----------'------------'-------------------'----- - -
      
      With this, and with 84dad559 ("udp6: fix encap return code for
      resubmitting"), FoU and GUE work again over IPv6.
      
      Fixes: 058214a4 ("ip6_tun: Add infrastructure for doing encapsulation")
      Signed-off-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4d576f5