From owner-freebsd-bugs@freebsd.org Thu Oct 13 21:58:28 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DF79C10203 for ; Thu, 13 Oct 2016 21:58:28 +0000 (UTC) (envelope-from lew@perftech.com) Received: from smtp-gw.pt.net (smtp-gw.pt.net [206.210.194.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp-gw.pt.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7E4EBA5 for ; Thu, 13 Oct 2016 21:58:27 +0000 (UTC) (envelope-from lew@perftech.com) X-ASG-Debug-ID: 1476394749-09411a4d54b4ca0001-Wc1sAr Received: from mail.pt.net (mail.pt.net [206.210.194.11]) by smtp-gw.pt.net with ESMTP id PNHxe4kcldwK95XW (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 13 Oct 2016 16:39:09 -0500 (CDT) X-Barracuda-Envelope-From: lew@perftech.com X-Barracuda-Effective-Source-IP: mail.pt.net[206.210.194.11] X-Barracuda-Apparent-Source-IP: 206.210.194.11 Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id 8488A842635 for ; Thu, 13 Oct 2016 16:39:09 -0500 (CDT) Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id Td3G6UxO0d8r for ; Thu, 13 Oct 2016 16:39:09 -0500 (CDT) Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id 5D4518426AC for ; Thu, 13 Oct 2016 16:39:09 -0500 (CDT) X-Virus-Scanned: amavisd-new at pt.net Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id j6Sf9F8t-Xul for ; Thu, 13 Oct 2016 16:39:09 -0500 (CDT) Received: from dhcp-221-110.perftech.com (dhcp-221-110.perftech.com [206.210.221.110]) (Authenticated sender: lew@pt.net) by mail.pt.net (Postfix) with ESMTPSA id 4F333842635 for ; Thu, 13 Oct 2016 16:39:09 -0500 (CDT) From: Lewis Donzis Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: SM bus ioctls incorrect in FreeBSD 11 Message-Id: <06929AC5-D350-4236-A813-56C862B58174@perftech.com> X-ASG-Orig-Subj: SM bus ioctls incorrect in FreeBSD 11 Date: Thu, 13 Oct 2016 16:39:06 -0500 To: freebsd-bugs@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-Barracuda-Connect: mail.pt.net[206.210.194.11] X-Barracuda-Start-Time: 1476394749 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://smtp-gw.pt.net:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 697 X-Virus-Scanned: by bsmtpd at pt.net X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33691 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 21:58:28 -0000 After upgrading to FreeBSD 11.0 and changing source code to use the new = version of =E2=80=9Cstruct smbcmd=E2=80=9D, some commands are not = working as documented, specifically those that read data. As an example, SMB_READW is documented as returning the word read from = the device in rdata.word. However, this doesn=E2=80=99t happen, I think = because the ioctl request value is defined using _IOW(), so the kernel = doesn=E2=80=99t copy the data it read back out. In prior versions, the structure had only a pointer to the data, and the = smb.c code used copyout() to transfer the data back to userland. As a temporary work-around, we added code to set rbuf to point to = rdata.word and rcount to two. Thanks, lew