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: <f9de8c74-b567-ac57-b1d5-dff8ce6ff191@solarflare.com>
Date:   Mon, 28 Oct 2019 17:46:18 +0000
From:   Edward Cree <ecree@...arflare.com>
To:     Charles McLachlan <cmclachlan@...arflare.com>,
        Jesper Dangaard Brouer <brouer@...hat.com>
CC:     <davem@...emloft.net>, <netdev@...r.kernel.org>,
        <linux-net-drivers@...arflare.com>
Subject: Re: [PATCH net-next v2 2/6] sfc: perform XDP processing on received
 packets

On 28/10/2019 17:11, Charles McLachlan wrote:
>>> +		efx_free_rx_buffers(rx_queue, rx_buf, 1);
>>> +		break;
>> You can do a /* Fall through */ to case XDP_DROP.
> but not if I put the trace_xdp_exception in as well. I think we're always going 
> to need two efx_free_rx_buffers calls.

This will probably make people scream, but I have an evil hack to deal with
 situations like this:

	default:
		bpf_warn_invalid_xdp_action(xdp_act);
		if (0) /* Fall further */
			/* Fall through */
	case XDP_ABORTED:
		trace_xdp_exception(netdev, xdp_prog, xdp_act);
		/* Fall through */
	case XDP_DROP:
		efx_free_rx_buffers(rx_queue, rx_buf, 1);
		break;

I wonder if gcc's Wimplicit-fallthrough logic can comprehend that?  Or if
 it'll trigger -Wmisleading-indentation?

-Ed

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ