[PATCH 07/18] net/tls: sanitize MSG_EOR handling

Jakub Kicinski kuba at kernel.org
Tue Apr 18 11:28:25 PDT 2023


On Tue, 18 Apr 2023 13:02:34 +0200 Hannes Reinecke wrote:
> >> diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
> >> index 827292e29f99..7b28b11ff611 100644
> >> --- a/net/tls/tls_sw.c
> >> +++ b/net/tls/tls_sw.c
> >> @@ -953,9 +953,12 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr 
> >> *msg, size_t size)
> >>          int pending;
> >>
> >>          if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
> >> -                              MSG_CMSG_COMPAT))
> >> +                              MSG_EOR | MSG_CMSG_COMPAT))
> >>                  return -EOPNOTSUPP;
> >>
> >> +       if (MSG_EOR)  
> > 
> > You probably meant if (msg->msg_flags & MSG_EOR)...
> >   
> Of course.

Neat. And similarly for sendpage() and in tls_device.c, it should be
fairly small changes in all 3 places. You don't need to worry about
tls_device itself using EOR, FWIW, it's just to try to make the offload
start on a skb boundary. Adding more EORs should not confuse anything.



More information about the Linux-nvme mailing list