Ticket #946: ieee80211_wireless.c.diff

File ieee80211_wireless.c.diff, 0.8 kB (added by andrew.lunn@ascom.ch, 6 years ago)

Patch to fix the problem

  • ieee80211_wireless.c

    old new  
    50435051                return -EPERM; 
    50445052        if (copy_from_user(&cp, ifr->ifr_data, sizeof(cp))) 
    50455053                return -EFAULT; 
    5046  
     5054        if (access_ok(VERIFY_WRITE, ifr->ifr_name, IFNAMSIZ)) 
     5055                return -EFAULT; 
     5056           
    50475057        unit = ieee80211_new_wlanunit(); 
    50485058        if (unit == -1) 
    50495059                return -EIO;            /* XXX */ 
     
    50545064                ieee80211_delete_wlanunit(unit); 
    50555065                return -EIO; 
    50565066        } 
    5057         /* return final device name */ 
    5058         strncpy(ifr->ifr_name, vap->iv_dev->name, IFNAMSIZ); 
     5067 
     5068        /* return final device name - should not fail, we have already 
     5069           checked above if we can access this. */ 
     5070        if (__copy_to_user(ifr->ifr_name, vap->iv_dev->name, IFNAMSIZ)) 
     5071                return -EFAULT; 
    50595072        return 0; 
    50605073} 
    50615074EXPORT_SYMBOL(ieee80211_ioctl_create_vap);