From owner-svn-src-all@freebsd.org Sat Aug 29 11:34:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC71F3D5ADA for ; Sat, 29 Aug 2020 11:34:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdvWl6VNZz4LVX for ; Sat, 29 Aug 2020 11:34:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x843.google.com with SMTP id v54so103510qtj.7 for ; Sat, 29 Aug 2020 04:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o3jXBz5nDIIFj1L25ZpT0GFXgwQPFG2rTkKUrxndlNc=; b=mK03SkZsVRQWQp79F+HjPDFtIYikCaZmX5hf1/yVxfDE0sQxccMoMg0biShxbttm2y z0KKlObT1tOm+08Wcq44Y7hPZ+arq3Eh3dkoGKOjj2lnVMMcZwPb6FrFu/u/Gr1A01L9 V9BDs1syUwkd+aBgHqremThTrcIOKI/TTBie6NBTqM3T8fLbs6+VoR0btoQhXv2ONmR8 l9bOMeuIAxQRwDoWYgCVyOPN458fzQpmHbbdPi2xXSPQgV3DG9tKxmP7G8y9JBW2qk36 Nb1AbmHAelzrAYvmjvQi46edCIErH7mJPMPT+jUQVOtLRy34EoFAcxDGlSQa6Gs59MZu 29TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o3jXBz5nDIIFj1L25ZpT0GFXgwQPFG2rTkKUrxndlNc=; b=DOMW04YtxhHqegPKNb25B6nC2IyRxP06WV4N5tXA0KYS9UOjZTR+l6bIblrsYFp0Wb heOddwQufy7Xp/TT6RkaBKu4qZWKsFuYkBF0TV4cKcauKw0EAcCBpAhsxiXjywPRdGnx b5jyfFXOHeLJiHXosbTwrl//6KD/2cS6INWQrpO3oEFb9q2dB7hT1j8qpl5o2D95hBb4 QPKwgJnbpP99oWzmK8cnu9tvwX5CnWNsccLLlBjUgkEGpFcea2/sM9sm/+XMzrAGNgpg jFIcBiNT9KTE3/62PGmxeGxql2PH1tpxJjpKHAZ01oX9WdblQemRcX7o8rSRCVMz9Zbb 4P1w== X-Gm-Message-State: AOAM5330Qf7/tohAOTRLQuzqsGoW99PNti8KnKXF5ztiBecNDt7uf1no wgx7zIxWZZO4DDgUdd8YofQoly2NySEeXCM3gJsUig== X-Google-Smtp-Source: ABdhPJwMwO0kS+RyMpvWY9xALIYh3+Sn874NDIe4svZvS3EKXW8DVEhl5ZXRmycrSDiCqsEe9Ppj4KrT0cF9A3qfwN4= X-Received: by 2002:ac8:47c8:: with SMTP id d8mr5073129qtr.32.1598700882798; Sat, 29 Aug 2020 04:34:42 -0700 (PDT) MIME-Version: 1.0 References: <202008290430.07T4UCM4007928@repo.freebsd.org> <213fcb81-ceab-677f-98dc-e8cb33fef7d1@gmail.com> In-Reply-To: <213fcb81-ceab-677f-98dc-e8cb33fef7d1@gmail.com> From: Warner Losh Date: Sat, 29 Aug 2020 05:34:31 -0600 Message-ID: Subject: Re: svn commit: r364946 - head/sys/kern To: meloun.michal@gmail.com Cc: Mateusz Guzik , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BdvWl6VNZz4LVX X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=mK03SkZs; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::843) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.57 / 15.00]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.78)[-0.780]; NEURAL_HAM_LONG(-0.97)[-0.967]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.82)[-0.825]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::843:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 11:34:44 -0000 On Sat, Aug 29, 2020 at 5:25 AM Michal Meloun wrote: > > > On 29.08.2020 13:02, Warner Losh wrote: > > On Sat, Aug 29, 2020 at 4:38 AM Michal Meloun > > wrote: > > > >> > >> > >> On 29.08.2020 12:04, Warner Losh wrote: > >>> On Sat, Aug 29, 2020 at 1:09 AM Mateusz Guzik > wrote: > >>> > >>>> This crashes on boot for me: > >>>> > >>> > >>> I wasn't able to get it to crash on boot for me, but I was able to > >> recreate > >>> it. > >> It crashed on ofw based systems where some enumerated devices have not a > >> suitable driver, see: > >> --------------------------------------- > >> sysctl_devices: nameunit: root0, descs: System root bus, driver: root > >> sysctl_devices: nameunit: nexus0, descs: (null), driver: nexus > >> sysctl_devices: nameunit: ofwbus0, descs: Open Firmware Device Tree, > >> driver: ofwbus > >> sysctl_devices: nameunit: pcib0, descs: Nvidia Integrated PCI/PCI-E > >> Controller, driver: pcib > >> sysctl_devices: nameunit: simplebus0, descs: Flattened device tree > >> simple bus, driver: simplebus > >> sysctl_devices: nameunit: gic0, descs: ARM Generic Interrupt Controller, > >> driver: gic > >> sysctl_devices: nameunit: (null), descs: (null), driver: > >> sysctl_devices: nameunit: lic0, descs: (null), driver: lic > >> sysctl_devices: nameunit: (null), descs: (null), driver: > >> sysctl_devices: nameunit: car0, descs: Tegra Clock Driver, driver: car > >> .... > >> ---------------------------------------------------------------------- > >>> Fixed in r364949.Confirmed. > >> I think it didn't crash on boot for me because > >>> kldxref failed due to the segment thing so devmatch didn't run which > >> would > >>> have triggered this bug. devinfo did trigger a very similar crash, and > >>> r364949 fixes that crash. Even a new kldxref failed due to the too many > >>> segments thing, so I can't confirm that's what you hit, but I'm pretty > >> sure > >>> it is... > >>> > >> But there is another issue in device_sysctl_handler() (not analyzed > yet): > >> root@tegra210:~ # sysctl dev.cpu. > >> dev.cpu.3.temperature: 50.5C > >> dev.cpu.3panic: sbuf_clear makes no sense on sbuf 0xffff00006f21a528 > >> with drain > >> cpuid = 2 > >> time = 1598696937 > >> KDB: stack backtrace: > >> db_trace_self() at db_fetch_ksymtab+0x164 > >> pc = 0xffff0000006787f4 lr = 0xffff000000153400 > >> sp = 0xffff00006f21a1b0 fp = 0xffff00006f21a3b0 > >> > >> db_fetch_ksymtab() at vpanic+0x198 > >> pc = 0xffff000000153400 lr = 0xffff00000036b274 > >> sp = 0xffff00006f21a3c0 fp = 0xffff00006f21a420 > >> > >> vpanic() at panic+0x44 > >> pc = 0xffff00000036b274 lr = 0xffff00000036b018 > >> sp = 0xffff00006f21a430 fp = 0xffff00006f21a4e0 > >> > >> panic() at sbuf_clear+0xa0 > >> pc = 0xffff00000036b018 lr = 0xffff0000003c17c8 > >> sp = 0xffff00006f21a4f0 fp = 0xffff00006f21a4f0 > >> > >> sbuf_clear() at sbuf_cpy+0x58 > >> pc = 0xffff0000003c17c8 lr = 0xffff0000003c1ff0 > >> sp = 0xffff00006f21a500 fp = 0xffff00006f21a500 > >> > >> sbuf_cpy() at _gone_in_dev+0x560 > >> pc = 0xffff0000003c1ff0 lr = 0xffff0000003a9078 > >> sp = 0xffff00006f21a510 fp = 0xffff00006f21a570 > >> > >> _gone_in_dev() at sbuf_new_for_sysctl+0x170 > >> pc = 0xffff0000003a9078 lr = 0xffff00000037c1a8 > >> sp = 0xffff00006f21a580 fp = 0xffff00006f21a5a0 > >> > >> sbuf_new_for_sysctl() at kernel_sysctl+0x36c > >> pc = 0xffff00000037c1a8 lr = 0xffff00000037b63c > >> sp = 0xffff00006f21a5b0 fp = 0xffff00006f21a630 > >> > > > > This traceback is all kinds of crazy. sbuf_new_for_sysctl doesn't call > > _gone_in_dev(), which doesn't do sbuf stuff at all. And neither does it > > call sbuf_cpy(). Though I get a crash that looks like: > > Tracing pid 66442 tid 101464 td 0xfffffe02f47b7c00 > > kdb_enter() at kdb_enter+0x37/frame 0xfffffe02f4ae3740 > > vpanic() at vpanic+0x19e/frame 0xfffffe02f4ae3790 > > panic() at panic+0x43/frame 0xfffffe02f4ae37f0 > > sbuf_clear() at sbuf_clear+0xac/frame 0xfffffe02f4ae3800 > > sbuf_cpy() at sbuf_cpy+0x5a/frame 0xfffffe02f4ae3820 > > device_sysctl_handler() at device_sysctl_handler+0x133/frame > > 0xfffffe02f4ae38a0 > > sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame > > 0xfffffe02f4ae38f0 > > sysctl_root() at sysctl_root+0x20a/frame 0xfffffe02f4ae3970 > > userland_sysctl() at userland_sysctl+0x17d/frame 0xfffffe02f4ae3a20 > > sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe02f4ae3ad0 > > amd64_syscall() at amd64_syscall+0x140/frame 0xfffffe02f4ae3bf0 > > fast_syscall_common() at fast_syscall_common+0xf8/frame > 0xfffffe02f4ae3bf0 > > --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80042d50a, rsp = > > 0x7fffffffd458, rbp = 0x7fffffffd490 --- > > > > on a sysctl -a which I think makes more sense... I'll see if I can track > > it down... I think it's because sbuf_cpy does an unconditional clear, > which > > triggers this assert, which is likely bogus for this case. sbuf_cat > doesn't > > seem to have this issue... I'll confirm and commit. > > > > Warner > > Yeah, sorry. Local symbols are not available for netbooted kernel :(. > And i csan confirm that problem is cause by using sbuf_cpy() on sbuf > allocated by sbuf_new_for_sysctl() (thus with drain handler) in > device_sysctl_handler(). But pure replacing sbuf_cpy() by sbuf_cat() > gives me another panic: > panic: Assertion (sb->s_flags & SBUF_INCLUDENUL) == 0 failed at > /usr2/Meloun/git/pmap/sys/kern/subr_bus.c:4936 > (still as respose for sysctl dev.cpu) > OK. My bouncer system here has something wrong with /, but I changed the sbuf_cpy to sbuf_cat. Can you confirm that it works for you? Warner > > > > > >> kernel_sysctl() at userland_sysctl+0xf4 > >> pc = 0xffff00000037b63c lr = 0xffff00000037bc5c > >> sp = 0xffff00006f21a640 fp = 0xffff00006f21a6d0 > >> > >> userland_sysctl() at sys___sysctl+0x68 > >> pc = 0xffff00000037bc5c lr = 0xffff00000037bb28 > >> sp = 0xffff00006f21a6e0 fp = 0xffff00006f21a790 > >> > >> sys___sysctl() at do_el0_sync+0x4e0 > >> pc = 0xffff00000037bb28 lr = 0xffff000000697918 > >> sp = 0xffff00006f21a7a0 fp = 0xffff00006f21a830 > >> > >> do_el0_sync() at handle_el0_sync+0x90 > >> pc = 0xffff000000697918 lr = 0xffff00000067aa24 > >> sp = 0xffff00006f21a840 fp = 0xffff00006f21a980 > >> > >> handle_el0_sync() at 0x4047764c > >> pc = 0xffff00000067aa24 lr = 0x000000004047764c > >> sp = 0xffff00006f21a990 fp = 0x0000ffffffffc250 > >> > >> KDB: enter: panic > >> [ thread pid 1263 tid 100092 ] > >> Stopped at 0x40477fb4: undefined 54000042 > >> > >>> Warner > >>> > >> > >>> > >>>> atal trap 12: page fault while in kernel mode > >>>> cpuid = 0; apic id = 00 > >>>> fault virtual address = 0x0 > >>>> fault code = supervisor read data, page not present > >>>> instruction pointer = 0x20:0xffffffff805b0a7f > >>>> stack pointer = 0x28:0xfffffe002366a7f0 > >>>> frame pointer = 0x28:0xfffffe002366a7f0 > >>>> code segment = base 0x0, limit 0xfffff, type 0x1b > >>>> = DPL 0, pres 1, long 1, def32 0, gran 1 > >>>> processor eflags = interrupt enabled, resume, IOPL = 0 > >>>> current process = 89 (devmatch) > >>>> trap number = 12 > >>>> panic: page fault > >>>> cpuid = 0 > >>>> time = 1598692135 > >>>> KDB: stack backtrace: > >>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >>>> 0xfffffe002366a4a0 > >>>> vpanic() at vpanic+0x182/frame 0xfffffe002366a4f0 > >>>> panic() at panic+0x43/frame 0xfffffe002366a550 > >>>> trap_fatal() at trap_fatal+0x387/frame 0xfffffe002366a5b0 > >>>> trap_pfault() at trap_pfault+0x4f/frame 0xfffffe002366a610 > >>>> trap() at trap+0x27d/frame 0xfffffe002366a720 > >>>> calltrap() at calltrap+0x8/frame 0xfffffe002366a720 > >>>> --- trap 0xc, rip = 0xffffffff805b0a7f, rsp = 0xfffffe002366a7f0, rbp > >>>> = 0xfffffe002366a7f0 --- > >>>> strlen() at strlen+0x1f/frame 0xfffffe002366a7f0 > >>>> sbuf_cat() at sbuf_cat+0x15/frame 0xfffffe002366a810 > >>>> sysctl_devices() at sysctl_devices+0x104/frame 0xfffffe002366a8a0 > >>>> sysctl_root_handler_locked() at sysctl_root_handler_locked+0x91/frame > >>>> 0xfffffe002366a8f0 > >>>> sysctl_root() at sysctl_root+0x249/frame 0xfffffe002366a970 > >>>> userland_sysctl() at userland_sysctl+0x170/frame 0xfffffe002366aa20 > >>>> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe002366aad0 > >>>> amd64_syscall() at amd64_syscall+0x10c/frame 0xfffffe002366abf0 > >>>> fast_syscall_common() at fast_syscall_common+0xf8/frame > >> 0xfffffe002366abf0 > >>>> --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041c0ea, rsp > >>>> = 0x7fffffffda78, rbp = 0x7fffffffdab0 --- > >>>> KDB: enter: panic > >>>> [ thread pid 89 tid 100067 ] > >>>> Stopped at kdb_enter+0x37: movq $0,0x7e2616(%rip) > >>>> > >>>> > >>>> On 8/29/20, Warner Losh wrote: > >>>>> Author: imp > >>>>> Date: Sat Aug 29 04:30:12 2020 > >>>>> New Revision: 364946 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/364946 > >>>>> > >>>>> Log: > >>>>> Move to using sbuf for some sysctl in newbus > >>>>> > >>>>> Convert two different sysctl to using sbuf. First, for all the > >> default > >>>>> sysctls we implement for each device driver that's attached. This > is > >> a > >>>>> pure sbuf conversion. > >>>>> > >>>>> Second, convert sysctl_devices to fill its buffer with sbuf rather > >>>>> than a hand-rolled crappy thing I wrote years ago. > >>>>> > >>>>> Reviewed by: cem, markj > >>>>> Differential Revision: https://reviews.freebsd.org/D26206 > >>>>> > >>>>> Modified: > >>>>> head/sys/kern/subr_bus.c > >>>>> > >>>>> Modified: head/sys/kern/subr_bus.c > >>>>> > >>>> > >> > ============================================================================== > >>>>> --- head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 > (r364945) > >>>>> +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:12 2020 > (r364946) > >>>>> @@ -260,36 +260,33 @@ enum { > >>>>> static int > >>>>> device_sysctl_handler(SYSCTL_HANDLER_ARGS) > >>>>> { > >>>>> + struct sbuf sb; > >>>>> device_t dev = (device_t)arg1; > >>>>> - const char *value; > >>>>> - char *buf; > >>>>> int error; > >>>>> > >>>>> - buf = NULL; > >>>>> + sbuf_new_for_sysctl(&sb, NULL, 1024, req); > >>>>> switch (arg2) { > >>>>> case DEVICE_SYSCTL_DESC: > >>>>> - value = dev->desc ? dev->desc : ""; > >>>>> + sbuf_cpy(&sb, dev->desc ? dev->desc : ""); > >>>>> break; > >>>>> case DEVICE_SYSCTL_DRIVER: > >>>>> - value = dev->driver ? dev->driver->name : ""; > >>>>> + sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); > >>>>> break; > >>>>> case DEVICE_SYSCTL_LOCATION: > >>>>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > >>>>> - bus_child_location_str(dev, buf, 1024); > >>>>> + bus_child_location_sb(dev, &sb); > >>>>> break; > >>>>> case DEVICE_SYSCTL_PNPINFO: > >>>>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > >>>>> - bus_child_pnpinfo_str(dev, buf, 1024); > >>>>> + bus_child_pnpinfo_sb(dev, &sb); > >>>>> break; > >>>>> case DEVICE_SYSCTL_PARENT: > >>>>> - value = dev->parent ? dev->parent->nameunit : ""; > >>>>> + sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : > ""); > >>>>> break; > >>>>> default: > >>>>> + sbuf_delete(&sb); > >>>>> return (EINVAL); > >>>>> } > >>>>> - error = SYSCTL_OUT_STR(req, value); > >>>>> - if (buf != NULL) > >>>>> - free(buf, M_BUS); > >>>>> + error = sbuf_finish(&sb); > >>>>> + sbuf_delete(&sb); > >>>>> return (error); > >>>>> } > >>>>> > >>>>> @@ -5464,13 +5461,13 @@ SYSCTL_PROC(_hw_bus, OID_AUTO, info, > >>>> CTLTYPE_STRUCT > >>>>> | > >>>>> static int > >>>>> sysctl_devices(SYSCTL_HANDLER_ARGS) > >>>>> { > >>>>> + struct sbuf sb; > >>>>> int *name = (int *)arg1; > >>>>> u_int namelen = arg2; > >>>>> int index; > >>>>> device_t dev; > >>>>> struct u_device *udev; > >>>>> int error; > >>>>> - char *walker, *ep; > >>>>> > >>>>> if (namelen != 2) > >>>>> return (EINVAL); > >>>>> @@ -5501,34 +5498,21 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) > >>>>> udev->dv_devflags = dev->devflags; > >>>>> udev->dv_flags = dev->flags; > >>>>> udev->dv_state = dev->state; > >>>>> - walker = udev->dv_fields; > >>>>> - ep = walker + sizeof(udev->dv_fields); > >>>>> -#define CP(src) \ > >>>>> - if ((src) == NULL) \ > >>>>> - *walker++ = '\0'; \ > >>>>> - else { \ > >>>>> - strlcpy(walker, (src), ep - walker); \ > >>>>> - walker += strlen(walker) + 1; \ > >>>>> - } \ > >>>>> - if (walker >= ep) \ > >>>>> - break; > >>>>> - > >>>>> - do { > >>>>> - CP(dev->nameunit); > >>>>> - CP(dev->desc); > >>>>> - CP(dev->driver != NULL ? dev->driver->name : NULL); > >>>>> - bus_child_pnpinfo_str(dev, walker, ep - walker); > >>>>> - walker += strlen(walker) + 1; > >>>>> - if (walker >= ep) > >>>>> - break; > >>>>> - bus_child_location_str(dev, walker, ep - walker); > >>>>> - walker += strlen(walker) + 1; > >>>>> - if (walker >= ep) > >>>>> - break; > >>>>> - *walker++ = '\0'; > >>>>> - } while (0); > >>>>> -#undef CP > >>>>> - error = SYSCTL_OUT(req, udev, sizeof(*udev)); > >>>>> + sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), > >>>> SBUF_FIXEDLEN); > >>>>> + sbuf_cat(&sb, dev->nameunit); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + sbuf_cat(&sb, dev->desc); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + bus_child_pnpinfo_sb(dev, &sb); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + bus_child_location_sb(dev, &sb); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + error = sbuf_finish(&sb); > >>>>> + if (error == 0) > >>>>> + error = SYSCTL_OUT(req, udev, sizeof(*udev)); > >>>>> + sbuf_delete(&sb); > >>>>> free(udev, M_BUS); > >>>>> return (error); > >>>>> } > >>>>> > >>>> > >>>> > >>>> -- > >>>> Mateusz Guzik > >>>> > >>> > >> > > >