All of lore.kernel.org
 help / color / mirror / Atom feed
* A possible divide by zero bug in drbg_ctr_df
@ 2021-05-21  3:23 Yiyuan guo
  2021-05-21  6:48 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Yiyuan guo @ 2021-05-21  3:23 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, davem, Yiyuan guo

In crypto/drbg.c, the function drbg_ctr_df has the following code:

padlen = (inputlen + sizeof(L_N) + 1) % (drbg_blocklen(drbg));

However, the function drbg_blocklen may return zero:

static inline __u8 drbg_blocklen(struct drbg_state *drbg)
{
    if (drbg && drbg->core)
        return drbg->core->blocklen_bytes;
    return 0;
}

Is it possible to trigger a divide by zero problem here?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-21  7:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21  3:23 A possible divide by zero bug in drbg_ctr_df Yiyuan guo
2021-05-21  6:48 ` Herbert Xu
2021-05-21  7:27   ` Stephan Mueller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.