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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5B97889F.3020303@huawei.com>
Date:   Tue, 11 Sep 2018 17:19:27 +0800
From:   zhong jiang <zhongjiang@...wei.com>
To:     Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
CC:     <davem@...emloft.net>, <edumazet@...gle.com>,
        <kuznet@....inr.ac.ru>, <yoshfuji@...ux-ipv6.org>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: ipv4: Use BUG_ON directly instead of a if condition
 followed by BUG

On 2018/9/11 17:11, Sergei Shtylyov wrote:
> On 9/11/2018 11:59 AM, zhong jiang wrote:
>
>>>> The if condition can be removed if we use BUG_ON directly.
>>>> The issule is detected with the help of Coccinelle.
>>>
>>>    Issue?
>>>
>>>>
>>>> Signed-off-by: zhong jiang <zhongjiang@...wei.com>
>>>> ---
>>>>    net/ipv4/tcp_input.c | 8 ++++----
>>>>    1 file changed, 4 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
>>>> index 62508a2..893bde3 100644
>>>> --- a/net/ipv4/tcp_input.c
>>>> +++ b/net/ipv4/tcp_input.c
>>>> @@ -4934,8 +4934,8 @@ void tcp_rbtree_insert(struct rb_root *root, struct sk_buff *skb)
>>>>                BUG_ON(offset < 0);
>>>>                if (size > 0) {
>>>>                    size = min(copy, size);
>>>> -                if (skb_copy_bits(skb, offset, skb_put(nskb, size), size))
>>>> -                    BUG();
>>>> +                BUG(skb_copy_bits(skb, offset,
>>>
>>>     You said BUG_ON()?
>>   Yep. Do you think that it is worthing to do
>
>    I think BUG() doesn't take parameters, BUG_ON() does. Have you tried to build the kernel with your patch at all?
>
 I know that the patch should be BUG_ON instead of BUG. This is my mistake.  I just want to know that it is worthing to do so.
 

 Thanks,
 zhong jiang
>>   Thanks,
>> zhong jiang
> [...]
>
> MBR, Sergei
>
>
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ