1. 29 12月, 2010 1 次提交
  2. 17 12月, 2010 1 次提交
  3. 18 11月, 2010 1 次提交
  4. 19 10月, 2010 1 次提交
    • A
      fix rawctl compat ioctls breakage on amd64 and itanic · c4a04727
      Al Viro 提交于
      RAW_SETBIND and RAW_GETBIND 32bit versions are fscked in interesting ways.
      
      1) fs/compat_ioctl.c has COMPATIBLE_IOCTL(RAW_SETBIND) followed by
      HANDLE_IOCTL(RAW_SETBIND, raw_ioctl).  The latter is ignored.
      
      2) on amd64 (and itanic) the damn thing is broken - we have int + u64 + u64
      and layouts on i386 and amd64 are _not_ the same.  raw_ioctl() would
      work there, but it's never called due to (1).  As it is, i386 /sbin/raw
      definitely doesn't work on amd64 boxen.
      
      3) switching to raw_ioctl() as is would *not* work on e.g. sparc64 and ppc64,
      which would be rather sad, seeing that normal userland there is 32bit.
      The thing is, slapping __packed on the struct in question does not DTRT -
      it eliminates *all* padding.  The real solution is to use compat_u64.
      
      4) of course, all that stuff has no business being outside of raw.c in the
      first place - there should be ->compat_ioctl() for /dev/rawctl instead of
      messing with compat_ioctl.c.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [arnd@arndb.de: port to 2.6.36]
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      c4a04727
  5. 06 10月, 2010 1 次提交
  6. 14 8月, 2010 1 次提交
  7. 11 8月, 2010 1 次提交
    • H
      tty: Add EXTPROC support for LINEMODE · 26df6d13
      hyc@symas.com 提交于
      This patch is against the 2.6.34 source.
      
      Paraphrased from the 1989 BSD patch by David Borman @ cray.com:
      
           These are the changes needed for the kernel to support
           LINEMODE in the server.
      
           There is a new bit in the termios local flag word, EXTPROC.
           When this bit is set, several aspects of the terminal driver
           are disabled.  Input line editing, character echo, and mapping
           of signals are all disabled.  This allows the telnetd to turn
           off these functions when in linemode, but still keep track of
           what state the user wants the terminal to be in.
      
           New ioctl:
               TIOCSIG         Generate a signal to processes in the
                               current process group of the pty.
      
           There is a new mode for packet driver, the TIOCPKT_IOCTL bit.
           When packet mode is turned on in the pty, and the EXTPROC bit
           is set, then whenever the state of the pty is changed, the
           next read on the master side of the pty will have the TIOCPKT_IOCTL
           bit set.  This allows the process on the server side of the pty
           to know when the state of the terminal has changed; it can then
           issue the appropriate ioctl to retrieve the new state.
      
      Since the original BSD patches accompanied the source code for telnet
      I've left that reference here, but obviously the feature is useful for
      any remote terminal protocol, including ssh.
      
      The corresponding feature has existed in the BSD tty driver since 1989.
      For historical reference, a good copy of the relevant files can be found
      here:
      
      http://anonsvn.mit.edu/viewvc/krb5/trunk/src/appl/telnet/?pathrev=17741Signed-off-by: NHoward Chu <hyc@symas.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      26df6d13
  8. 09 8月, 2010 1 次提交
  9. 22 7月, 2010 3 次提交
  10. 19 7月, 2010 1 次提交
  11. 29 4月, 2010 1 次提交
  12. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  13. 07 3月, 2010 1 次提交
  14. 12 2月, 2010 1 次提交
  15. 10 2月, 2010 1 次提交
  16. 09 2月, 2010 1 次提交
  17. 21 1月, 2010 1 次提交
    • A
      compat_ioctl: Supress "unknown cmd" message on serial /dev/console · 3f001711
      Atsushi Nemoto 提交于
      After the commit fb07a5f8 ("compat_ioctl: remove all VT ioctl
      handling"), I got this error message on 64-bit mips kernel with 32-bit
      busybox userland:
      
      ioctl32(init:1): Unknown cmd fd(0) cmd(00005600){t:'V';sz:0} arg(7fd76480) on /dev/console
      
      The cmd 5600 is VT_OPENQRY.  The busybox's init issues this ioctl to
      know vt-console or serial-console.  If the console was serial console,
      VT ioctls are not handled by the serial driver.
      
      And by quick search, I found some programs using VT_GETMODE to check
      vt-console is available or not.
      Signed-off-by: NAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3f001711
  18. 23 12月, 2009 1 次提交
  19. 14 12月, 2009 1 次提交
  20. 11 12月, 2009 8 次提交
    • A
      usbdevfs: move compat_ioctl handling to devio.c · 637e8a60
      Arnd Bergmann 提交于
      Half the compat_ioctl handling is in devio.c, the other
      half is in fs/compat_ioctl.c. This moves everything into
      one place for consistency.
      
      As a positive side-effect, push down the BKL into the
      ioctl methods.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: Alon Bar-Lev <alon.barlev@gmail.com>
      Cc: David Vrabel <david.vrabel@csr.com>
      Cc: linux-usb@vger.kernel.org
      637e8a60
    • A
      lp: move compat_ioctl handling into lp.c · 3695669c
      Arnd Bergmann 提交于
      Handling for LPSETTIMEOUT can easily be done in lp_ioctl, which
      is the only user. As a positive side-effect, push the BKL
      into the ioctl methods.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3695669c
    • A
      compat_ioctl: pass compat pointer directly to handlers · 43c6e7b9
      Arnd Bergmann 提交于
      Instead of having each handler call compat_ptr, we can now
      convert the pointer once and pass that to each handler.
      This saves a little bit of both source and object code size.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      43c6e7b9
    • A
      compat_ioctl: simplify lookup table · 661f627d
      Arnd Bergmann 提交于
      The compat_ioctl table now only contains entries for
      COMPATIBLE_IOCTL, so we only need to know if a number
      is listed in it or now.
      
      As an optimization, we hash the table entries with a
      reversible transformation to get a more uniform distribution
      over it, sort the table at startup and then guess the
      position in the table when an ioctl number gets called
      to do a linear search from there.
      
      With the current set of ioctl numbers and the chosen
      transformation function, we need an average of four
      steps to find if a number is in the set, all of the
      accesses within one or two cache lines.
      
      This at least as good as the previous hash table
      approach but saves 8.5 kb of kernel memory.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      661f627d
    • A
      compat_ioctl: simplify calling of handlers · 789f0f89
      Arnd Bergmann 提交于
      The compat_ioctl array now contains only entries for ioctl numbers
      that do not require a separate handler. By special-casing the
      ULONG_IOCTL case in the do_ioctl_trans function, we can kill the
      final use of a function pointer in the array.
      
         text    data     bss     dec     hex filename
         7539   13352    2080   22971    59bb before/fs/compat_ioctl.o
         7910    8552    2080   18542    486e after/fs/compat_ioctl.o
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      789f0f89
    • A
      compat_ioctl: inline all conversion handlers · 5a07ea0b
      Arnd Bergmann 提交于
      This makes all ioctl conversion handlers called from
      a single switch statement, leaving only COMPATIBLE_IOCTL
      and ULONG_IOCTL statements in the table. This is somewhat
      more space efficient and also lets us simplify the
      handling of the lookup table significantly.
      
      before:
         text    data     bss     dec     hex filename
         7619   14024    2080   23723    5cab obj/fs/compat_ioctl.o
      after:
         7567   13352    2080   22999    59d7 obj/fs/compat_ioctl.o
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      5a07ea0b
    • A
      compat_ioctl: Remove BKL · 348c4b90
      Arnd Bergmann 提交于
      We have always called ioctl conversion handlers under the big kernel lock,
      although that is generally not necessary.  In particular it is not needed
      for conversion of data structures and for calling sys_ioctl or
      do_vfs_ioctl, which will get the BKL again if needed.
      
      Handlers doing more than those two have been moved out, so we can kill off
      the BKL from compat_sys_ioctl.  This may significantly improve latencies
      with 32 bit applications, and it avoids a common scenario where a thread
      acquires the BKL twice.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      348c4b90
    • A
      compat_ioctl: remove all VT ioctl handling · fb07a5f8
      Arnd Bergmann 提交于
      The VT driver now handles all of these ioctls directly, so we can remove
      the handlers from common code.
      
      These are the only handlers that require the BKL because they directly
      perform the ioctl action rather than just converting the data structures.
      Once they are gone, we can remove the BKL from the remaining ioctl
      conversion handlers.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      fb07a5f8
  21. 05 12月, 2009 1 次提交
  22. 12 11月, 2009 1 次提交
  23. 07 11月, 2009 4 次提交
    • A
      compat: move sockios handling to net/socket.c · 6b96018b
      Arnd Bergmann 提交于
      This removes the original socket compat_ioctl code
      from fs/compat_ioctl.c and converts the code from the copy
      in net/socket.c into a single function. We add a few cycles
      of runtime to compat_sock_ioctl() with the long switch()
      statement, but gain some cycles in return by simplifying
      the call chain to get there.
      
      Due to better inlining, save 1.5kb of object size in the
      process, and enable further savings:
      
      before:
         text    data     bss     dec     hex filename
        13540   18008    2080   33628    835c obj/fs/compat_ioctl.o
        14565     636      40   15241    3b89 obj/net/socket.o
      
      after:
         text    data     bss     dec     hex filename
         8916   15176    2080   26172    663c obj/fs/compat_ioctl.o
        20725     636      40   21401    5399 obj/net/socket.o
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b96018b
    • A
      appletalk: handle SIOCATALKDIFADDR compat ioctl · 20660221
      Arnd Bergmann 提交于
      We must not have a compat ioctl handler for SIOCATALKDIFADDR
      in common code, because the same number is used in other protocols
      with different data structures.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      20660221
    • A
      net, compat_ioctl: handle socket ioctl abuses in tty drivers · 9646e7ce
      Arnd Bergmann 提交于
      Slip and a few other drivers use the same ioctl numbers on
      tty devices that are normally meant for sockets. This causes
      problems with our compat_ioctl handling that tries to convert
      the data structures in a different format.
      
      Fortunately, these five drivers all use 32 bit compatible
      data structures in the ioctl numbers, so we can just add
      a trivial compat_ioctl conversion function to each of them.
      
      SIOCSIFENCAP and SIOCGIFENCAP do not need to live in
      fs/compat_ioctl.c after this any more, and they are not
      used on any sockets.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9646e7ce
    • A
      net/tun: handle compat_ioctl directly · 50857e2a
      Arnd Bergmann 提交于
      The tun driver is the only code in the kernel that operates
      on a character device with struct ifreq. Change the driver
      to handle the conversion itself so we can contain the
      remaining ifreq handling in the socket layer.
      
      This also fixes a bug in the handling of invalid ioctl
      numbers on an unbound tun device. The driver treats this
      as a TUNSETIFF in native mode, but there is no way for
      the generic compat_ioctl() function to emulate this
      behaviour. Possibly the driver was only doing this
      accidentally anyway, but if any code relies on this
      misfeature, it now also works in compat mode.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50857e2a
  24. 08 8月, 2009 1 次提交
  25. 13 7月, 2009 1 次提交
  26. 24 6月, 2009 1 次提交
  27. 15 6月, 2009 1 次提交
  28. 13 6月, 2009 1 次提交