References: https://codeberg.org/jengelh/xtables-addons/issues/21
unsigned int hexa_size;
int ret;
bool fret = false;
- uint64_t x;
unsigned int epoch_min;
/* Concurrent use fenced off by a caller which holds list_lock. */
struct shash_desc *shash = (void *)crypto.desc; // SHASH_DESC_ON_STACK part 2
hexresult = kzalloc(hexa_size, GFP_ATOMIC);
if (hexresult == NULL)
return false;
- x = ktime_get_seconds();
- do_div(x, 60);
- epoch_min = x;
+
+ /* Time needs to be in minutes relative to epoch. */
+ {
+ time64_t t = ktime_get_real_seconds();
+ do_div(t, 60);
+ epoch_min = t;
+ }
ret = crypto_shash_setkey(crypto.tfm, secret, secret_len);
if (ret != 0) {