22 Apr, 2008

7 commits


21 Apr, 2008

7 commits

  • What do_gettimeofday() does is to call getnstimeofday() and
    to convert the result from timespec{} to timeval{}.
    After that, these callers convert the result again to msec.
    Use getnstimeofday() and convert the units at once.

    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki
     
  • This patch makes the needlessly global icmp_sk_init() static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • This patch makes the needlessly global struct
    ip6_prohibit_entry_template static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • This is a trivial fix to correct function name in a comment in
    net/ipv4/tcp.c.

    Signed-off-by: Satoru SATOH
    Signed-off-by: David S. Miller

    Satoru SATOH
     
  • Expose dev_id to userspace, because it helps to disambiguate between
    interfaces where the MAC address is unique.

    This should allow us to simplify the handling of persistent naming for
    S390 network devices in udev -- because it can depend on a simple
    attribute of the device like the other match criteria, rather than
    having a special case for SUBSYSTEMS=="ccwgroup".

    Signed-off-by: David Woodhouse
    Signed-off-by: David S. Miller

    David Woodhouse
     
  • Add kernel-doc notation for ndisc_nodetype:

    Warning(linux-2.6.25-git2//include/linux/skbuff.h:340): No description found for parameter 'ndisc_nodetype'

    Signed-off-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Randy Dunlap
     
  • [ INFO: possible recursive locking detected ]
    2.6.25 #3
    ---------------------------------------------
    ax25ipd/3811 is trying to acquire lock:
    (rose_node_list_lock){-+..}, at: [] rose_get_neigh+0x1a/0xa0
    [rose]

    but task is already holding lock:
    (rose_node_list_lock){-+..}, at: []
    rose_route_frame+0x4d/0x620 [rose]

    other info that might help us debug this:
    6 locks held by ax25ipd/3811:
    #0: (&tty->atomic_write_lock){--..}, at: []
    tty_write_lock+0x1c/0x50
    #1: (rcu_read_lock){..--}, at: [] net_rx_action+0x96/0x230
    #2: (rcu_read_lock){..--}, at: [] netif_receive_skb+0x100/0x2f0
    #3: (rose_node_list_lock){-+..}, at: []
    rose_route_frame+0x4d/0x620 [rose]
    #4: (rose_neigh_list_lock){-+..}, at: []
    rose_route_frame+0x57/0x620 [rose]
    #5: (rose_route_list_lock){-+..}, at: []
    rose_route_frame+0x61/0x620 [rose]

    stack backtrace:
    Pid: 3811, comm: ax25ipd Not tainted 2.6.25 #3
    [] print_deadlock_bug+0xc7/0xd0
    [] check_deadlock+0x9a/0xb0
    [] validate_chain+0x1e2/0x310
    [] ? validate_chain+0xa5/0x310
    [] ? native_sched_clock+0x88/0xc0
    [] __lock_acquire+0x1a1/0x750
    [] lock_acquire+0x81/0xa0
    [] ? rose_get_neigh+0x1a/0xa0 [rose]
    [] _spin_lock_bh+0x33/0x60
    [] ? rose_get_neigh+0x1a/0xa0 [rose]
    [] rose_get_neigh+0x1a/0xa0 [rose]
    [] rose_route_frame+0x464/0x620 [rose]
    [] ? _read_unlock+0x1d/0x20
    [] ? rose_route_frame+0x0/0x620 [rose]
    [] ax25_rx_iframe+0x66/0x3b0 [ax25]
    [] ? ax25_start_t3timer+0x1f/0x40 [ax25]
    [] ax25_std_frame_in+0x7fb/0x890 [ax25]
    [] ? _spin_unlock_bh+0x25/0x30
    [] ax25_kiss_rcv+0x2c6/0x800 [ax25]
    [] ? sock_def_readable+0x59/0x80
    [] ? __lock_release+0x47/0x70
    [] ? sock_def_readable+0x59/0x80
    [] ? _read_unlock+0x1d/0x20
    [] ? sock_def_readable+0x59/0x80
    [] ? sock_queue_rcv_skb+0x13a/0x1d0
    [] ? sock_queue_rcv_skb+0x45/0x1d0
    [] ? ax25_kiss_rcv+0x0/0x800 [ax25]
    [] netif_receive_skb+0x255/0x2f0
    [] ? netif_receive_skb+0x100/0x2f0
    [] process_backlog+0x7c/0xf0
    [] net_rx_action+0x16c/0x230
    [] ? net_rx_action+0x96/0x230
    [] __do_softirq+0x93/0x120
    [] ? mkiss_receive_buf+0x33a/0x3f0 [mkiss]
    [] do_softirq+0x57/0x60
    [] local_bh_enable_ip+0xa5/0xe0
    [] _spin_unlock_bh+0x25/0x30
    [] mkiss_receive_buf+0x33a/0x3f0 [mkiss]
    [] pty_write+0x47/0x60
    [] write_chan+0x1b0/0x220
    [] ? tty_write_lock+0x1c/0x50
    [] ? default_wake_function+0x0/0x10
    [] tty_write+0x12a/0x1c0
    [] ? write_chan+0x0/0x220
    [] vfs_write+0x96/0x130
    [] ? tty_write+0x0/0x1c0
    [] sys_write+0x3d/0x70
    [] sysenter_past_esp+0x5f/0xa5
    =======================
    BUG: soft lockup - CPU#0 stuck for 61s! [ax25ipd:3811]

    Pid: 3811, comm: ax25ipd Not tainted (2.6.25 #3)
    EIP: 0060:[] EFLAGS: 00000246 CPU: 0
    EIP is at native_read_tsc+0xb/0x20
    EAX: b404aa2c EBX: b404a9c9 ECX: 017f1000 EDX: 0000076b
    ESI: 00000001 EDI: 00000000 EBP: ecc83afc ESP: ecc83afc
    DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    CR0: 8005003b CR2: b7f5f000 CR3: 2cd8e000 CR4: 000006f0
    DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    DR6: ffff0ff0 DR7: 00000400
    [] delay_tsc+0x17/0x30
    [] __delay+0x9/0x10
    [] __spin_lock_debug+0x76/0xf0
    [] ? spin_bug+0x18/0x100
    [] ? __lock_contended+0xa3/0x110
    [] _raw_spin_lock+0x68/0x90
    [] _spin_lock_bh+0x4f/0x60
    [] ? rose_get_neigh+0x1a/0xa0 [rose]
    [] rose_get_neigh+0x1a/0xa0 [rose]
    [] rose_route_frame+0x464/0x620 [rose]
    [] ? _read_unlock+0x1d/0x20
    [] ? rose_route_frame+0x0/0x620 [rose]
    [] ax25_rx_iframe+0x66/0x3b0 [ax25]
    [] ? ax25_start_t3timer+0x1f/0x40 [ax25]
    [] ax25_std_frame_in+0x7fb/0x890 [ax25]
    [] ? _spin_unlock_bh+0x25/0x30
    [] ax25_kiss_rcv+0x2c6/0x800 [ax25]
    [] ? sock_def_readable+0x59/0x80
    [] ? __lock_release+0x47/0x70
    [] ? sock_def_readable+0x59/0x80
    [] ? _read_unlock+0x1d/0x20
    [] ? sock_def_readable+0x59/0x80
    [] ? sock_queue_rcv_skb+0x13a/0x1d0
    [] ? sock_queue_rcv_skb+0x45/0x1d0
    [] ? ax25_kiss_rcv+0x0/0x800 [ax25]
    [] netif_receive_skb+0x255/0x2f0
    [] ? netif_receive_skb+0x100/0x2f0
    [] process_backlog+0x7c/0xf0
    [] net_rx_action+0x16c/0x230
    [] ? net_rx_action+0x96/0x230
    [] __do_softirq+0x93/0x120
    [] ? mkiss_receive_buf+0x33a/0x3f0 [mkiss]
    [] do_softirq+0x57/0x60
    [] local_bh_enable_ip+0xa5/0xe0
    [] _spin_unlock_bh+0x25/0x30
    [] mkiss_receive_buf+0x33a/0x3f0 [mkiss]
    [] pty_write+0x47/0x60
    [] write_chan+0x1b0/0x220
    [] ? tty_write_lock+0x1c/0x50
    [] ? default_wake_function+0x0/0x10
    [] tty_write+0x12a/0x1c0
    [] ? write_chan+0x0/0x220
    [] vfs_write+0x96/0x130
    [] ? tty_write+0x0/0x1c0
    [] sys_write+0x3d/0x70
    [] sysenter_past_esp+0x5f/0xa5
    =======================

    Since rose_route_frame() does not use rose_node_list we can safely
    remove rose_node_list_lock spin lock here and let it be free for
    rose_get_neigh().

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux
     

20 Apr, 2008

10 commits

  • ================================================
    [ BUG: lock held when returning to user space! ]
    ------------------------------------------------
    xfbbd/3683 is leaving the kernel with locks still held!
    1 lock held by xfbbd/3683:
    #0: (sk_lock-AF_ROSE){--..}, at: [] rose_connect+0x73/0x420 [rose]

    INFO: task xfbbd:3683 blocked for more than 120 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    xfbbd D 00000246 0 3683 3669
    c6965ee0 00000092 c02c5c40 00000246 c0f6b5f0 c0f6b5c0 c0f6b5f0 c0f6b5c0
    c0f6b614 c6965f18 c024b74b ffffffff c06ba070 00000000 00000000 00000001
    c6ab07c0 c012d450 c0f6b634 c0f6b634 c7b5bf10 c0d6004c c7b5bf10 c6965f40
    Call Trace:
    [] lock_sock_nested+0x6b/0xd0
    [] ? autoremove_wake_function+0x0/0x40
    [] sock_fasync+0x41/0x150
    [] sock_close+0x19/0x40
    [] __fput+0xb4/0x170
    [] fput+0x18/0x20
    [] filp_close+0x3e/0x70
    [] sys_close+0x69/0xb0
    [] sysenter_past_esp+0x5f/0xa5
    =======================
    INFO: lockdep is turned off.

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux
     
  • _urb_free is an alias for kfree... making code longer & harder to
    read. Remove it.

    Signed-off-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Pavel Machek
     
  • The functions time_before, time_before_eq, time_after, and time_after_eq
    are more robust for comparing jiffies against other values.

    A simplified version of the semantic patch making this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @ change_compare_np @
    expression E;
    @@

    (
    - jiffies = E
    + time_after_eq(jiffies,E)
    |
    - jiffies < E
    + time_before(jiffies,E)
    |
    - jiffies > E
    + time_after(jiffies,E)
    )

    @ include depends on change_compare_np @
    @@

    #include

    @ no_include depends on !include && change_compare_np @
    @@

    #include
    + #include
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • The functions time_before, time_before_eq, time_after, and time_after_eq
    are more robust for comparing jiffies against other values.

    A simplified version of the semantic patch making this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @ change_compare_np @
    expression E;
    @@

    (
    - jiffies = E
    + time_after_eq(jiffies,E)
    |
    - jiffies < E
    + time_before(jiffies,E)
    |
    - jiffies > E
    + time_after(jiffies,E)
    )

    @ include depends on change_compare_np @
    @@

    #include

    @ no_include depends on !include && change_compare_np @
    @@

    #include
    + #include
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • hci_usb: do not initialize static variables to 0.

    Signed-off-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Pavel Machek
     
  • Herbert Xu's commit fb93134dfc2a6e6fbedc7c270a31da03fce88db9, entitled
    "[TCP]: Fix size calculation in sk_stream_alloc_pskb", has triggered a
    bug in the 5701 where the 5701 DMA engine will corrupt outgoing
    packets. This problem only happens when the starting address of the
    packet matches a certain range of offsets and only when the 5701 is
    placed downstream of a particular Intel bridge.

    This patch detects the problematic bridge and if present, readjusts the
    starting address of the packet data to a dword aligned boundary.

    Signed-off-by: Matt Carlson
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Matt Carlson
     
  • Code within NS_DEBUG_SPINLOCKS contained deprecated cli()/sti()
    function calls. NS_DEBUG_SPINLOCKS and the associated code seems to
    be of little use these days so the strategy of removing this code
    rather then updating it to use spinlocks has been taken.

    Signed-off-by: Mark Asselstine
    Reviewed-by: Matthew Wilcox
    Signed-off-by: David S. Miller

    Mark Asselstine
     
  • Reportred by Ingo Molnar:

    drivers/net/wireless/iwlwifi/iwl-debugfs.c: In function 'iwl_dbgfs_stations_read':
    drivers/net/wireless/iwlwifi/iwl-debugfs.c:256: error: 'struct iwl4965_tid_data' has no member named 'agg'

    Needs CONFIG_IWL4965_HT protection.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Reported by Ingo Molnar.

    The SIP helper is also useful without NAT. This patch adds an ifdef
    around the RTP call optimization for NATed clients.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • We need to select LIBCRC32C.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

19 Apr, 2008

16 commits

  • …s/security-testing-2.6

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
    security: fix up documentation for security_module_enable
    Security: Introduce security= boot parameter
    Audit: Final renamings and cleanup
    SELinux: use new audit hooks, remove redundant exports
    Audit: internally use the new LSM audit hooks
    LSM/Audit: Introduce generic Audit LSM hooks
    SELinux: remove redundant exports
    Netlink: Use generic LSM hook
    Audit: use new LSM hooks instead of SELinux exports
    SELinux: setup new inode/ipc getsecid hooks
    LSM: Introduce inode_getsecid and ipc_getsecid hooks

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26: (1090 commits)
    [NET]: Fix and allocate less memory for ->priv'less netdevices
    [IPV6]: Fix dangling references on error in fib6_add().
    [NETLABEL]: Fix NULL deref in netlbl_unlabel_staticlist_gen() if ifindex not found
    [PKT_SCHED]: Fix datalen check in tcf_simp_init().
    [INET]: Uninline the __inet_inherit_port call.
    [INET]: Drop the inet_inherit_port() call.
    SCTP: Initialize partial_bytes_acked to 0, when all of the data is acked.
    [netdrvr] forcedeth: internal simplifications; changelog removal
    phylib: factor out get_phy_id from within get_phy_device
    PHY: add BCM5464 support to broadcom PHY driver
    cxgb3: Fix __must_check warning with dev_dbg.
    tc35815: Statistics cleanup
    natsemi: fix MMIO for PPC 44x platforms
    [TIPC]: Cleanup of TIPC reference table code
    [TIPC]: Optimized initialization of TIPC reference table
    [TIPC]: Remove inlining of reference table locking routines
    e1000: convert uint16_t style integers to u16
    ixgb: convert uint16_t style integers to u16
    sb1000.c: make const arrays static
    sb1000.c: stop inlining largish static functions
    ...

    Linus Torvalds
     
  • security_module_enable() can only be called during kernel init.

    Signed-off-by: James Morris

    James Morris
     
  • Add the security= boot parameter. This is done to avoid LSM
    registration clashes in case of more than one bult-in module.

    User can choose a security module to enable at boot. If no
    security= boot parameter is specified, only the first LSM
    asking for registration will be loaded. An invalid security
    module name will be treated as if no module has been chosen.

    LSM modules must check now if they are allowed to register
    by calling security_module_enable(ops) first. Modify SELinux
    and SMACK to do so.

    Do not let SMACK register smackfs if it was not chosen on
    boot. Smackfs assumes that smack hooks are registered and
    the initial task security setup (swapper->security) is done.

    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris

    Ahmed S. Darwish
     
  • Rename the se_str and se_rule audit fields elements to
    lsm_str and lsm_rule to avoid confusion.

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris

    Ahmed S. Darwish
     
  • Setup the new Audit LSM hooks for SELinux.
    Remove the now redundant exported SELinux Audit interface.

    Audit: Export 'audit_krule' and 'audit_field' to the public
    since their internals are needed by the implementation of the
    new LSM hook 'audit_rule_known'.

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris

    Ahmed S. Darwish
     
  • Convert Audit to use the new LSM Audit hooks instead of
    the exported SELinux interface.

    Basically, use:
    security_audit_rule_init
    secuirty_audit_rule_free
    security_audit_rule_known
    security_audit_rule_match

    instad of (respectively) :
    selinux_audit_rule_init
    selinux_audit_rule_free
    audit_rule_has_selinux
    selinux_audit_rule_match

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris

    Ahmed S. Darwish
     
  • Introduce a generic Audit interface for security modules
    by adding the following new LSM hooks:

    audit_rule_init(field, op, rulestr, lsmrule)
    audit_rule_known(krule)
    audit_rule_match(secid, field, op, rule, actx)
    audit_rule_free(rule)

    Those hooks are only available if CONFIG_AUDIT is enabled.

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris
    Reviewed-by: Paul Moore

    Ahmed S. Darwish
     
  • Remove the following exported SELinux interfaces:
    selinux_get_inode_sid(inode, sid)
    selinux_get_ipc_sid(ipcp, sid)
    selinux_get_task_sid(tsk, sid)
    selinux_sid_to_string(sid, ctx, len)

    They can be substitued with the following generic equivalents
    respectively:
    new LSM hook, inode_getsecid(inode, secid)
    new LSM hook, ipc_getsecid*(ipcp, secid)
    LSM hook, task_getsecid(tsk, secid)
    LSM hook, sid_to_secctx(sid, ctx, len)

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris
    Reviewed-by: Paul Moore

    Ahmed S. Darwish
     
  • Don't use SELinux exported selinux_get_task_sid symbol.
    Use the generic LSM equivalent instead.

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris
    Acked-by: David S. Miller
    Reviewed-by: Paul Moore

    Ahmed S. Darwish
     
  • Stop using the following exported SELinux interfaces:
    selinux_get_inode_sid(inode, sid)
    selinux_get_ipc_sid(ipcp, sid)
    selinux_get_task_sid(tsk, sid)
    selinux_sid_to_string(sid, ctx, len)
    kfree(ctx)

    and use following generic LSM equivalents respectively:
    security_inode_getsecid(inode, secid)
    security_ipc_getsecid*(ipcp, secid)
    security_task_getsecid(tsk, secid)
    security_sid_to_secctx(sid, ctx, len)
    security_release_secctx(ctx, len)

    Call security_release_secctx only if security_secid_to_secctx
    succeeded.

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris
    Reviewed-by: Paul Moore

    Ahmed S. Darwish
     
  • Setup the new inode_getsecid and ipc_getsecid() LSM hooks
    for SELinux.

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris
    Reviewed-by: Paul Moore

    Ahmed S. Darwish
     
  • Introduce inode_getsecid(inode, secid) and ipc_getsecid(ipcp, secid)
    LSM hooks. These hooks will be used instead of similar exported
    SELinux interfaces.

    Let {inode,ipc,task}_getsecid hooks set the secid to 0 by default
    if CONFIG_SECURITY is not defined or if the hook is set to
    NULL (dummy). This is done to notify the caller that no valid
    secid exists.

    Signed-off-by: Casey Schaufler
    Signed-off-by: Ahmed S. Darwish
    Acked-by: James Morris
    Reviewed-by: Paul Moore

    Ahmed S. Darwish
     
  • This patch effectively reverts commit d0498d9ae1a5cebac363e38907266d5cd2eedf89
    aka "[NET]: Do not allocate unneeded memory for dev->priv alignment."
    It was found to be buggy because of final unconditional += NETDEV_ALIGN_CONST
    removal.

    For example, for sizeof(struct net_device) being 2048 bytes, "alloc_size"
    was also 2048 bytes, but allocator with debugging options turned on started
    giving out !32-byte aligned memory resulting in redzones overwrites.

    Patch does small optimization in ->priv'less case: bumping size to next
    32-byte boundary was always done to ensure ->priv will also be aligned.
    But, no ->priv, no need to do that.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     
  • do not return a -EINVAL when mmap()-ing PCI holes.

    Signed-off-by: Ingo Molnar
    Acked-by: Venkatesh Pallipadi
    Acked-by: Suresh Siddha
    Acked-by: H. Peter Anvin
    Acked-by: Thomas Gleixner
    Acked-by: Arjan van de Ven

    Ingo Molnar
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (137 commits)
    [SCSI] iscsi: bidi support for iscsi_tcp
    [SCSI] iscsi: bidi support at the generic libiscsi level
    [SCSI] iscsi: extended cdb support
    [SCSI] zfcp: Fix error handling for blocked unit for send FCP command
    [SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock
    [SCSI] zfcp: fix 31 bit compile warnings
    [SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commands
    [SCSI] bsg: remove minor in struct bsg_device
    [SCSI] bsg: use better helper list functions
    [SCSI] bsg: replace kobject_get with blk_get_queue
    [SCSI] bsg: takes a ref to struct device in fops->open
    [SCSI] qla1280: remove version check
    [SCSI] libsas: fix endianness bug in sas_ata
    [SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next)
    [SCSI] aacraid: Do not describe check_reset parameter with its value
    [SCSI] aacraid: Fix down_interruptible() to check the return value
    [SCSI] sun3_scsi_vme: add MODULE_LICENSE
    [SCSI] st: rename flush_write_buffer()
    [SCSI] tgt: use KMEM_CACHE macro
    [SCSI] initio: fix big endian problems for auto request sense
    ...

    Linus Torvalds