[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAG8fp8R+2TztxYKcLwU354mQ47mD7RPQKarxnzA+j2ydtqamBg@mail.gmail.com>
Date: Fri, 2 Jun 2023 22:03:41 +0900
From: Akihiro Suda <suda.kyoto@...il.com>
To: David Laight <David.Laight@...lab.com>
Cc: Kuniyuki Iwashima <kuniyu@...zon.com>, "edumazet@...gle.com" <edumazet@...gle.com>,
"akihiro.suda.cz@....ntt.co.jp" <akihiro.suda.cz@....ntt.co.jp>,
"akihirosuda@....sr.ht" <akihirosuda@....sr.ht>, "davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"segoon@...nwall.com" <segoon@...nwall.com>
Subject: Re: [PATCH linux] net/ipv4: ping_group_range: allow GID from
2147483648 to 4294967294
2023年6月2日(金) 19:51 David Laight <David.Laight@...lab.com>:
>
> From: Kuniyuki Iwashima
> > Sent: 01 June 2023 00:00
> ....
> > > > --- a/include/net/ping.h
> > > > +++ b/include/net/ping.h
> > > > @@ -20,7 +20,7 @@
> > > > * gid_t is either uint or ushort. We want to pass it to
> > > > * proc_dointvec_minmax(), so it must not be larger than MAX_INT
> > > > */
> > > > -#define GID_T_MAX (((gid_t)~0U) >> 1)
> > > > +#define GID_T_MAX ((gid_t)~0U)
>
> Doesn't that comment need updating?
>
> I do wonder how much code breaks for gid > MAXINT.
> How much testing does it actually get??
It is fixed in v3:
https://patchwork.kernel.org/project/netdevbpf/patch/20230601031305.55901-1-akihiro.suda.cz@hco.ntt.co.jp/
```
-/*
- * gid_t is either uint or ushort. We want to pass it to
- * proc_dointvec_minmax(), so it must not be larger than MAX_INT
- */
-#define GID_T_MAX (((gid_t)~0U) >> 1)
+#define GID_T_MAX (((gid_t)~0U) - 1)
```
Tested with 4294967294, 4294967295 (EINVAL), and 4294967296 (EINVAL), on x86_64.
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
Powered by blists - more mailing lists