opnsense-src/sys
Kirk McKusick 8563de2f27 Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash
The panic reported in 253158 arises because the /mnt/.snap/.factory
snapshot allocated the last block in the filesystem. The snapshot
code allocates the last block in the filesystem as a way of setting
its length to be the size of the filesystem. Part of taking a
snapshot is to remove all the earlier snapshots from the image of
the newest snapshot so that newer snapshots will not claim the blocks
of the earlier snapshots. The panic occurs when the new snapshot
finds that both it and an earlier snapshot claim the same block.

The fix is to set the size of the snapshot to be one block after
the last block in the filesystem. This block can never be allocated
since it is not a valid block in the filesystem. This extra block
is used as a place to store the initial list of blocks that the
snapshot has already copied and is used to avoid a deadlock in and
speed up the ffs_copyonwrite() function.

Reported by:  Harald Schmalzbauer
Tested by:    Peter Holm
PR:           253158
Sponsored by: Netflix
2021-02-11 21:31:16 -08:00
..
amd64 Revert "amd64: implement strlen in assembly" 2021-02-09 16:23:18 +01:00
arm arm32: Align arguments of sync_icache() syscall to cacheline size. 2021-02-09 12:53:09 +01:00
arm64 arm64: Add a SOC_BRCM_NS2 option 2021-02-10 21:15:50 +01:00
bsm Add aio_writev and aio_readv 2021-01-02 19:57:58 -07:00
cam cam: Properly find the sim in the assertion in xpt_pollwait(). 2021-02-11 14:06:58 -08:00
cddl arm64: Improve DDB backtrace support 2021-02-01 14:15:57 +00:00
compat epoll: Store epoll_event udata member in ext member of kevent. 2021-02-08 02:46:14 +03:00
conf arm64: if_dwc is also needed by intel stratix10 platform 2021-02-10 21:15:59 +01:00
contrib Fix non-IPv6 build post 57785538c6. 2021-02-09 17:18:25 -08:00
crypto armv8crypto: Extract GCM state into a structure 2021-02-08 09:19:10 -05:00
ddb ddb: add ability to print user registers 2021-01-08 14:53:06 -04:00
dev iscsi: Mark iSCSI CAM sims as non-pollable. 2021-02-11 13:52:18 -08:00
dts Remove DTS files for arm boards we don't support 2021-01-27 10:02:01 +00:00
fs nfsserver: use VOP_VPUT_PAIR(). 2021-02-12 03:02:21 +02:00
gdb gdb(4): allow bulk write of registers 2020-12-23 14:37:05 -04:00
geom opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
gnu Remove the old dts imported tree. 2021-01-15 20:09:55 +01:00
i386 Fix a typo. 2021-01-27 21:52:41 -08:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern fifo: minor comment and assert improvements. 2021-02-12 03:02:22 +02:00
kgssapi opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
libkern Restore the augmented strlen commentary 2021-02-08 19:15:21 +00:00
mips mips: fix NLM platforms breakage caused by e0a0a3ef 2021-01-31 23:56:22 -08:00
modules ZFS: fix assertions with INVARIANTS 2021-02-08 16:41:35 -07:00
net Fix blackhole/reject routes. 2021-02-11 23:08:55 +00:00
net80211 net80211: fix a typo 2020-11-04 12:07:33 +00:00
netgraph netgraph/ng_bridge: Add counters for the first link, too 2021-02-10 19:05:37 +01:00
netinet [udp] fix possible mbuf and lock leak in udp_input(). 2021-02-11 12:08:41 +03:00
netinet6 [udp6] fix possible panic due to lack of locking. 2021-02-11 12:00:25 +03:00
netipsec Revert "SO_RERROR indicates that receive buffer overflows should be handled as errors." 2021-02-08 22:32:32 +00:00
netpfil Allow setting alias port ranges in libalias and ipfw. This will allow a system 2021-02-02 13:24:17 -08:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: Mark unused statistics variable as reserved 2020-11-18 04:35:49 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed Fix mismerge in OFED update 2021-02-04 13:58:24 -05:00
opencrypto ktls: Avoid wakeups and locking for synchronous callbacks 2021-02-08 09:19:27 -05:00
powerpc powerpc64: Fix boot on virtual-mode OF (PowerMac G5) 2021-02-07 16:13:55 -06:00
riscv riscv: add SBI system reset extension 2021-01-27 19:19:54 -04:00
rpc nfs-over-tls: handle res.gid.gid_val correctly for memory allocation 2021-01-12 13:59:52 -08:00
security Convert remaining cap_rights_init users to cap_rights_init_one 2021-01-12 13:16:10 +00:00
sys Stop ignoring ERELOOKUP from VOP_INACTIVE() 2021-02-12 03:02:21 +02:00
teken loader: implement framebuffer console 2021-01-02 21:41:36 +02:00
tests Enable running fib tests inside vnet jail. 2021-01-17 20:32:26 +00:00
tools syscalls.master: Add a new syscall type: RESERVED 2021-01-26 18:27:44 +00:00
ufs Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash 2021-02-11 21:31:16 -08:00
vm vm: Honour the "noreuse" flag to vm_page_unwire_managed() 2021-02-10 11:10:27 -05:00
x86 mca: Handle inconsistent CMCI capability reporting 2021-02-08 14:42:54 -05:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: remove .swp file from public headers 2021-01-11 18:14:11 +01:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00