Page MenuHomeFreeBSD
Feed Advanced Search

Today

kib added inline comments to D20940: fusefs: merge from projects/fuse2.
Wed, Jul 17, 6:10 AM

Yesterday

kib added inline comments to D20940: fusefs: merge from projects/fuse2.
Tue, Jul 16, 9:27 PM
D20963: Use PT_GET_SC_ARGS and PT_GET_SC_RET in truss. is now accepted and ready to land.
Tue, Jul 16, 5:24 PM
kib added inline comments to D20963: Use PT_GET_SC_ARGS and PT_GET_SC_RET in truss..
Tue, Jul 16, 4:26 PM

Mon, Jul 15

D20899: Add a test for PT_GET_SC_ARGS. is now accepted and ready to land.
Mon, Jul 15, 9:19 PM
kib committed rS350005: In do_sem2_wait(), balance umtx_key_get() with umtx_key_release() on retry..
In do_sem2_wait(), balance umtx_key_get() with umtx_key_release() on retry.
Mon, Jul 15, 7:18 PM
kib added a comment to D20956: pkgbase: Move a lot of libs from their package to FreeBSD-runtime.

I explained the reasoning for runtime package in https://lists.freebsd.org/pipermail/freebsd-current/2019-April/073209.html. I do not think that increasing the size of the package just because it is convenient is reasonable. If you want all other (non-C-runtime) libs in one package, create it, but keep runtime package for its purpose.

Mon, Jul 15, 3:56 PM
kib committed rS349995: In do_lock_pi(), do not return prematurely..
In do_lock_pi(), do not return prematurely.
Mon, Jul 15, 8:40 AM
kib closed D20949: Two issues with casueword(9) update..
Mon, Jul 15, 8:38 AM
kib committed rS349994: Correctly check for casueword(9) success in do_set_ceiling()..
Correctly check for casueword(9) success in do_set_ceiling().
Mon, Jul 15, 8:38 AM
kib committed rS349993: MFC r349950:.
MFC r349950:
Mon, Jul 15, 8:21 AM
kib committed rS349992: MFC r349950:.
MFC r349950:
Mon, Jul 15, 8:21 AM

Sun, Jul 14

kib committed rS349988: PR: 239143.
PR: 239143
Sun, Jul 14, 9:09 PM
kib added a comment to D20947: Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold()..
In D20947#454166, @mjg wrote:

Note I did not propose converting refcount to long (or 64-bit). I proposed adding a long (or 64-bit) variant.
My main point is that sooner or later there will be a case where a 32-bit counter can overflow and one of places which bump it can't do error recovery. So if playing with refcounts because of struct file, perhaps the extra variant should be added instead of error recovery in several places. The need to switch the type for files will show up sooner than later and widening the struct is not substantial.

Sun, Jul 14, 7:04 PM
kib created D20949: Two issues with casueword(9) update..
Sun, Jul 14, 6:21 PM
kib added a comment to D20947: Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold()..

It seems that there are two related problems:

  1. Refcount overflows triggered by a kernel bug, such as the one dissected in the link.
  2. Refcount overflows triggered by malicious or buggy userspace, for instance by allocating 2^32 descriptors. (Note, at present this requires sizeof(filedescent) * (1 << 32) = 206GB of memory on amd64, including for descriptors internalized in unix socket buffers.)

I believe that we should unconditionally mitigate 1), either by widening the refcount type or by checking for signed overflow in all refcount operations like Linux does on x86. It is difficult to know whether a given refcount overflow is exploitable or not, so it seems prudent to accept the small cost of checking all operations and panic if an overflow is detected. 2) should not be permitted to trigger a kernel panic, so that suggests that we have a separate KPI that allows the caller to handle the overflow policy. I would therefore propose having refcount.h intrinsics panic on overflow conditions, and provide a bool refcount_acquire_notchecked(u_int *); function that allows the caller to detect overflow and do whatever they wish to mitigate the problem.

In principle I agree, but let's postpone the generic refcounting KPI change to later pass.

Sun, Jul 14, 6:17 PM
kib retitled D20947: Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold(). from Check and avoid overflow in fget_unlocked(). to Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold()..
Sun, Jul 14, 6:15 PM
kib added a comment to D20947: Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold()..

Handle overflow in fhold().

Sun, Jul 14, 6:14 PM
kib committed rS349985: MFC r349913:.
MFC r349913:
Sun, Jul 14, 5:42 AM
kib committed rS349984: MFC r349912:.
MFC r349912:
Sun, Jul 14, 5:41 AM
kib committed rS349983: MFC r349913:.
MFC r349913:
Sun, Jul 14, 5:40 AM
kib committed rS349982: MFC r349912:.
MFC r349912:
Sun, Jul 14, 5:39 AM

Sat, Jul 13

kib added a comment to D20947: Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold()..
In D20947#454095, @mjg wrote:

I don't think this is the right fix. There is other code bumping the count (with fhold()) and that is still unchecked.

Indeed.

Sat, Jul 13, 10:11 PM
kib added inline comments to D20947: Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold()..
Sat, Jul 13, 9:09 PM
kib created D20947: Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold()..
Sat, Jul 13, 9:08 PM
kib added a comment to D20931: Cache kernel stacks in UMA so that we get NUMA support, better concurrency and statistics with less redundant code..
In D20931#453942, @jeff wrote:
In D20931#453715, @kib wrote:

I think that the patch is functionally fine.
It looks strange that

  1. For newly created stack, you set the backing object domain policy to prefer domain of the current cpu.
  2. You do not encode any preference when allocating from cache.

When allocating from cache the preference was recorded when it was inserted into cache in kstack_import(). The object is initialized and pointed to by the pages.

So it is UMA_ZONE_NUMA which gives the locality when satisfying the allocation from cache ?

Sat, Jul 13, 8:21 PM
kib accepted D20930: Add support for a MINBUCKET zone flag..
Sat, Jul 13, 8:16 PM
kib added inline comments to D20625: clarify reserv_test_config.
Sat, Jul 13, 7:21 PM

Fri, Jul 12

kib committed rS349953: Fix syntax..
Fix syntax.
Fri, Jul 12, 7:15 PM
kib committed rS349951: Provide protection against starvation of the ll/sc loops when accessing….
Provide protection against starvation of the ll/sc loops when accessing…
Fri, Jul 12, 6:44 PM
kib closed D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..
Fri, Jul 12, 6:43 PM
kib committed rS349950: Style: avoid long lines by using .Fo instead of .Fn..
Style: avoid long lines by using .Fo instead of .Fn.
Fri, Jul 12, 6:39 PM
D20931: Cache kernel stacks in UMA so that we get NUMA support, better concurrency and statistics with less redundant code. is now accepted and ready to land.

I think that the patch is functionally fine.

Fri, Jul 12, 1:01 PM
D20772: Provide protection against starvation of the ll/sc loops when accessing userpace. now requires review to proceed.

Bugfixes after Peter' testing.

Fri, Jul 12, 12:11 PM
D20928: Handle stacked CPU binding. is now accepted and ready to land.
Fri, Jul 12, 9:11 AM

Thu, Jul 11

kib added inline comments to D20327: Don't reset memory attributes when mapping physical addresses for ACPI..
Thu, Jul 11, 6:34 PM
kib committed rS349913: Ensure that mds_handler always points to a valid method..
Ensure that mds_handler always points to a valid method.
Thu, Jul 11, 4:22 PM
kib committed rS349912: Restore ability to pass NULL name argument to pthread_set_name_np(3).
Restore ability to pass NULL name argument to pthread_set_name_np(3)
Thu, Jul 11, 4:19 PM
D20906: Add arm_sync_icache() and arm_drain_writebuf() sysarch syscall wrappers. is now accepted and ready to land.
Thu, Jul 11, 11:55 AM

Wed, Jul 10

kib added a comment to D20906: Add arm_sync_icache() and arm_drain_writebuf() sysarch syscall wrappers..

Libc symbol versioning chunks look fine.

Wed, Jul 10, 8:15 PM
D20905: Don't pass error from syscallenter() to syscallret(). is now accepted and ready to land.

Thanks.

Wed, Jul 10, 6:25 PM
D20898: Always set td_errno to the error value of a system call. is now accepted and ready to land.
Wed, Jul 10, 6:22 PM
kib added a comment to D20900: Increase YPMAXRECORD to 16M to be compatible with Linux..

Accumulated bugfixes.

Wed, Jul 10, 10:52 AM
D20901: Add ptrace op PT_GET_SC_RET. is now accepted and ready to land.

I think the present approach is cleaner than adding one more special case for lwpinfo.

Wed, Jul 10, 12:10 AM

Tue, Jul 9

kib added inline comments to D20898: Always set td_errno to the error value of a system call..
Tue, Jul 9, 11:57 PM
kib added inline comments to D20901: Add ptrace op PT_GET_SC_RET..
Tue, Jul 9, 11:33 PM
kib added inline comments to D20898: Always set td_errno to the error value of a system call..
Tue, Jul 9, 11:28 PM
D20897: Use 'retval' label for first error in syscallenter(). is now accepted and ready to land.
Tue, Jul 9, 11:15 PM
kib updated the summary of D20900: Increase YPMAXRECORD to 16M to be compatible with Linux..
Tue, Jul 9, 11:13 PM
kib created D20900: Increase YPMAXRECORD to 16M to be compatible with Linux..
Tue, Jul 9, 11:05 PM
D20893: Fix a next_leaf bug is now accepted and ready to land.
Tue, Jul 9, 9:37 PM
kib added inline comments to D20327: Don't reset memory attributes when mapping physical addresses for ACPI..
Tue, Jul 9, 9:21 PM
kib committed rS349855: MFC r349794:.
MFC r349794:
Tue, Jul 9, 7:21 AM
kib committed rS349854: MFC r349794:.
MFC r349794:
Tue, Jul 9, 7:20 AM
kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Thank you, Mark.

Tue, Jul 9, 7:06 AM

Sun, Jul 7

kib added a comment to D20720: Make linuxulator handle ELFOSABI_NONE ELF executables.
In D20720#452276, @kib wrote:

Well, yes, that’s precisely what it’s intended to do.

It would be even fine if we knew the side effects in advance. I can only repeat, such change should be accompanied by the analysis of effects on other ABIs.

Okay, but what do you mean by that? Apart from what I've done, which is looking at various binaries in FreeBSD, both base and some packages, to verify they are all properly branded?

Sun, Jul 7, 9:10 PM
kib added a comment to D20720: Make linuxulator handle ELFOSABI_NONE ELF executables.

Well, yes, that’s precisely what it’s intended to do.

Sun, Jul 7, 12:17 PM
D20833: factor out common wiring code is now accepted and ready to land.
Sun, Jul 7, 8:56 AM

Sat, Jul 6

kib closed D20867: Document atomicity for read(2) and write(2)..
Sat, Jul 6, 8:31 PM
kib committed rS349794: Document atomicity for read(2) and write(2)..
Document atomicity for read(2) and write(2).
Sat, Jul 6, 8:31 PM
kib added a comment to D20867: Document atomicity for read(2) and write(2)..

will see

Sat, Jul 6, 8:03 PM
kib added a comment to D20720: Make linuxulator handle ELFOSABI_NONE ELF executables.

Which other ABIs?

Sat, Jul 6, 7:40 PM
kib added a comment to D20867: Document atomicity for read(2) and write(2)..

Ref year 2004 edition.

Sat, Jul 6, 7:39 PM
kib added inline comments to D20867: Document atomicity for read(2) and write(2)..
Sat, Jul 6, 7:38 PM
kib created D20867: Document atomicity for read(2) and write(2)..
Sat, Jul 6, 5:29 PM
kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

do_lock_pp and arm64 casueword fixes.

Sat, Jul 6, 4:49 PM
kib added inline comments to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..
Sat, Jul 6, 4:48 PM
kib committed rS349792: MFC r349608:.
MFC r349608:
Sat, Jul 6, 4:19 PM

Fri, Jul 5

kib added inline comments to D20833: factor out common wiring code.
Fri, Jul 5, 9:17 PM
D20833: factor out common wiring code is now accepted and ready to land.
Fri, Jul 5, 9:00 PM
kib added inline comments to D20833: factor out common wiring code.
Fri, Jul 5, 8:15 PM
D20858: Add per-freepool page caches. is now accepted and ready to land.
Fri, Jul 5, 7:19 PM
kib accepted D19247: Merge hold_count into wire_count..
Fri, Jul 5, 7:16 PM
kib added a comment to D20720: Make linuxulator handle ELFOSABI_NONE ELF executables.

Ping? Does the patch look ok?

Fri, Jul 5, 5:51 PM
D20635: release multiple swap blocks at a time in swp_pager_force_pagein is now accepted and ready to land.
Fri, Jul 5, 4:18 PM
kib added inline comments to D20635: release multiple swap blocks at a time in swp_pager_force_pagein.
Fri, Jul 5, 11:05 AM
kib added inline comments to D20858: Add per-freepool page caches..
Fri, Jul 5, 8:56 AM
kib added inline comments to D20833: factor out common wiring code.
Fri, Jul 5, 8:44 AM
kib committed rS349758: MFC r349611, r349614:.
MFC r349611, r349614:
Fri, Jul 5, 1:22 AM
kib committed rS349757: MFC r349611, r349614:.
MFC r349611, r349614:
Fri, Jul 5, 1:19 AM

Thu, Jul 4

kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Fix issues with risc-v casueword.

Thu, Jul 4, 9:28 PM
kib accepted D20859: Don't call vm_reserv_free_page() if PG_PCPU_CACHE is set..
Thu, Jul 4, 8:44 PM
kib added inline comments to D20833: factor out common wiring code.
Thu, Jul 4, 7:53 PM

Wed, Jul 3

kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Fix arm64 and riscv asms.
Add a long comment explaining the sleep argument to umtxq_check_susp().
Do pass over the sleep arguments used aligning them with the explanation.

Wed, Jul 3, 9:36 PM
kib committed rS349689: MFC r349320, r349324:.
MFC r349320, r349324:
Wed, Jul 3, 7:46 PM
kib committed rS349688: MFC r349299:.
MFC r349299:
Wed, Jul 3, 7:42 PM
kib committed rS349687: MFC r349320, r349324:.
MFC r349320, r349324:
Wed, Jul 3, 7:34 PM
kib committed rS349685: MFC r349519:.
MFC r349519:
Wed, Jul 3, 7:31 PM
kib committed rS349684: MFC r349519:.
MFC r349519:
Wed, Jul 3, 7:31 PM
kib committed rS349683: MFC r349512:.
MFC r349512:
Wed, Jul 3, 7:30 PM
kib committed rS349682: MFC r349511:.
MFC r349511:
Wed, Jul 3, 7:29 PM
kib committed rS349681: MFC r349427:.
MFC r349427:
Wed, Jul 3, 7:27 PM
kib committed rS349679: MFC r349299:.
MFC r349299:
Wed, Jul 3, 7:25 PM
kib committed rS349678: MFC r349297:.
MFC r349297:
Wed, Jul 3, 7:23 PM
kib committed rS349676: MFC r349297:.
MFC r349297:
Wed, Jul 3, 7:22 PM

Tue, Jul 2

kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Original idea of the sleepable vs. non-sleepable umtxq_check_susp() was that existing (pre-patch) calls should be left non-sleepable, while new cases where rv == 1 are sleepable. Apparently this is too strict (wrong) and cases where we loop or own a busy ref on a key should be non-sleepable as well.

Tue, Jul 2, 9:40 PM
kib added a comment to D20772: Provide protection against starvation of the ll/sc loops when accessing userpace..

Handle reported issues, except the sleep in umtxq_check_susp.
Rebase after style changes were committed.

Tue, Jul 2, 9:37 PM
kib committed rS349614: More style..
More style.
Tue, Jul 2, 9:03 PM
kib committed rS349611: Style..
Style.
Tue, Jul 2, 7:33 PM
kib accepted D20790: Implement pmap_copy() for arm64.
Tue, Jul 2, 7:24 PM