···15321532 This option enables the user-spaces interface for random15331533 number generator algorithms.1534153415351535-config CRYPTO_USER_API_AEAD15361536- tristate "User-space interface for AEAD cipher algorithms"15371537- depends on NET15381538- select CRYPTO_AEAD15391539- select CRYPTO_USER_API15401540- help15411541- This option enables the user-spaces interface for AEAD15421542- cipher algorithms.15431543-15441535config CRYPTO_HASH_INFO15451536 bool15461537
+4-5
crypto/algif_aead.c
···3434 /*3535 * RSGL_MAX_ENTRIES is an artificial limit where user space at maximum3636 * can cause the kernel to allocate RSGL_MAX_ENTRIES * ALG_MAX_PAGES3737- * bytes3737+ * pages3838 */3939#define RSGL_MAX_ENTRIES ALG_MAX_PAGES4040 struct af_alg_sgl rsgl[RSGL_MAX_ENTRIES];···436436 if (err < 0)437437 goto unlock;438438 usedpages += err;439439- /* chain the new scatterlist with initial list */439439+ /* chain the new scatterlist with previous one */440440 if (cnt)441441- scatterwalk_crypto_chain(ctx->rsgl[0].sg,442442- ctx->rsgl[cnt].sg, 1,443443- sg_nents(ctx->rsgl[cnt-1].sg));441441+ af_alg_link_sg(&ctx->rsgl[cnt-1], &ctx->rsgl[cnt]);442442+444443 /* we do not need more iovecs as we have sufficient memory */445444 if (outlen <= usedpages)446445 break;
+9-9
drivers/char/hw_random/bcm63xx-rng.c
···5757 val &= ~RNG_EN;5858 __raw_writel(val, priv->regs + RNG_CTRL);59596060- clk_didsable_unprepare(prov->clk);6060+ clk_disable_unprepare(priv->clk);6161}62626363static int bcm63xx_rng_data_present(struct hwrng *rng, int wait)···9797 priv->rng.name = pdev->name;9898 priv->rng.init = bcm63xx_rng_init;9999 priv->rng.cleanup = bcm63xx_rng_cleanup;100100- prov->rng.data_present = bcm63xx_rng_data_present;100100+ priv->rng.data_present = bcm63xx_rng_data_present;101101 priv->rng.data_read = bcm63xx_rng_data_read;102102103103 priv->clk = devm_clk_get(&pdev->dev, "ipsec");104104 if (IS_ERR(priv->clk)) {105105- error = PTR_ERR(priv->clk);106106- dev_err(&pdev->dev, "no clock for device: %d\n", error);107107- return error;105105+ ret = PTR_ERR(priv->clk);106106+ dev_err(&pdev->dev, "no clock for device: %d\n", ret);107107+ return ret;108108 }109109110110 if (!devm_request_mem_region(&pdev->dev, r->start,···120120 return -ENOMEM;121121 }122122123123- error = devm_hwrng_register(&pdev->dev, &priv->rng);124124- if (error) {123123+ ret = devm_hwrng_register(&pdev->dev, &priv->rng);124124+ if (ret) {125125 dev_err(&pdev->dev, "failed to register rng device: %d\n",126126- error);127127- return error;126126+ ret);127127+ return ret;128128 }129129130130 dev_info(&pdev->dev, "registered RNG driver\n");
+2-1
drivers/crypto/Kconfig
···466466source "drivers/crypto/vmx/Kconfig"467467468468config CRYPTO_DEV_IMGTEC_HASH469469- depends on MIPS || COMPILE_TEST470469 tristate "Imagination Technologies hardware hash accelerator"470470+ depends on MIPS || COMPILE_TEST471471+ depends on HAS_DMA471472 select CRYPTO_ALGAPI472473 select CRYPTO_MD5473474 select CRYPTO_SHA1
+15-1
include/linux/compiler-gcc.h
···99 + __GNUC_MINOR__ * 100 \1010 + __GNUC_PATCHLEVEL__)11111212-1312/* Optimization barrier */1313+1414/* The "volatile" is due to gcc bugs */1515#define barrier() __asm__ __volatile__("": : :"memory")1616+/*1717+ * This version is i.e. to prevent dead stores elimination on @ptr1818+ * where gcc and llvm may behave differently when otherwise using1919+ * normal barrier(): while gcc behavior gets along with a normal2020+ * barrier(), llvm needs an explicit input variable to be assumed2121+ * clobbered. The issue is as follows: while the inline asm might2222+ * access any memory it wants, the compiler could have fit all of2323+ * @ptr into memory registers instead, and since @ptr never escaped2424+ * from that, it proofed that the inline asm wasn't touching any of2525+ * it. This version works well with both compilers, i.e. we're telling2626+ * the compiler that the inline asm absolutely may see the contents2727+ * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=154952828+ */2929+#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")16301731/*1832 * This macro obfuscates arithmetic on a variable address so that gcc
+3
include/linux/compiler-intel.h
···1313/* Intel ECC compiler doesn't support gcc specific asm stmts.1414 * It uses intrinsics to do the equivalent things.1515 */1616+#undef barrier_data1617#undef RELOC_HIDE1718#undef OPTIMIZER_HIDE_VAR1919+2020+#define barrier_data(ptr) barrier()18211922#define RELOC_HIDE(ptr, off) \2023 ({ unsigned long __ptr; \
+4
include/linux/compiler.h
···169169# define barrier() __memory_barrier()170170#endif171171172172+#ifndef barrier_data173173+# define barrier_data(ptr) barrier()174174+#endif175175+172176/* Unreachable code */173177#ifndef unreachable174178# define unreachable() do { } while (1)