⬢ DragonFlyBSD Kernel Audit
DF-3543 / disasm.txt
← back to finding ↓ download raw
# objdump -d --disassemble="ng_one2many_rcvdata" /boot/kernel/ng_one2many.ko
# (DragonFly 6.5-DEVELOPMENT #0 X86_64_GENERIC, stock INVARIANTS guest)
#
# PROOF: the divide-by-zero candidate is dead on the shipped build.
#   0x87: movzwl 0xa72(%rcx),%edx   <- numActiveMany loaded ONCE into %dx
#   0x9e: test   %dx,%dx            <- the (only) zero check
#   0xa1: je     100                <- ENOTCONN path
#   ...
#   0xc1: movzwl %dx,%edi           <- divisor = CACHED %dx (no reload)
#   0xc4: cltd
#   0xc5: idiv  %edi                <- can only divide by the checked value
#
# The freed-priv window (priv cached in %rcx from entry; dst->hook loaded
# at 0x69 immediately before the tail-jump into ng_send_data) is real in
# C terms but see VERDICT.md for why it is unreachable in practice.
0000000000000000 <ng_one2many_rcvdata>:
   0:	55                   	push   %rbp
   1:	48 89 e5             	mov    %rsp,%rbp
   4:	53                   	push   %rbx
   5:	48 89 d3             	mov    %rdx,%rbx
   8:	48 83 ec 08          	sub    $0x8,%rsp
   c:	48 8b 47 20          	mov    0x20(%rdi),%rax
  10:	0f bf 57 08          	movswl 0x8(%rdi),%edx
  14:	48 8b 48 28          	mov    0x28(%rax),%rcx
  18:	8d 42 01             	lea    0x1(%rdx),%eax
  1b:	83 f8 40             	cmp    $0x40,%eax
  1e:	0f 87 ac 00 00 00    	ja     d0 <ng_one2many_rcvdata+0xd0>
  24:	83 fa ff             	cmp    $0xffffffff,%edx
  27:	74 57                	je     80 <ng_one2many_rcvdata+0x80>
  29:	48 63 c2             	movslq %edx,%rax
  2c:	48 8d 04 80          	lea    (%rax,%rax,4),%rax
  30:	48 8d 04 c1          	lea    (%rcx,%rax,8),%rax
  34:	48 83 78 70 00       	cmpq   $0x0,0x70(%rax)
  39:	0f 84 a6 00 00 00    	je     e5 <ng_one2many_rcvdata+0xe5>
  3f:	48 83 80 80 00 00 00 	addq   $0x1,0x80(%rax)
  46:	01
  47:	48 63 96 b8 00 00 00 	movslq 0xb8(%rsi),%rdx
  4e:	4c 8d 41 48          	lea    0x48(%rcx),%r8
  52:	48 01 50 78          	add    %rdx,0x78(%rax)
  56:	49 83 40 20 01       	addq   $0x1,0x20(%r8)
  5b:	48 63 86 b8 00 00 00 	movslq 0xb8(%rsi),%rax
  62:	48 89 da             	mov    %rbx,%rdx
  65:	49 01 40 18          	add    %rax,0x18(%r8)
  69:	49 8b 38             	mov    (%r8),%rdi
  6c:	48 83 c4 08          	add    $0x8,%rsp
  70:	5b                   	pop    %rbx
  71:	5d                   	pop    %rbp
  72:	e9 00 00 00 00       	jmpq   77 <ng_one2many_rcvdata+0x77>
  77:	66 0f 1f 84 00 00 00 	nopw   0x0(%rax,%rax,1)
  7e:	00 00
  80:	48 83 79 48 00       	cmpq   $0x0,0x48(%rcx)
  85:	74 5e                	je     e5 <ng_one2many_rcvdata+0xe5>
  87:	0f b7 91 72 0a 00 00 	movzwl 0xa72(%rcx),%edx
  8e:	48 83 41 58 01       	addq   $0x1,0x58(%rcx)
  93:	48 63 86 b8 00 00 00 	movslq 0xb8(%rsi),%rax
  9a:	48 01 41 50          	add    %rax,0x50(%rcx)
  9e:	66 85 d2             	test   %dx,%dx
  a1:	74 5d                	je     100 <ng_one2many_rcvdata+0x100>
  a3:	0f b7 b9 70 0a 00 00 	movzwl 0xa70(%rcx),%edi
  aa:	48 89 f8             	mov    %rdi,%rax
  ad:	0f b7 bc 79 74 0a 00 	movzwl 0xa74(%rcx,%rdi,2),%edi
  b4:	00
  b5:	83 c0 01             	add    $0x1,%eax
  b8:	48 8d 3c bf          	lea    (%rdi,%rdi,4),%rdi
  bc:	4c 8d 44 f9 70       	lea    0x70(%rcx,%rdi,8),%r8
  c1:	0f b7 fa             	movzwl %dx,%edi
  c4:	99                   	cltd
  c5:	f7 ff                	idiv   %edi
  c7:	66 89 91 70 0a 00 00 	mov    %dx,0xa70(%rcx)
  ce:	eb 86                	jmp    56 <ng_one2many_rcvdata+0x56>