Summary: | Inappropriate ioctl for /dev/cd0 after upgrade 13.0 -> 13.1 | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | amahling <andreas.mahling> | ||||
Component: | kern | Assignee: | Alexander Motin <mav> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | emaste, markj, martymac, mav, mgrooms, pi | ||||
Priority: | --- | Keywords: | regression | ||||
Version: | 13.1-RELEASE | Flags: | markj:
mfc-stable13+
|
||||
Hardware: | amd64 | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
amahling
2022-06-16 08:10:38 UTC
Can you show the output of running freac under truss(1)? Do any relevant messages appear in the dmesg after an error? Created attachment 234852 [details]
truss output for freac
There is no dmesg output related to freac
I suppose, the relevant truss output lines are
fstatat(AT_FDCWD,"/dev/cd0",{ mode=crw-rw---- ,inode=108,size=0,blksize=4096 },0
x0) = 0 (0x0)
readlink("/dev/cd0",0x7fffffffbd80,255) ERR#22 'Invalid argument'
fstatat(AT_FDCWD,"/dev/cd0",{ mode=crw-rw---- ,inode=108,size=0,blksize=4096 },0
x0) = 0 (0x0)
nanosleep({ 0.100000000 }) = 0 (0x0)
openat(AT_FDCWD,"/dev/cd0",O_RDONLY,00) = 11 (0xb)
ioctl(11,CDIOCALLOW,0x0) = 0 (0x0)
ioctl(11,0xc4e01903 { IORW 0x19('?'), 3, 1248 },0x805156608) ERR#25 'Inappropria
te ioctl for device'
fstat(1,{ mode=p--------- ,inode=5190,size=0,blksize=4096 }) = 0 (0x0)
++ WARN: open: Inappropriate ioctl for device
write(1,"++ WARN: open: Inappropriate ioc"...,46) = 46 (0x2e)
close(11) = 0 (0x0)
complete truss output attached
It doesn't matter whether a cd is inserted or not, the error is always thrown.
0xc4e01903 { IORW 0x19('?'), 3, 1248 } is CAMGETPASSTHRU. In commit 7d7168478380f08b3a7fd58ca7cf83182fae6850 CAM_VERSION was bumped (0x19->0x1a), changing the ioctl identity. The commit added some compat shims, but it seems cam_periph_ioctl() doesn't use them, so compatibility is indeed broken for various periph drivers. Same issue here ... mgrooms@desktop:~ $ freac Property "/Xft/DPI" does not exist on channel "xsettings". ++ WARN: open: Inappropriate ioctl for device mgrooms@desktop:~ $ freebsd-version 13.1-RELEASE-p1 Is there anything that can be done as an end user to work around this issue? Can this bug be assigned to the CAM group or to Alexander Motin so that it gets the attention of a CAM developer? Hi Mark. Thanks for creating a patch and posting it in phabricator for review ... https://reviews.freebsd.org/D36389 Unfortunately I'm out for the country for the next 5 weeks so I won't have access to my optical drive until I return. Maybe the original bug reporter can test this out with freac and verify the problem is resolved. Assuming your patch resolves the issue, will this fix eventually show up in a 13.1 patch level release distributed via Freebsd-update? Thanks again for your help. I've applied the patch to the 13.1 source and can happily report, that the issue is fixed :) Thank you very much. I hope the patch will arrive in 13.1-p3? (In reply to amahling from comment #7) Thanks for testing. Yes, I can ask for an erratum notice, so it'll arrive in some 13.1-pN patch. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd631ee0693dd7337c38b251044e018aad6fbaf commit 0cd631ee0693dd7337c38b251044e018aad6fbaf Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-09-29 17:07:52 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-09-29 17:14:57 +0000 cam: Provide compatibility for CAMGETPASSTHRU for periph drivers The CAM version bump 0x19 -> 0x1a changed the CAMGETPASSTHRU definition, so applications using the old ioctl are broken. However, that version change did not affect anything relating to the ioctl implementation for periphs. Fixes: 8f9be1eed11c ("cam(4): Improve XPT_DEV_MATCH") PR: 264709 Tested by: andreas.mahling@googlemail.com Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D36389 sys/cam/cam_periph.c | 2 ++ 1 file changed, 2 insertions(+) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=16d4c1de7b40f1cc0d323b9ecc5a38afb7a42f8a commit 16d4c1de7b40f1cc0d323b9ecc5a38afb7a42f8a Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-09-29 17:07:52 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-10-13 00:44:16 +0000 cam: Provide compatibility for CAMGETPASSTHRU for periph drivers The CAM version bump 0x19 -> 0x1a changed the CAMGETPASSTHRU definition, so applications using the old ioctl are broken. However, that version change did not affect anything relating to the ioctl implementation for periphs. Fixes: 8f9be1eed11c ("cam(4): Improve XPT_DEV_MATCH") PR: 264709 Tested by: andreas.mahling@googlemail.com Reviewed by: imp (cherry picked from commit 0cd631ee0693dd7337c38b251044e018aad6fbaf) sys/cam/cam_periph.c | 2 ++ 1 file changed, 2 insertions(+) (In reply to Mark Johnston from comment #8) Hello Mark, I would be nice to have an erratum notice indeed. Have you got news on that point ? Best regards, Ganael. (In reply to Ganael LAPLANCHE from comment #11) I've staged this patch for the next round of EN/SAs. I don't know when they will be released, hopefully in the next couple of weeks. (In reply to Mark Johnston from comment #12) Perfect, thanks! A commit in branch releng/13.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=fff5c5fe911e7067390e6ff73c4c58489a30c849 commit fff5c5fe911e7067390e6ff73c4c58489a30c849 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-09-29 17:07:52 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-11-01 13:28:11 +0000 cam: Provide compatibility for CAMGETPASSTHRU for periph drivers The CAM version bump 0x19 -> 0x1a changed the CAMGETPASSTHRU definition, so applications using the old ioctl are broken. However, that version change did not affect anything relating to the ioctl implementation for periphs. Approved by: so Security: FreeBSD-EN-22:26.cam Fixes: 8f9be1eed11c ("cam(4): Improve XPT_DEV_MATCH") PR: 264709 Tested by: andreas.mahling@googlemail.com Reviewed by: imp (cherry picked from commit 0cd631ee0693dd7337c38b251044e018aad6fbaf) (cherry picked from commit 16d4c1de7b40f1cc0d323b9ecc5a38afb7a42f8a) sys/cam/cam_periph.c | 2 ++ 1 file changed, 2 insertions(+) |