Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28ba934d authored by David S. Miller's avatar David S. Miller
Browse files


Alexei Starovoitov says:

====================
pull-request: bpf 2019-07-25

The following pull-request contains BPF updates for your *net* tree.

The main changes are:

1) fix segfault in libbpf, from Andrii.

2) fix gso_segs access, from Eric.

3) tls/sockmap fixes, from Jakub and John.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 47d858d0 cb8ffde5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -513,3 +513,9 @@ Redirects leak clear text

In the RX direction, if segment has already been decrypted by the device
and it gets redirected or mirrored - clear text will be transmitted out.

shutdown() doesn't clear TLS state
----------------------------------

shutdown() system call allows for a TLS socket to be reused as a different
connection. Offload doesn't currently handle that.
+13 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include <net/sch_generic.h>

#include <asm/byteorder.h>
#include <uapi/linux/filter.h>
#include <uapi/linux/bpf.h>

@@ -747,6 +748,18 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default)
	return size <= size_default && (size & (size - 1)) == 0;
}

static inline u8
bpf_ctx_narrow_load_shift(u32 off, u32 size, u32 size_default)
{
	u8 load_off = off & (size_default - 1);

#ifdef __LITTLE_ENDIAN
	return load_off * 8;
#else
	return (size_default - (load_off + size)) * 8;
#endif
}

#define bpf_ctx_wide_access_ok(off, size, type, field)			\
	(size == sizeof(__u64) &&					\
	off >= offsetof(type, field) &&					\
+7 −1
Original line number Diff line number Diff line
@@ -354,6 +354,12 @@ static inline void sk_psock_restore_proto(struct sock *sk,
	sk->sk_write_space = psock->saved_write_space;

	if (psock->sk_proto) {
		struct inet_connection_sock *icsk = inet_csk(sk);
		bool has_ulp = !!icsk->icsk_ulp_data;

		if (has_ulp)
			tcp_update_ulp(sk, psock->sk_proto);
		else
			sk->sk_prot = psock->sk_proto;
		psock->sk_proto = NULL;
	}
+3 −0
Original line number Diff line number Diff line
@@ -2108,6 +2108,8 @@ struct tcp_ulp_ops {

	/* initialize ulp */
	int (*init)(struct sock *sk);
	/* update ulp */
	void (*update)(struct sock *sk, struct proto *p);
	/* cleanup ulp */
	void (*release)(struct sock *sk);

@@ -2119,6 +2121,7 @@ void tcp_unregister_ulp(struct tcp_ulp_ops *type);
int tcp_set_ulp(struct sock *sk, const char *name);
void tcp_get_available_ulp(char *buf, size_t len);
void tcp_cleanup_ulp(struct sock *sk);
void tcp_update_ulp(struct sock *sk, struct proto *p);

#define MODULE_ALIAS_TCP_ULP(name)				\
	__MODULE_INFO(alias, alias_userspace, name);		\
+11 −4
Original line number Diff line number Diff line
@@ -107,9 +107,7 @@ struct tls_device {
enum {
	TLS_BASE,
	TLS_SW,
#ifdef CONFIG_TLS_DEVICE
	TLS_HW,
#endif
	TLS_HW_RECORD,
	TLS_NUM_CONFIG,
};
@@ -162,6 +160,7 @@ struct tls_sw_context_tx {
	int async_capable;

#define BIT_TX_SCHEDULED	0
#define BIT_TX_CLOSING		1
	unsigned long tx_bitmask;
};

@@ -272,6 +271,8 @@ struct tls_context {
	unsigned long flags;

	/* cache cold stuff */
	struct proto *sk_proto;

	void (*sk_destruct)(struct sock *sk);
	void (*sk_proto_close)(struct sock *sk, long timeout);

@@ -289,6 +290,8 @@ struct tls_context {

	struct list_head list;
	refcount_t refcount;

	struct work_struct gc;
};

enum tls_offload_ctx_dir {
@@ -355,13 +358,17 @@ int tls_sk_attach(struct sock *sk, int optname, char __user *optval,
		  unsigned int optlen);

int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx);
void tls_sw_strparser_arm(struct sock *sk, struct tls_context *ctx);
void tls_sw_strparser_done(struct tls_context *tls_ctx);
int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size);
int tls_sw_sendpage(struct sock *sk, struct page *page,
		    int offset, size_t size, int flags);
void tls_sw_close(struct sock *sk, long timeout);
void tls_sw_free_resources_tx(struct sock *sk);
void tls_sw_cancel_work_tx(struct tls_context *tls_ctx);
void tls_sw_release_resources_tx(struct sock *sk);
void tls_sw_free_ctx_tx(struct tls_context *tls_ctx);
void tls_sw_free_resources_rx(struct sock *sk);
void tls_sw_release_resources_rx(struct sock *sk);
void tls_sw_free_ctx_rx(struct tls_context *tls_ctx);
int tls_sw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
		   int nonblock, int flags, int *addr_len);
bool tls_sw_stream_read(const struct sock *sk);
Loading