Changeset 3916

Show
Ignore:
Timestamp:
09/12/2006 01:13:30 AM (3 years ago)
Author:
BrainSlayer
Message:

watchdog and kernel update

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/linux/brcm/linux.v23/.config

    r3658 r3916  
    773773# Watchdog Cards 
    774774# 
    775 # CONFIG_WATCHDOG is not set 
     775CONFIG_WATCHDOG=y 
     776# CONFIG_WATCHDOG_NOWAYOUT is not set 
     777# CONFIG_ACQUIRE_WDT is not set 
     778# CONFIG_ADVANTECH_WDT is not set 
     779# CONFIG_ALIM1535_WDT is not set 
     780# CONFIG_ALIM7101_WDT is not set 
     781# CONFIG_SC520_WDT is not set 
     782# CONFIG_PCWATCHDOG is not set 
     783# CONFIG_EUROTECH_WDT is not set 
     784# CONFIG_IB700_WDT is not set 
     785# CONFIG_WAFER_WDT is not set 
     786# CONFIG_I810_TCO is not set 
     787# CONFIG_MIXCOMWD is not set 
     788# CONFIG_60XX_WDT is not set 
     789# CONFIG_SC1200_WDT is not set 
     790# CONFIG_SCx200_WDT is not set 
     791CONFIG_SOFT_WATCHDOG=y 
     792# CONFIG_W83877F_WDT is not set 
     793# CONFIG_WDT is not set 
     794# CONFIG_WDTPCI is not set 
     795# CONFIG_MACHZ_WDT is not set 
    776796# CONFIG_SCx200 is not set 
    777797# CONFIG_SCx200_GPIO is not set 
  • src/linux/brcm/linux.v23/.config_micro

    r3658 r3916  
    749749# Watchdog Cards 
    750750# 
    751 # CONFIG_WATCHDOG is not set 
     751CONFIG_WATCHDOG=y 
     752# CONFIG_WATCHDOG_NOWAYOUT is not set 
     753# CONFIG_ACQUIRE_WDT is not set 
     754# CONFIG_ADVANTECH_WDT is not set 
     755# CONFIG_ALIM1535_WDT is not set 
     756# CONFIG_ALIM7101_WDT is not set 
     757# CONFIG_SC520_WDT is not set 
     758# CONFIG_PCWATCHDOG is not set 
     759# CONFIG_EUROTECH_WDT is not set 
     760# CONFIG_IB700_WDT is not set 
     761# CONFIG_WAFER_WDT is not set 
     762# CONFIG_I810_TCO is not set 
     763# CONFIG_MIXCOMWD is not set 
     764# CONFIG_60XX_WDT is not set 
     765# CONFIG_SC1200_WDT is not set 
     766# CONFIG_SCx200_WDT is not set 
     767CONFIG_SOFT_WATCHDOG=y 
     768# CONFIG_W83877F_WDT is not set 
     769# CONFIG_WDT is not set 
     770# CONFIG_WDTPCI is not set 
     771# CONFIG_MACHZ_WDT is not set 
    752772# CONFIG_SCx200 is not set 
    753773# CONFIG_SCx200_GPIO is not set 
  • src/linux/brcm/linux.v23/.config_std

    r3658 r3916  
    763763# Watchdog Cards 
    764764# 
    765 # CONFIG_WATCHDOG is not set 
     765CONFIG_WATCHDOG=y 
     766# CONFIG_WATCHDOG_NOWAYOUT is not set 
     767# CONFIG_ACQUIRE_WDT is not set 
     768# CONFIG_ADVANTECH_WDT is not set 
     769# CONFIG_ALIM1535_WDT is not set 
     770# CONFIG_ALIM7101_WDT is not set 
     771# CONFIG_SC520_WDT is not set 
     772# CONFIG_PCWATCHDOG is not set 
     773# CONFIG_EUROTECH_WDT is not set 
     774# CONFIG_IB700_WDT is not set 
     775# CONFIG_WAFER_WDT is not set 
     776# CONFIG_I810_TCO is not set 
     777# CONFIG_MIXCOMWD is not set 
     778# CONFIG_60XX_WDT is not set 
     779# CONFIG_SC1200_WDT is not set 
     780# CONFIG_SCx200_WDT is not set 
     781CONFIG_SOFT_WATCHDOG=y 
     782# CONFIG_W83877F_WDT is not set 
     783# CONFIG_WDT is not set 
     784# CONFIG_WDTPCI is not set 
     785# CONFIG_MACHZ_WDT is not set 
    766786# CONFIG_SCx200 is not set 
    767787# CONFIG_SCx200_GPIO is not set 
  • src/linux/brcm/linux.v23/Makefile

    r3658 r3916  
    22PATCHLEVEL = 4 
    33SUBLEVEL = 34 
    4 EXTRAVERSION = -pre1 
     4EXTRAVERSION = -pre2 
    55 
    66KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 
  • src/linux/brcm/linux.v23/crypto/cipher.c

    r1 r3916  
    148148} 
    149149 
     150static int ecb_encrypt_iv(struct crypto_tfm *tfm, 
     151                          struct scatterlist *dst, 
     152                          struct scatterlist *src, 
     153                          unsigned int nbytes, u8 *iv) 
     154{ 
     155        ecb_encrypt(tfm, dst, src, nbytes); 
     156        return -ENOSYS; 
     157} 
     158 
    150159static int ecb_decrypt(struct crypto_tfm *tfm, 
    151160                       struct scatterlist *dst, 
     
    158167} 
    159168 
     169static int ecb_decrypt_iv(struct crypto_tfm *tfm, 
     170                          struct scatterlist *dst, 
     171                          struct scatterlist *src, 
     172                          unsigned int nbytes, u8 *iv) 
     173{ 
     174        ecb_decrypt(tfm, dst, src, nbytes); 
     175        return -ENOSYS; 
     176} 
     177 
    160178static int cbc_encrypt(struct crypto_tfm *tfm, 
    161179                       struct scatterlist *dst, 
     
    198216} 
    199217 
     218/* 
     219 * nocrypt*() zeroize the destination buffer to make sure we don't leak 
     220 * uninitialized memory contents if the caller ignores the return value. 
     221 * This is bad since the data in the source buffer is unused and may be 
     222 * lost, but an infoleak would be even worse.  The performance cost of 
     223 * memset() is irrelevant since a well-behaved caller would not bump into 
     224 * the error repeatedly. 
     225 */ 
    200226static int nocrypt(struct crypto_tfm *tfm, 
    201227                   struct scatterlist *dst, 
     
    203229                   unsigned int nbytes) 
    204230{ 
     231        memset(dst, 0, nbytes); 
    205232        return -ENOSYS; 
    206233} 
     
    211238                      unsigned int nbytes, u8 *iv) 
    212239{ 
     240        memset(dst, 0, nbytes); 
    213241        return -ENOSYS; 
    214242} 
     
    236264                ops->cit_encrypt = ecb_encrypt; 
    237265                ops->cit_decrypt = ecb_decrypt; 
     266/* These should have been nocrypt_iv, but patch-cryptoloop-jari-2.4.22.0 
     267 * (and its other revisions) directly calls the *_iv() functions even in 
     268 * ECB mode and ignores their return value. */ 
     269                ops->cit_encrypt_iv = ecb_encrypt_iv; 
     270                ops->cit_decrypt_iv = ecb_decrypt_iv; 
    238271                break; 
    239272                 
  • src/linux/brcm/linux.v23/drivers/block/cciss_scsi.c

    r1 r3916  
    5050 
    5151 
    52 int __init cciss_scsi_detect(Scsi_Host_Template *tpnt); 
     52int cciss_scsi_detect(Scsi_Host_Template *tpnt); 
    5353int cciss_scsi_release(struct Scsi_Host *sh); 
    5454const char *cciss_scsi_info(struct Scsi_Host *sa); 
     
    778778   called from cciss.c:cciss_init_one().  */ 
    779779 
    780 int __init 
     780int 
    781781cciss_scsi_detect(Scsi_Host_Template *tpnt) 
    782782{ 
  • src/linux/brcm/linux.v23/drivers/block/loop.c

    r1 r3916  
    694694 
    695695        lo->lo_bh = lo->lo_bhtail = NULL; 
    696         kernel_thread(loop_thread, lo, CLONE_FS | CLONE_FILES | CLONE_SIGHAND); 
    697         down(&lo->lo_sem); 
     696        error = kernel_thread(loop_thread, lo, 
     697            CLONE_FS | CLONE_FILES | CLONE_SIGHAND); 
     698        if (error < 0) 
     699                goto out_clr; 
     700        down(&lo->lo_sem); /* wait for the thread to start */ 
    698701 
    699702        fput(file); 
    700703        return 0; 
    701704 
     705 out_clr: 
     706        lo->lo_backing_file = NULL; 
     707        lo->lo_device = 0; 
     708        lo->lo_flags = 0; 
     709        loop_sizes[lo->lo_number] = 0; 
     710        inode->i_mapping->gfp_mask = lo->old_gfp_mask; 
     711        lo->lo_state = Lo_unbound; 
     712        fput(file); /* yes, have to do it twice */ 
    702713 out_putf: 
    703714        fput(file); 
  • src/linux/brcm/linux.v23/drivers/net/wireless/wlcompat.c

    r3330 r3916  
    1919 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
    2020 * 
    21  * $Id: wlcompat.c 2529 2005-11-19 01:07:28Z nbd $ 
     21 * $Id: wlcompat.c 4735 2006-09-03 04:54:21Z nbd $ 
    2222 */ 
    2323 
     
    2525#include <linux/config.h> 
    2626#include <linux/module.h> 
     27#include <linux/moduleparam.h> 
    2728#include <linux/init.h> 
    2829#include <linux/if_arp.h> 
    2930#include <asm/uaccess.h> 
    3031#include <linux/wireless.h> 
     32#include <linux/timer.h> 
    3133 
    3234#include <net/iw_handler.h> 
     
    3638static unsigned short bss_force; 
    3739static struct iw_statistics wstats; 
     40static int random = 1; 
    3841char buf[WLC_IOCTL_MAXLEN]; 
    3942 
     
    4447}; 
    4548#define NUM_CHANNELS ( sizeof(channel_frequency) / sizeof(channel_frequency[0]) ) 
     49 
     50#define RNG_POLL_FREQ   20 
    4651 
    4752typedef struct internal_wsec_key { 
     
    184189 
    185190        range->txpower_capa = IW_TXPOW_DBM; 
    186 /*      range->encoding_size[0] = WEP1_KEY_SIZE; 
    187         range->encoding_size[1] = WEP128_KEY_SIZE; 
    188 #if WIRELESS_EXT > 17 
    189         range->encoding_size[2] = TKIP_KEY_SIZE; 
    190 #else 
    191         range->encoding_size[2] = 0; 
    192         range->encoding_size[3] = AES_KEY_SIZE; 
    193  
    194  
    195  
    196          
    197 #if WIRELESS_EXT > 17 
    198         range->enc_capa = IW_ENC_CAPA_WPA; 
    199         range->enc_capa |= IW_ENC_CAPA_CHIPHER_TKIP; 
    200         range->enc_capa |= IW_ENC_CAPA_CHIPHER_CCMP; 
    201         range->enc_capa |= IW_ENC_CAPA_WPA2; 
    202 #endif   
    203 */       
     191 
    204192        return 0; 
    205193} 
    206 /* 
    207 #if WIRELESS_EXT > 17 
    208 static bool 
    209 ie_is_wpa_ie(uint8 **wpaie, uint8 **tlvs, int *tlvs_len) 
    210 
    211         uint8 *ie = *wpaie; 
    212  
    213         if ((ie[1] >= 6) &&  
    214                 !bcmp((const void *)&ie[2], (const void *)(WPA_OUI "\x01"), 4)) { 
    215                 return TRUE; 
    216         } 
    217  
    218         ie += ie[1] + 2; 
    219         *tlvs_len -= (int)ie - (int)*tlvs; 
    220         *tlvs = ie; 
    221         return FALSE; 
    222 
    223 #endif 
    224 */ 
     194 
     195 
    225196static int wlcompat_set_scan(struct net_device *dev, 
    226197                         struct iw_request_info *info, 
     
    1012983} 
    1013984 
     985static struct timer_list rng_timer; 
     986 
     987static void rng_timer_tick(unsigned long n) 
     988{ 
     989        struct net_device *dev = (struct net_device *) n; 
     990        u16 data[4]; 
     991        int i, ret; 
     992         
     993        ret = 0; 
     994        for (i = 0; i < 3; i++) { 
     995                ret |= wl_get_val(dev, "rand", &data[i], sizeof(u16)); 
     996        } 
     997        if (!ret) 
     998                batch_entropy_store(*((u32 *) &data[0]), *((u32 *) &data[2]), (jiffies % 255)); 
     999 
     1000        mod_timer(&rng_timer, jiffies + (HZ/RNG_POLL_FREQ)); 
     1001} 
     1002 
     1003 
    10141004static int __init wlcompat_init() 
    10151005{ 
    10161006        int found = 0, i; 
    1017         char *devname = "eth0"; 
     1007        char devname[4] = "wl0"; 
    10181008        bss_force = 0; 
    10191009         
     
    10211011                if ((dev->wireless_handlers == NULL) && ((wl_ioctl(dev, WLC_GET_MAGIC, &i, sizeof(i)) == 0) && i == WLC_IOCTL_MAGIC)) 
    10221012                        found = 1; 
    1023                 devname[3]++; 
     1013                devname[2]++; 
    10241014        } 
    10251015         
     
    10341024        dev->wireless_handlers = (struct iw_handler_def *)&wlcompat_handler_def; 
    10351025        dev->get_wireless_stats = wlcompat_get_wireless_stats; 
     1026 
     1027        if (random) { 
     1028                init_timer(&rng_timer); 
     1029                rng_timer.function = rng_timer_tick; 
     1030                rng_timer.data = (unsigned long) dev; 
     1031                rng_timer_tick((unsigned long) dev); 
     1032        } 
     1033         
    10361034#ifdef DEBUG 
    10371035        printk("broadcom driver private data: 0x%08x\n", dev->priv); 
     
    10421040static void __exit wlcompat_exit() 
    10431041{ 
     1042        if (random) 
     1043                del_timer(&rng_timer); 
    10441044        dev->get_wireless_stats = NULL; 
    10451045        dev->wireless_handlers = NULL; 
     
    10521052MODULE_LICENSE("GPL"); 
    10531053 
     1054module_param(random, int, 0); 
    10541055module_init(wlcompat_init); 
    10551056module_exit(wlcompat_exit); 
  • src/linux/brcm/linux.v23/drivers/scsi/sg.c

    r1 r3916  
    11931193        sfp->mmap_called = 1; 
    11941194    } 
    1195     vma->vm_flags |= (VM_RESERVED | VM_IO)
     1195    vma->vm_flags |= VM_RESERVED
    11961196    vma->vm_private_data = sfp; 
    11971197    vma->vm_ops = &sg_mmap_vm_ops; 
  • src/linux/brcm/linux.v23/fs/binfmt_elf.c

    r2499 r3916  
    8787}; 
    8888 
    89 #define BAD_ADDR(x)     ((unsigned long)(x) > TASK_SIZE) 
     89#define BAD_ADDR(x)     ((unsigned long)(x) >= TASK_SIZE) 
    9090 
    9191static int set_brk(unsigned long start, unsigned long end) 
     
    355355             */ 
    356356            k = load_addr + eppnt->p_vaddr; 
    357             if (k > TASK_SIZE || eppnt->p_filesz > eppnt->p_memsz || 
     357            if (BAD_ADDR(k) || eppnt->p_filesz > eppnt->p_memsz || 
    358358                eppnt->p_memsz > TASK_SIZE || TASK_SIZE - eppnt->p_memsz < k) { 
    359359                error = -ENOMEM; 
     
    799799                 * <= p_memsz so it is only necessary to check p_memsz. 
    800800                 */ 
    801                 if (k > TASK_SIZE || elf_ppnt->p_filesz > elf_ppnt->p_memsz || 
     801                if (BAD_ADDR(k) || elf_ppnt->p_filesz > elf_ppnt->p_memsz || 
    802802                    elf_ppnt->p_memsz > TASK_SIZE || 
    803803                    TASK_SIZE - elf_ppnt->p_memsz < k) { 
     
    851851                                                    &interp_load_addr); 
    852852                if (BAD_ADDR(elf_entry)) { 
    853                         printk(KERN_ERR "Unable to load interpreter %.128s\n", 
    854                                 elf_interpreter); 
     853                        // FIXME - ratelimit this before re-enabling 
     854                        // printk(KERN_ERR "Unable to load interpreter %.128s\n", 
     855                        //        elf_interpreter); 
     856 
    855857                        force_sig(SIGSEGV, current); 
    856                         retval = IS_ERR((void *)elf_entry) ? PTR_ERR((void *)elf_entry) : -ENOEXEC; 
     858                        retval = IS_ERR((void *)elf_entry) ? 
     859                                        (int)elf_entry : -EINVAL; 
    857860                        goto out_free_dentry; 
    858861                } 
     
    862865                fput(interpreter); 
    863866                kfree(elf_interpreter); 
     867        } else { 
     868                if (BAD_ADDR(elf_entry)) { 
     869                        force_sig(SIGSEGV, current); 
     870                        retval = -EINVAL; 
     871                        goto out_free_dentry; 
     872                } 
    864873        } 
    865874 
  • src/linux/brcm/linux.v23/fs/partitions/sun.c

    r1 r3916  
    8787        for (i = 0; i < 8; i++, p++) { 
    8888                unsigned long st_sector; 
    89                 int num_sectors; 
     89                unsigned int num_sectors; 
    9090 
    9191                st_sector = first_sector + be32_to_cpu(p->start_cylinder) * spc; 
  • src/linux/brcm/linux.v23/fs/udf/super.c

    r1 r3916  
    15161516                goto error_out; 
    15171517        } 
    1518         sb->s_maxbytes = MAX_LFS_FILESIZE
     1518        sb->s_maxbytes = 1<<30
    15191519        return sb; 
    15201520 
  • src/linux/brcm/linux.v23/fs/udf/truncate.c

    r1 r3916  
    183183                if (offset) 
    184184                { 
    185                         extoffset -= adsize; 
    186                         etype = udf_next_aext(inode, &bloc, &extoffset, &eloc, &elen, &bh, 1); 
    187                         if (etype == (EXT_NOT_RECORDED_NOT_ALLOCATED >> 30)) 
    188                         { 
    189                                 extoffset -= adsize; 
    190                                 elen = EXT_NOT_RECORDED_NOT_ALLOCATED | (elen + offset); 
    191                                 udf_write_aext(inode, bloc, &extoffset, eloc, elen, bh, 0); 
    192                         } 
    193                         else if (etype == (EXT_NOT_RECORDED_ALLOCATED >> 30)) 
    194                         { 
    195                                 lb_addr neloc = { 0, 0 }; 
    196                                 extoffset -= adsize; 
    197                                 nelen = EXT_NOT_RECORDED_NOT_ALLOCATED | 
    198                                         ((elen + offset + inode->i_sb->s_blocksize - 1) & 
    199                                         ~(inode->i_sb->s_blocksize - 1)); 
    200                                 udf_write_aext(inode, bloc, &extoffset, neloc, nelen, bh, 1); 
    201                                 udf_add_aext(inode, &bloc, &extoffset, eloc, (etype << 30) | elen, &bh, 1); 
    202                         } 
    203                         else 
    204                         { 
    205                                 if (elen & (inode->i_sb->s_blocksize - 1)) 
    206                                 { 
    207                                         extoffset -= adsize; 
    208                                         elen = EXT_RECORDED_ALLOCATED | 
    209                                                 ((elen + inode->i_sb->s_blocksize - 1) & 
    210                                                 ~(inode->i_sb->s_blocksize - 1)); 
    211                                         udf_write_aext(inode, bloc, &extoffset, eloc, elen, bh, 1); 
    212                                 } 
     185                        /* 
     186                         *  OK, there is not extent covering inode->i_size and 
     187                         *  no extent above inode->i_size => truncate is 
     188                         *  extending the file by 'offset'. 
     189                         */ 
     190                        if ((!bh && extoffset == udf_file_entry_alloc_offset(inode)) || 
     191                            (bh && extoffset == sizeof(struct allocExtDesc))) { 
     192                                /* File has no extents at all! */ 
    213193                                memset(&eloc, 0x00, sizeof(lb_addr)); 
    214194                                elen = EXT_NOT_RECORDED_NOT_ALLOCATED | offset; 
    215195                                udf_add_aext(inode, &bloc, &extoffset, eloc, elen, &bh, 1); 
    216196                        } 
     197                        else { 
     198                                extoffset -= adsize; 
     199                                etype = udf_next_aext(inode, &bloc, &extoffset, &eloc, &elen, &bh, 1); 
     200                                if (etype == (EXT_NOT_RECORDED_NOT_ALLOCATED >> 30)) 
     201                                { 
     202                                        extoffset -= adsize; 
     203                                        elen = EXT_NOT_RECORDED_NOT_ALLOCATED | (elen + offset); 
     204                                        udf_write_aext(inode, bloc, &extoffset, eloc, elen, bh, 0); 
     205                                } 
     206                                else if (etype == (EXT_NOT_RECORDED_ALLOCATED >> 30)) 
     207                                { 
     208                                        lb_addr neloc = { 0, 0 }; 
     209                                        extoffset -= adsize; 
     210                                        nelen = EXT_NOT_RECORDED_NOT_ALLOCATED | 
     211                                                ((elen + offset + inode->i_sb->s_blocksize - 1) & 
     212                                                ~(inode->i_sb->s_blocksize - 1)); 
     213                                        udf_write_aext(inode, bloc, &extoffset, neloc, nelen, bh, 1); 
     214                                        udf_add_aext(inode, &bloc, &extoffset, eloc, (etype << 30) | elen, &bh, 1); 
     215                                } 
     216                                else 
     217                                { 
     218                                        if (elen & (inode->i_sb->s_blocksize - 1)) 
     219                                        { 
     220                                                extoffset -= adsize; 
     221                                                elen = EXT_RECORDED_ALLOCATED | 
     222                                                        ((elen + inode->i_sb->s_blocksize - 1) & 
     223                                                        ~(inode->i_sb->s_blocksize - 1)); 
     224                                                udf_write_aext(inode, bloc, &extoffset, eloc, elen, bh, 1); 
     225                                        } 
     226                                        memset(&eloc, 0x00, sizeof(lb_addr)); 
     227                                        elen = EXT_NOT_RECORDED_NOT_ALLOCATED | offset; 
     228                                        udf_add_aext(inode, &bloc, &extoffset, eloc, elen, &bh, 1); 
     229                                } 
     230                        } 
    217231                } 
    218232        } 
  • src/linux/brcm/linux.v23/include/net/sctp/sctp.h

    r2846 r3916  
    411411} 
    412412 
    413 /* Calculate the size (in bytes) occupied by the data of an iovec.  */ 
    414 static inline size_t get_user_iov_size(struct iovec *iov, int iovlen) 
    415 { 
    416         size_t retval = 0; 
    417  
    418         for (; iovlen > 0; --iovlen) { 
    419                 retval += iov->iov_len; 
    420                 iov++; 
    421         } 
    422  
    423         return retval; 
    424 } 
    425  
    426413/* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ 
    427414static inline __s32 sctp_jitter(__u32 rto) 
  • src/linux/brcm/linux.v23/include/net/sctp/sm.h

    r1 r3916  
    222222                                      __u32 tsn); 
    223223struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *, 
    224                                    const struct sctp_chunk *, 
    225                                    const struct msghdr *); 
     224                                        const struct msghdr *, size_t msg_len); 
    226225struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *, 
    227226                                   const struct sctp_chunk *, 
  • src/linux/brcm/linux.v23/kernel/ksyms.c

    r3658 r3916  
    582582EXPORT_SYMBOL(memchr); 
    583583 
     584 
    584585#ifdef CONFIG_CRC32 
    585586EXPORT_SYMBOL(crc32_le); 
  • src/linux/brcm/linux.v23/net/sctp/sm_make_chunk.c

    r1 r3916  
    799799/* Helper to create ABORT with a SCTP_ERROR_USER_ABORT error.  */ 
    800800struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc, 
    801                                    const struct sctp_chunk *chunk
    802                                    const struct msghdr *msg
     801                                       const struct msghdr *msg
     802                                       size_t paylen
    803803{ 
    804804        struct sctp_chunk *retval; 
    805         void *payload = NULL, *payoff; 
    806         size_t paylen = 0; 
    807         struct iovec *iov = NULL; 
    808         int iovlen = 0; 
    809  
    810         if (msg) { 
    811                 iov = msg->msg_iov; 
    812                 iovlen = msg->msg_iovlen; 
    813                 paylen = get_user_iov_size(iov, iovlen); 
    814         } 
    815  
    816         retval = sctp_make_abort(asoc, chunk, sizeof(sctp_errhdr_t) + paylen); 
     805        void *payload = NULL; 
     806        int err; 
     807 
     808        retval = sctp_make_abort(asoc, NULL, sizeof(sctp_errhdr_t) + paylen); 
    817809        if (!retval) 
    818810                goto err_chunk; 
     
    820812        if (paylen) { 
    821813                /* Put the msg_iov together into payload.  */ 
    822                 payload = kmalloc(paylen, GFP_ATOMIC); 
     814                payload = kmalloc(paylen, GFP_KERNEL); 
    823815                if (!payload) 
    824816                        goto err_payload; 
    825                 payoff = payload; 
    826  
    827                 for (; iovlen > 0; --iovlen) { 
    828                         if (copy_from_user(payoff, iov->iov_base,iov->iov_len)) 
    829                                 goto err_copy; 
    830                         payoff += iov->iov_len; 
    831                         iov++; 
    832                 } 
     817 
     818                err = memcpy_fromiovec(payload, msg->msg_iov, paylen); 
     819                if (err < 0) 
     820                        goto err_copy; 
    833821        } 
    834822 
  • src/linux/brcm/linux.v23/net/sctp/sm_statefuns.c

    r2846 r3916  
    39913991         * if necessary to fill gaps. 
    39923992         */ 
    3993         struct msghdr *msg = arg; 
    3994         struct sctp_chunk *abort; 
     3993        struct sctp_chunk *abort = arg; 
    39953994        sctp_disposition_t retval; 
    39963995 
    39973996        retval = SCTP_DISPOSITION_CONSUME; 
    39983997 
    3999         /* Generate ABORT chunk to send the peer.  */ 
    4000         abort = sctp_make_abort_user(asoc, NULL, msg); 
    4001         if (!abort) 
    4002                 retval = SCTP_DISPOSITION_NOMEM; 
    4003         else 
    4004                 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 
     3998        sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 
    40053999 
    40064000        /* Even if we can't send the ABORT due to low memory delete the 
     
    41244118        sctp_cmd_seq_t *commands) 
    41254119{ 
    4126         struct msghdr *msg = arg; 
    4127         struct sctp_chunk *abort; 
     4120        struct sctp_chunk *abort = arg; 
    41284121        sctp_disposition_t retval; 
    41294122 
     
    41334126        retval = SCTP_DISPOSITION_CONSUME; 
    41344127 
    4135         /* Generate ABORT chunk to send the peer */ 
    4136         abort = sctp_make_abort_user(asoc, NULL, msg); 
    4137         if (!abort) 
    4138                 retval = SCTP_DISPOSITION_NOMEM; 
    4139         else 
    4140                 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 
     4128        sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 
    41414129 
    41424130        sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, 
  • src/linux/brcm/linux.v23/net/sctp/socket.c

    r1 r3916  
    968968                                sctp_association_free(asoc); 
    969969 
    970                         } else if (sk->linger && !sk->lingertime) 
    971                                 sctp_primitive_ABORT(asoc, NULL); 
    972                         else 
     970                        } else if (sk->linger && !sk->lingertime) { 
     971                                struct sctp_chunk *chunk; 
     972 
     973                                chunk = sctp_make_abort_user(asoc, NULL, 0); 
     974                                if (chunk) 
     975                                        sctp_primitive_ABORT(asoc, NULL); 
     976                        } else 
    973977                                sctp_primitive_SHUTDOWN(asoc, NULL); 
    974978                } else 
     
    12001204                } 
    12011205                if (sinfo_flags & MSG_ABORT) { 
     1206                        struct sctp_chunk *chunk; 
     1207 
     1208                        chunk = sctp_make_abort_user(asoc, msg, msg_len); 
     1209                        if (!chunk) { 
     1210                                err = -ENOMEM; 
     1211                                goto out_unlock; 
     1212                        } 
     1213 
    12021214                        SCTP_DEBUG_PRINTK("Aborting association: %p\n", asoc); 
    1203                         sctp_primitive_ABORT(asoc, msg); 
     1215                        sctp_primitive_ABORT(asoc, chunk); 
    12041216                        err = 0; 
    12051217                        goto out_unlock;