• Andrew Morton's avatar
    [PATCH] Fix for PPP activ/passiv filter · cf4389cb
    Andrew Morton authored
    From: Karsten Keil <kkeil@suse.de>
    
    I found a bug in the PPPIOCSPASS PPPIOCSACTIVE IOCTL implementation in
    kernel 2.5/2.6.
    
    The current pppd code use a empty filter (uprog.len=0) to detach the filter
    in the kernel, but this code was removed in 2.5.71 while fixing a compiler
    warning.
    
    Here the new patch, also with better limit checking.
    
    The second patch check for flen == 0 in the filter check too, since later
    in this code a filter[flen - 1] access is done, which is not so funny with
    flen 0.  Maybe it's not really needed anymore, since with the first patch
    it would not longer called with flen=0.
    
    paulus says:
    
        It looks correct.  Previously we had (and in 2.4 we still have)
    
            if (uprog.len > 0 && uprog.len < 65536) {
    		...
    
        which gave warnings since uprog.len is unsigned short.  So someone
        decided that both parts of the condition were redundant.
    cf4389cb
ppp_generic.c 63.9 KB