Bug 245463 - sysctl: Driver tunables that use strings fail with error 14
Summary: sysctl: Driver tunables that use strings fail with error 14
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Pawel Biernacki
URL:
Keywords: needs-qa, regression
Depends on:
Blocks:
 
Reported: 2020-04-08 23:10 UTC by Jeff Pieper
Modified: 2020-04-15 16:35 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Pieper 2020-04-08 23:10:10 UTC
When changing driver tunables that use strings with kenv, they fail with error 14. For example Intel drivers rx/tx descriptor tunables fail with:

Setting sysctl dev.ixl.0.iflib.override_ntxds failed: 14
Setting sysctl dev.ixl.0.iflib.override_nrxds failed: 14

More than likely this is caused by https://reviews.freebsd.org/D23378. This patch has made changes to the sysctl_handle_string() function. The copyin() function  is now used to copy bytes from user space to kernel space. The problem is that the tunables are already located in the kernel space (kenv). It turns out that changing string parameters using sysctl works well, but if you set string parameters from kenv, the copyin() function fails with error 14.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-04-09 01:59:07 UTC
Associated commit: base r357614
Comment 2 Pawel Biernacki freebsd_committer 2020-04-15 11:52:52 UTC
Review with a proposed fix: https://reviews.freebsd.org/D24429
Comment 3 commit-hook freebsd_committer 2020-04-15 16:34:39 UTC
A commit references this bug:

Author: kaktus
Date: Wed Apr 15 16:33:55 UTC 2020
New revision: 359975
URL: https://svnweb.freebsd.org/changeset/base/359975

Log:
  sysctl(9): fix handling string tunables.

  r357614 changed internals of handling string sysctls, and inadvertently
  broke setting string tunables.  Take them into account.

  PR:		245463
  Reported by:	jhb, np
  Reviewed by:	imp, jhb, kib
  Approved by:	kib (mentor)
  Differential Revision:	https://reviews.freebsd.org/D24429

Changes:
  head/sys/kern/kern_sysctl.c