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: <201907290939.794DB730@keescook>
Date:   Mon, 29 Jul 2019 09:39:02 -0700
From:   Kees Cook <keescook@...omium.org>
To:     "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc:     Ishizaki Kou <kou.ishizaki@...hiba.co.jp>,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH] net: spider_net: Mark expected switch fall-through

On Sun, Jul 28, 2019 at 07:32:51PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
> 
> This patch fixes the following warning:
> 
> drivers/net/ethernet/toshiba/spider_net.c: In function 'spider_net_release_tx_chain':
> drivers/net/ethernet/toshiba/spider_net.c:783:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     if (!brutal) {
>        ^
> drivers/net/ethernet/toshiba/spider_net.c:792:3: note: here
>    case SPIDER_NET_DESCR_RESPONSE_ERROR:
>    ^~~~
> 
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.
> 
> Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>

Reviewed-by: Kees Cook <keescook@...omium.org>

-Kees

> ---
>  drivers/net/ethernet/toshiba/spider_net.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/toshiba/spider_net.c b/drivers/net/ethernet/toshiba/spider_net.c
> index 5b196ebfed49..0f346761a2b2 100644
> --- a/drivers/net/ethernet/toshiba/spider_net.c
> +++ b/drivers/net/ethernet/toshiba/spider_net.c
> @@ -788,6 +788,7 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
>  			/* fallthrough, if we release the descriptors
>  			 * brutally (then we don't care about
>  			 * SPIDER_NET_DESCR_CARDOWNED) */
> +			/* Fall through */
>  
>  		case SPIDER_NET_DESCR_RESPONSE_ERROR:
>  		case SPIDER_NET_DESCR_PROTECTION_ERROR:
> -- 
> 2.22.0
> 

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ