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>] [day] [month] [year] [list]
Message-ID: <Yz7U99PPl8uHCLFY@ziepe.ca>
Date:   Thu, 6 Oct 2022 10:15:35 -0300
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     "Jason A. Donenfeld" <Jason@...c4.com>
Cc:     linux-kernel@...r.kernel.org, brcm80211-dev-list.pdl@...adcom.com,
        cake@...ts.bufferbloat.net, ceph-devel@...r.kernel.org,
        coreteam@...filter.org, dccp@...r.kernel.org, dev@...nvswitch.org,
        dmaengine@...r.kernel.org, drbd-dev@...ts.linbit.com,
        dri-devel@...ts.freedesktop.org, kasan-dev@...glegroups.com,
        linux-actions@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-block@...r.kernel.org,
        linux-crypto@...r.kernel.org, linux-doc@...r.kernel.org,
        linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
        linux-fbdev@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-hams@...r.kernel.org, linux-media@...r.kernel.org,
        linux-mm@...ck.org, linux-mmc@...r.kernel.org,
        linux-mtd@...ts.infradead.org, linux-nfs@...r.kernel.org,
        linux-nvme@...ts.infradead.org, linux-raid@...r.kernel.org,
        linux-rdma@...r.kernel.org, linux-scsi@...r.kernel.org,
        linux-sctp@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-usb@...r.kernel.org, linux-wireless@...r.kernel.org,
        linux-xfs@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        lvs-devel@...r.kernel.org, netdev@...r.kernel.org,
        netfilter-devel@...r.kernel.org, rds-devel@....oracle.com,
        SHA-cyfmac-dev-list@...ineon.com, target-devel@...r.kernel.org,
        tipc-discussion@...ts.sourceforge.net
Subject: Re: [PATCH v1 3/5] treewide: use get_random_u32() when possible

On Thu, Oct 06, 2022 at 07:05:48AM -0600, Jason A. Donenfeld wrote:

> > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > > index fd9d7f2c4d64..a605cf66b83e 100644
> > > --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > > @@ -465,7 +465,7 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id,
> > >               goto err_qp;
> > >       }
> > >
> > > -     psn = prandom_u32() & 0xffffff;
> > > +     psn = get_random_u32() & 0xffffff;
> >
> >  prandom_max(0xffffff + 1)
> 
> That'd work, but again it's not more clear. Authors here are going for
> a 24-bit number, and masking seems like a clear way to express that.

vs just asking directly for a 24 bit number?

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ