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: <f3d46a4f232444378fae886fa7a0293a@AcuMS.aculab.com>
Date:   Thu, 25 Aug 2022 18:21:50 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'David Ahern' <dsahern@...nel.org>,
        Dmitry Safonov <dima@...sta.com>,
        "Eric Dumazet" <edumazet@...gle.com>,
        "David S. Miller" <davem@...emloft.net>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     Andy Lutomirski <luto@...capital.net>,
        Ard Biesheuvel <ardb@...nel.org>,
        Bob Gilligan <gilligan@...sta.com>,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Eric Biggers <ebiggers@...nel.org>,
        Francesco Ruggeri <fruggeri@...sta.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        Ivan Delalande <colona@...sta.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Leonard Crestez <cdleonard@...il.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Salam Noureddine <noureddine@...sta.com>,
        Shuah Khan <shuah@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>
Subject: RE: [PATCH 08/31] net/tcp: Introduce TCP_AO setsockopt()s

From: David Ahern
> Sent: 25 August 2022 16:32
> 
> On 8/18/22 9:59 AM, Dmitry Safonov wrote:
> > diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
> > index 849bbf2d3c38..5369458ae89f 100644
> > --- a/include/uapi/linux/tcp.h
> > +++ b/include/uapi/linux/tcp.h
> > @@ -129,6 +129,9 @@ enum {
> >
> >  #define TCP_TX_DELAY		37	/* delay outgoing packets by XX usec */
> >
> > +#define TCP_AO			38	/* (Add/Set MKT) */
> > +#define TCP_AO_DEL		39	/* (Delete MKT) */
> > +#define TCP_AO_MOD		40	/* (Modify MKT) */
> >
> >  #define TCP_REPAIR_ON		1
> >  #define TCP_REPAIR_OFF		0
> > @@ -344,6 +347,38 @@ struct tcp_diag_md5sig {
> >
> >  #define TCP_AO_MAXKEYLEN	80
> >
> > +#define TCP_AO_CMDF_CURR	(1 << 0)	/* Only checks field sndid */
> > +#define TCP_AO_CMDF_NEXT	(1 << 1)	/* Only checks field rcvid */
> > +
> > +struct tcp_ao { /* setsockopt(TCP_AO) */
> > +	struct __kernel_sockaddr_storage tcpa_addr;
> > +	char	tcpa_alg_name[64];
> > +	__u16	tcpa_flags;
> > +	__u8	tcpa_prefix;
> > +	__u8	tcpa_sndid;
> > +	__u8	tcpa_rcvid;
> > +	__u8	tcpa_maclen;
> > +	__u8	tcpa_keyflags;
> > +	__u8	tcpa_keylen;
> > +	__u8	tcpa_key[TCP_AO_MAXKEYLEN];
> > +} __attribute__((aligned(8)));
> > +
> > +struct tcp_ao_del { /* setsockopt(TCP_AO_DEL) */
> > +	struct __kernel_sockaddr_storage tcpa_addr;
> > +	__u16	tcpa_flags;
> > +	__u8	tcpa_prefix;
> > +	__u8	tcpa_sndid;
> > +	__u8	tcpa_rcvid;
> > +	__u8	tcpa_current;
> > +	__u8	tcpa_rnext;
> > +} __attribute__((aligned(8)));
> > +
> > +struct tcp_ao_mod { /* setsockopt(TCP_AO_MOD) */
> > +	__u16	tcpa_flags;
> > +	__u8	tcpa_current;
> > +	__u8	tcpa_rnext;
> > +} __attribute__((aligned(8)));
> > +
> >  /* setsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, ...) */
> >
> >  #define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1
> 
> 
> I do not see anything in the uapi that would specify the VRF for the
> address.

(Having not spotted the original...)

You've also got implicit padding in the API structures.
That is generally a recipe for disaster.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ