lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAABZP2w_YsXgzZ0tH=r3mnLUbVfpY8Xn3vk9XoS_Hq1r8aeNUQ@mail.gmail.com>
Date:   Wed, 7 Dec 2016 14:27:00 +0800
From:   Zhouyi Zhou <zhouzhouyi@...il.com>
To:     Cong Wang <xiyou.wangcong@...il.com>
Cc:     faisal.latif@...el.com, dledford@...hat.com, sean.hefty@...el.com,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
        QLogic-Storage-Upstream@...gic.com, jejb@...ux.vnet.ibm.com,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Johannes Thumshirn <jth@...nel.org>, jon.maloy@...csson.com,
        ying.xue@...driver.com, David Miller <davem@...emloft.net>,
        linux-rdma@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        intel-wired-lan <intel-wired-lan@...ts.osuosl.org>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>,
        linux-scsi@...r.kernel.org, fcoe-devel@...n-fcoe.org,
        tipc-discussion@...ts.sourceforge.net
Subject: Re: [PATCH] net: return value of skb_linearize should be handled in
 Linux kernel

On Wed, Dec 7, 2016 at 1:02 PM, Cong Wang <xiyou.wangcong@...il.com> wrote:
> On Mon, Dec 5, 2016 at 11:10 PM, Zhouyi Zhou <zhouzhouyi@...il.com> wrote:
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
>> index 2a653ec..ab787cb 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
>> @@ -490,7 +490,11 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter,
>>          */
>>         if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) &&
>>             (fctl & FC_FC_END_SEQ)) {
>> -               skb_linearize(skb);
>> +               int err = 0;
>> +
>> +               err = skb_linearize(skb);
>> +               if (err)
>> +                       return err;
>
>
> You can reuse 'rc' instead of adding 'err'.
rc here is meaningful for the length of data being ddped. If using rc
here, a successful
skb_linearize will assign rc to 0.
>
>
>
>>                 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc));
>>                 crc->fcoe_eof = FC_EOF_T;
>>         }
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> index fee1f29..4926d48 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> @@ -2173,8 +2173,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
>>                                 total_rx_bytes += ddp_bytes;
>>                                 total_rx_packets += DIV_ROUND_UP(ddp_bytes,
>>                                                                  mss);
>> -                       }
>> -                       if (!ddp_bytes) {
>> +                       } else {
>>                                 dev_kfree_skb_any(skb);
>>                                 continue;
>>                         }
>
>
> This piece doesn't seem to be related.
if ddp_bytes is negative there will be some error, I think the skb
should not pass to upper layer.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ