mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Safonov <dima@arista.com>
To: David Miller <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, natechancellor@gmail.com,
	herbert@gondor.apana.org.au, steffen.klassert@secunet.com,
	netdev@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] netlink: Don't shift on 64 for ngroups
Date: Sun, 05 Aug 2018 01:37:09 +0100	[thread overview]
Message-ID: <1533429429.2679.156.camel@arista.com> (raw)
In-Reply-To: <20180804.170856.2031275734761112973.davem@davemloft.net>

On Sat, 2018-08-04 at 17:08 -0700, David Miller wrote:
> From: Dmitry Safonov <dima@arista.com>
> Date: Sun,  5 Aug 2018 00:55:44 +0100
> 
> > @@ -1011,8 +1011,8 @@ static int netlink_bind(struct socket *sock,
> struct sockaddr *addr,
> >  
> >       if (nlk->ngroups == 0)
> >               groups = 0;
> > -     else
> > -             groups &= (1ULL << nlk->ngroups) - 1;
> > +     else if (nlk->ngroups < sizeof(long unsigned int))
> > +             groups &= (1UL << nlk->ngroups) - 1;
> 
> Sizeof is in bytes, you want to compare against bits.

I'm too bad. Drop this version, please.
I've resent v2.

      reply	other threads:[~2018-08-05  0:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-04 23:55 Dmitry Safonov
2018-08-05  0:08 ` David Miller
2018-08-05  0:37   ` Dmitry Safonov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533429429.2679.156.camel@arista.com \
    --to=dima@arista.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome