Quoting Jeremie Courreges-Anglas <[email protected]>:

On Tue, Jul 10 2018, Ian McWilliam <[email protected]> wrote:
Ouch, that's a new lock order problem. The one I encountered with 4.8.2 was with the vfs/acl_tdb module.

They are not the same thing: you hit a locking problem in samba code,
the log from Vijay shows a lock ordering problem in the OpenBSD kernel.

Ian McWilliam


________________________________
From: [email protected] <[email protected]> on behalf of Vijay Sankar <[email protected]>
Sent: Tuesday, 10 July 2018 9:55 AM
To: [email protected]
Subject: Re: [update] samba-4.8.3


Quoting Jeremie Courreges-Anglas <[email protected]>:

Bugfix release: https://www.samba.org/samba/history/samba-4.8.3.html
Samba 4.8.3 - Release Notes<https://www.samba.org/samba/history/samba-4.8.3.html>
www.samba.org
Samba 4.8.3 Available for Download. Samba 4.8.3 (gzipped) Signature.
Patch (gzipped) against Samba 4.8.2 Signature ===== Release Notes for
Samba 4.8.3 June 26, 2018 ===== This is the latest stable release of the
Samba 4.8 release series.




I don't see any change in vfs_virusfilter, which was new (and apparently
broken) in 4.8.2.

Test reports welcome!


Index: Makefile
===================================================================
RCS file: /cvs/ports/net/samba/Makefile,v
retrieving revision 1.254
diff -u -p -r1.254 Makefile
--- Makefile  11 Jun 2018 11:59:51 -0000      1.254
+++ Makefile  9 Jul 2018 13:10:02 -0000
@@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.254 2018/06/11 11:59:51 jca Exp $

-VERSION =            4.8.2
+VERSION =            4.8.3
DISTNAME =            samba-${VERSION}

COMMENT-main =                SMB and CIFS client and server for UNIX
@@ -17,9 +17,11 @@ PKGNAME-docs =             samba-docs-${VERSION}

PKG_ARCH-docs =               *

-LDB_V =                      1.3.3
+LDB_V =                      1.3.4
TEVENT_V =            0.9.36

+REVISION-tevent =    0
+
SHARED_LIBS =         asn1-samba4             0.0 \
                     com_err-samba4          0.0 \
                     dcerpc                  0.0 \
@@ -34,30 +36,30 @@ SHARED_LIBS =             asn1-samba4             0.0 \
                     hx509-samba4            0.0 \
                     kdc-samba4              0.0 \
                     krb5-samba4             0.1 \
-                     ldb                     0.6 \
+                     ldb                     0.7 \
                     ndr                     0.3 \
                     ndr-krb5pac             0.1 \
                     ndr-nbt                 0.1 \
                     ndr-standard            3.0 \
                     netapi                  2.1 \
-                     pyldb-util              0.3 \
+                     pyldb-util              0.4 \
                     roken-samba4            0.0 \
                     samba-credentials       0.2 \
                     samba-errors            1.0 \
                     samba-hostconfig        4.0 \
                     samba-passdb            2.0 \
                     samba-policy            0.0 \
-                     samba-util              3.1 \
+                     samba-util              3.2 \
                     samdb                   0.1 \
                     smbclient               4.2 \
-                     smbconf                 4.0 \
+                     smbconf                 4.1 \
                     smbldap                 0.1 \
                     tevent                  0.4 \
                     tevent-util             1.0 \
                     wbclient                3.2 \
                     wind-samba4             0.0 \
-                     replace                 5.0 \
-                     util-setid              5.0
+                     replace                 6.0 \
+                     util-setid              6.0

CATEGORIES =          net sysutils security

Index: distinfo
===================================================================
RCS file: /cvs/ports/net/samba/distinfo,v
retrieving revision 1.68
diff -u -p -r1.68 distinfo
--- distinfo  11 Jun 2018 11:59:51 -0000      1.68
+++ distinfo  9 Jul 2018 09:35:30 -0000
@@ -1,2 +1,2 @@
-SHA256 (samba-4.8.2.tar.gz) = YuVSKW1J5qtEu4fRIKKIgT+lLkJDXVOh9xt3WWUSvyI=
-SIZE (samba-4.8.2.tar.gz) = 17675145
+SHA256 (samba-4.8.3.tar.gz) = 4FaaimBdXftJ8f3RHbeW9NNv4DUcSn8hOH7yUwELgu0=
+SIZE (samba-4.8.3.tar.gz) = 17680660
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/net/samba/pkg/PLIST-main,v
retrieving revision 1.41
diff -u -p -r1.41 PLIST-main
--- pkg/PLIST-main    11 Jun 2018 11:59:51 -0000      1.41
+++ pkg/PLIST-main    9 Jul 2018 11:35:53 -0000
@@ -2,6 +2,11 @@
@pkgpath net/samba,ldap,-main
@pkgpath net/samba,ads,-main
@pkgpath net/samba,,-main
+@rcscript ${RCDIR}/nmbd
+@rcscript ${RCDIR}/samba
+@rcscript ${RCDIR}/samba_ad_dc
+@rcscript ${RCDIR}/smbd
+@rcscript ${RCDIR}/winbindd
@sample ${SYSCONFDIR}/samba/
@bin bin/cifsdd
@bin bin/dbwrap_tool
@@ -1358,8 +1363,3 @@ share/samba/setup/ypServ30.ldif
@sample /var/samba/
@mode 0700
@sample /var/samba/private/
-@rcscript ${RCDIR}/nmbd
-@rcscript ${RCDIR}/samba
-@rcscript ${RCDIR}/samba_ad_dc
-@rcscript ${RCDIR}/smbd
-@rcscript ${RCDIR}/winbindd


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Hi,

Upgraded 4.8.2 to the following packages on a test DC and a test member server

-rw-r--r--  3 vijay  vijay    22822072 Jul  9 13:45 samba-4.8.3.tgz
-rw-r--r--  3 vijay  vijay      205324 Jul  9 13:45 ldb-1.3.4.tgz
-rw-r--r--  3 vijay  vijay       56716 Jul  9 13:45 tevent-0.9.36p0.tgz
-rw-r--r--  3 vijay  vijay        6328 Jul  9 13:45 samba-util-4.8.3.tgz
-rw-r--r--  4 vijay  vijay      185904 Jul  9 13:45 samba-docs-4.8.3.tgz

All basic functionality seems to work fine. I noticed the following,
but not sure what to make of it:

1) When the test DC is running as a VM with the following config:

switch "local" {
       interface bridge0
}

vm "samba483.DC" {
       disable
       memory 4096M
       disk "/vmm/samba483dc"
       interfaces 2
       interface { switch "local" }
       interface { switch "local" }
}

I was not able to add member servers initially and had to use rdate
-nv pool.ntp.org to get the correct time. Looks like the time on the
VM guest is not accurate. I could not find any solutions in the
mailing list as to how to keep the VM guest time in sync.

I see the following in VM guest.

$ sysctl hw.sensors
hw.sensors.vmmci0.timedelta0=-533.253578 secs, OK, Mon Jul  9 18:41:59.328

2) When samba 4.8.3 starts, the following is logged

lock order reversal:
1st 0xffffff07811695c0 vmmaplk (&map->lock) @ /usr/src/sys/uvm/uvm_map.c:4433
2nd 0xffffff087c37bf80 inode (&ip->i_lock) @
/usr/src/sys/ufs/ufs/ufs_vnops.c:1555
lock order "&ip->i_lock"(rrwlock) -> "&map->lock"(rwlock) first seen at:
#0  witness_checkorder+0x4c0
#1  _rw_enter_read+0x49
#2  uvmfault_lookup+0x8d
#3  uvm_fault+0x72
#4  pageflttrap+0x14c
#5  trap+0x319
#6  alltraps_kern+0x7e
#7  copyout+0x48
#8  ffs_read+0x1f0
#9  VOP_READ+0x49
#10 vn_read+0xca
#11 dofilereadv+0x216
#12 sys_read+0x82
#13 syscall+0x32a
#14 Xsyscall_untramp+0xe4
lock order "&map->lock"(rwlock) -> "&ip->i_lock"(rrwlock) first seen at:
#0  witness_checkorder+0x4c0
#1  _rw_enter+0x68
#2  _rrw_enter+0x3e
#3  VOP_LOCK+0x3d
#4  vn_lock+0x34
#5  uvn_io+0x1b8
#6  uvm_pager_put+0x109
#7  uvn_flush+0x424
#8  uvm_map_clean+0x3e7
#9  syscall+0x32a
#10 Xsyscall_untramp+0xe4

Is this to be expected or is there a problem here?

If there are any other tests that will be helpful please let me know.

Thanks very much,

Vijay


Vijay Sankar, M.Eng., P.Eng.
ForeTell Technologies Limited
[email protected]



--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

I will do the tests again on a set of clean machines with a newer -current. I am also wondering if testing with bsd.sp instead of bsd.mp is a valid approach.

This is what I have done so far:

My test set up is using a VM guest as the DC and the VM host server as a member server. So may be that was not a good idea to begin with.

I verified that there were no errors with Samba 4.8.2 (tested by doing a pkg_add -r for ldb 1.3.3 and samba 4.8.2 on the server that had ldb 1.3.4 and samba 4.8.3). Lock order reversal messages show up only with 4.8.3 and they show up whether I use the default smb.conf or the smb.conf for being a member server in a DC.

The problems I noticed went away when I did the following:

Shutdown Samba on both the member server and the DC.

On the DC, I did

samba483dc# rdate -nv pool.ntp.org
Tue Jul 10 05:36:24 CDT 2018
rdate: adjust local clock by 19432.934504 seconds
samba483dc# date
Tue Jul 10 05:36:25 CDT 2018

Restarted samba_ad_dc on the DC and then restarted samba on the member server. I did not get the lock order reversal message this time. If I have samba in /etc/rc.conf.local pkg_scripts on the VM host, then the lock order reversal shows up in dmesg and in /var/log/messages.

So I installed samba 4.8.3 on a different box (desktop computer with gnome) thinking that the problem was due to my test setup. Unfortunately starting samba with the default smb.conf (not a domain member) resulted in the following:

error: [drm:pid48841:intel_pipe_update_start] *ERROR* Potential atomic update failure on pipe A
lock order reversal:
1st 0xffffffff81df30b0 &sched_lock (&sched_lock) @ /usr/src/sys/kern/kern_synch.c:444 2nd 0xffff8000000ff9f0 &dev_priv->uncore.lock (&dev_priv->uncore.lock) @ /usr/src/sys/dev/pci/drm/i915/intel_uncore.c:811 lock order "&dev_priv->uncore.lock"(mutex) -> "&sched_lock"(sched_lock) first seen at:
#0  witness_checkorder+0x4c0
#1  ___mp_lock+0x70
#2  schedclock+0x30
#3  hardclock+0xe3
#4  lapic_clockintr+0x3d
#5  Xresume_lapic_ltimer+0x22
#6  x86_bus_space_mem_read_4+0x14
#7  gen6_read32+0x184
#8  drm_update_vblank_count+0x65
#9  drm_handle_vblank+0xee
#10 ironlake_irq_handler+0x4e4
#11 intr_handler+0x74
#12 Xintr_ioapic_edge18_untramp+0x161
#13 ___mp_lock+0xca
#14 solock+0x50
#15 sosend+0x117
#16 sendit+0x3fb
#17 sys_sendmsg+0x15a
#18 syscall+0x32a
lock order "&sched_lock"(sched_lock) -> "&dev_priv->uncore.lock"(mutex) first seen at:
#0  witness_checkorder+0x4c0
#1  _mtx_enter+0x31
#2  gen6_read32+0x8f
#3  gen6_ring_get_seqno+0x3a
#4  __i915_wait_request+0x232
#5  i915_gem_object_wait_rendering__nonblocking+0x1d6
#6  i915_gem_set_domain_ioctl+0xdb
#7  drm_do_ioctl+0x221
#8  drmioctl+0xf9
#9  VOP_IOCTL+0x5a
#10 vn_ioctl+0x6b
#11 sys_ioctl+0x477
#12 syscall+0x32a
#13 Xsyscall_untramp+0xe4
lock order reversal:
1st 0xffffffff81df30b0 &sched_lock (&sched_lock) @ /usr/src/sys/kern/kern_synch.c:444 2nd 0xffff800000106270 &dev_priv->irq_lock (&dev_priv->irq_lock) @ /usr/src/sys/dev/pci/drm/i915/intel_ringbuffer.c:1787 lock order "&dev_priv->irq_lock"(mutex) -> "&sched_lock"(sched_lock) first seen at:
#0  witness_checkorder+0x4c0
#1  ___mp_lock+0x70
#2  wakeup_n+0x39
#3  task_add+0x93
#4  gen6_rps_boost+0x129
#5  __i915_wait_request+0x155
#6  i915_gem_object_wait_rendering__nonblocking+0x1d6
#7  i915_gem_set_domain_ioctl+0xdb
#8  drm_do_ioctl+0x221
#9  drmioctl+0xf9
#10 VOP_IOCTL+0x5a
#11 vn_ioctl+0x6b
#12 sys_ioctl+0x477
#13 syscall+0x32a
#14 Xsyscall_untramp+0xe4
lock order "&sched_lock"(sched_lock) -> "&dev_priv->irq_lock"(mutex) first seen at:
#0  witness_checkorder+0x4c0
#1  _mtx_enter+0x31
#2  gen6_ring_put_irq+0x36
#3  __i915_wait_request+0x367
#4  i915_gem_object_wait_rendering__nonblocking+0x1d6
#5  i915_gem_set_domain_ioctl+0xdb
#6  drm_do_ioctl+0x221
#7  drmioctl+0xf9
#8  VOP_IOCTL+0x5a
#9  vn_ioctl+0x6b
#10 sys_ioctl+0x477
#11 syscall+0x32a
#12 Xsyscall_untramp+0xe4
lock order reversal:
1st 0xffffff07059c4a00 vmmaplk (&map->lock) @ /usr/src/sys/uvm/uvm_map.c:4433 2nd 0xffffff070d217a30 inode (&ip->i_lock) @ /usr/src/sys/ufs/ufs/ufs_vnops.c:1555
lock order "&ip->i_lock"(rrwlock) -> "&map->lock"(rwlock) first seen at:
#0  witness_checkorder+0x4c0
#1  _rw_enter+0x68
#2  vm_map_lock_ln+0xbc
#3  uvm_map+0x1a1
#4  km_alloc+0x16a
#5  pool_multi_alloc_ni+0xbb
#6  pool_p_alloc+0x56
#7  pool_do_get+0xe4
#8  pool_get+0xaf
#9  ufsdirhash_build+0x31e
#10 ufs_lookup+0x19d
#11 VOP_LOOKUP+0x4f
#12 vfs_lookup+0x27e
#13 namei+0x226
#14 start_init+0xb2
lock order "&map->lock"(rwlock) -> "&ip->i_lock"(rrwlock) first seen at:
#0  witness_checkorder+0x4c0
#1  _rw_enter+0x68
#2  _rrw_enter+0x3e
#3  VOP_LOCK+0x3d
#4  vn_lock+0x34
#5  uvn_io+0x1b8
#6  uvm_pager_put+0x109
#7  uvn_flush+0x424
#8  uvm_map_clean+0x3e7
#9  syscall+0x32a
#10 Xsyscall_untramp+0xe4

Did a pkg_add -r samba-4.8.2 and ldb-1.3.3; restarted the desktop and verified there are no lock reversal messages

Vijay

Vijay Sankar, M.Eng., P.Eng.
ForeTell Technologies Limited
[email protected]

Reply via email to