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: <56eff85f-852b-0123-ae57-7cf9baedbae6@embeddedor.com>
Date:   Tue, 20 Feb 2018 12:05:26 -0600
From:   "Gustavo A. R. Silva" <garsilva@...eddedor.com>
To:     Santosh Shilimkar <santosh.shilimkar@...cle.com>,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc:     "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, rds-devel@....oracle.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rds: send: mark expected switch fall-through in
 rds_rm_size

Hi Santosh,

On 02/20/2018 11:54 AM, Santosh Shilimkar wrote:
> Hi,
> 
> 2/19/2018 10:10 AM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>>
>> Addresses-Coverity-ID: 1465362 ("Missing break in switch")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
>> ---
>>   net/rds/send.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/net/rds/send.c b/net/rds/send.c
>> index 028ab59..79d158b 100644
>> --- a/net/rds/send.c
>> +++ b/net/rds/send.c
>> @@ -902,6 +902,8 @@ static int rds_rm_size(struct msghdr *msg, int 
>> num_sgs)
>>           case RDS_CMSG_ZCOPY_COOKIE:
>>               zcopy_cookie = true;
>> +            /* fall through */
>> +
>>           case RDS_CMSG_RDMA_DEST:
>>           case RDS_CMSG_RDMA_MAP:
>>               cmsg_groups |= 2;
>>
> So coverity greps for commet as "fall through" for
> -Wimplicit-fallthrough build ?
> 

No. Basically, Coverity only reports cases in which a break, return or 
continue statement is missing.

Now, if the statements I mention above are missing and if you add the 
following line to your Makefile:

KBUILD_CFLAGS  += $(call cc-option,-Wimplicit-fallthrough)

You will get a warning if a fall-through comment is missing.

> Adding that comments itself if fine but was curious
> about it if some one makes a spell error in this
> comment what happens ;-)
> 

In this case, Coverity would still report the same "Missing break in 
switch" error, but you'll get a GCC warning.

> For patch itself,
> Acked-by: Santosh Shilimkar <santosh.shilimkar@...cle.com>

--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ