+ randomize_range-use-random-long-instead-of-int.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: drivers/car/random.c: randomize_range(): use random long instead of int
has been added to the -mm tree.  Its filename is
     randomize_range-use-random-long-instead-of-int.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/randomize_range-use-random-long-instead-of-int.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/randomize_range-use-random-long-instead-of-int.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: William Roberts <william.c.roberts@xxxxxxxxx>
Subject: drivers/car/random.c: randomize_range(): use random long instead of int

Use a long when generating the random range rather than an int.  This will
produce better random distributions as well as matching all the types at
hand.

Link: http://lkml.kernel.org/r/1469471141-25669-1-git-send-email-william.c.roberts@xxxxxxxxx
Signed-off-by: William Roberts <william.c.roberts@xxxxxxxxx>
Acked-by: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Theodore Ts'o <tytso@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/char/random.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/char/random.c~randomize_range-use-random-long-instead-of-int drivers/char/random.c
--- a/drivers/char/random.c~randomize_range-use-random-long-instead-of-int
+++ a/drivers/char/random.c
@@ -1837,7 +1837,8 @@ randomize_range(unsigned long start, uns
 
 	if (end <= start + len)
 		return 0;
-	return PAGE_ALIGN(get_random_int() % range + start);
+
+	return PAGE_ALIGN(get_random_long() % range + start);
 }
 
 /* Interface for in-kernel drivers of true hardware RNGs.
_

Patches currently in -mm which might be from william.c.roberts@xxxxxxxxx are

randomize_range-use-random-long-instead-of-int.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]
  Powered by Linux