From: David Miller <davem@davemloft.net>
To: linux-kernel@vger.kernel.org
Cc: adobriyan@sw.ru
Subject: /proc/bus/pci IOCTL breakage
Date: Thu, 26 Jul 2007 19:07:51 -0700 (PDT) [thread overview]
Message-ID: <20070726.190751.66179795.davem@davemloft.net> (raw)
This change:
commit 786d7e1612f0b0adb6046f19b906609e4fe8b1ba
Author: Alexey Dobriyan <adobriyan@sw.ru>
Date: Sun Jul 15 23:39:00 2007 -0700
Fix rmmod/read/write races in /proc entries
Broke ioctl() on /proc/bus/pci/* files for COMPAT platforms.
proc_fops->ioctl() is defined for these PCI device files, and the
COMPAT ioctl is handled via fs/compat_ioctl.c's entries, which makes
it just call the ->ioctl() handler directly.
proc_fops->compat_ioctl is NULL for these files, it isn't needed.
This used to work because we used to jump right to the de->proc_fops,
but now we have these wrappers and proc_reg_compat_ioctl is what
gets called and since proc_fops->compat_ioctl is NULL we return
ENOTTY instead of calling proc_fops->ioctl().
Two ways to fix:
1) Make the PROC wrapper call ->unlocked_ioctl() or ->ioctl()
as a fallback of ->compat_ioctl is NULL.
2) Make proc_bus_pci_operations provide a .compat_ioctl method,
but then we'll need to audit the entire tree for cases like
this and make the same fix.
Because it's easier to validate that all cases are covered,
I think #1 is the preferred fix.
next reply other threads:[~2007-07-27 2:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-27 2:07 David Miller [this message]
2007-07-27 6:04 ` /proc/bus/pci IOCTL breakage David Miller
2007-07-27 9:25 ` Alexey Dobriyan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070726.190751.66179795.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=adobriyan@sw.ru \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox