From nobody Fri Jun 19 20:12:24 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80EF9C433EF for ; Tue, 29 Mar 2022 04:30:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232062AbiC2Ebw (ORCPT ); Tue, 29 Mar 2022 00:31:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232046AbiC2Ebs (ORCPT ); Tue, 29 Mar 2022 00:31:48 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D75F431DFD; Mon, 28 Mar 2022 21:30:04 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id c2so13810006pga.10; Mon, 28 Mar 2022 21:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iDv+72tnbPCd3DSLzaLYf0PTI9YrKoCtiTHll5hbSxo=; b=jJnV3Ih/oQvR9wHom+3vpmtd3WXbglHQxRDbZr9Q5Tc7KHuzA1EEQhUEe57ncOvz5G r4R3qDGTfcXPHn0GCXivRC8r/dM4Y95AkcXP+e87zNJDHF8lFNlkaHEz9xNazptn0ac7 S+g87nqAQhyIbCqH78tDCUl7ETMEb7ascQZfeSsnbShExQjeZAYpaXhmXC3CuCtZed/2 hLxew3DWwdqSB3QvsQ2ckrXxDinmONmrAEK4lshzSJV4MxTqQH7jojUmkYZ35VGlsQCc MO+PoFHMnqDWL4eQB5p25G4awe1UT32IM/mbASZS2+50LJmtwvJSc6SsO07XhPl3tfIN rYRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iDv+72tnbPCd3DSLzaLYf0PTI9YrKoCtiTHll5hbSxo=; b=XkDKQcYgoOm6117rE1nL7LIDpSuuy03UYKySuLVztaYT8yj+w7Yl8amCpN4Ya/84zk eEhdmrug5gcMJ0hE3hCaeJOWfEwPFh7FCdjyWIh96mIFTb/4+4PAlF5b2WQlQUUqcp+b S7Kz4xFjPoCjHnqF83fbExzqaqRJKAi6Si49aK9snX4/kUrSeZzpFhNFESaun4H7H6Tw KOhn+el5QgXFV2NEcVnuhXJSq5dt18WUbX82M0bvNcIqSi7U+vAwrmstwbfpNkvKAEkT wK/mbuc1cSvnIZcWBH1jmJ16KoWbbA9R//O1ZnUPUGddPf67g23b1N6LtYumJBVzfwpW ixEA== X-Gm-Message-State: AOAM530iIhdmXHfIEDGH8+k/RYIXfRc0hrJbuWlHq7HtrLe1Bu7QhkQM G6yrMajW0CTWz0f5A/T42e95AEV15G/d7srE X-Google-Smtp-Source: ABdhPJyvyJiYFgSNnFXkb+GtudDniCtET5BHrKjd/lCTO//44FydLMM3GMybITqswKXMHeU6+3CjpQ== X-Received: by 2002:a63:4421:0:b0:385:d870:d598 with SMTP id r33-20020a634421000000b00385d870d598mr604204pga.361.1648528203991; Mon, 28 Mar 2022 21:30:03 -0700 (PDT) Received: from ubuntu.mate (subs32-116-206-28-55.three.co.id. [116.206.28.55]) by smtp.gmail.com with ESMTPSA id z13-20020a17090a468d00b001c7db8e6ac7sm1055075pjf.40.2022.03.28.21.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 21:30:03 -0700 (PDT) From: Bagas Sanjaya To: linux-doc@vger.kernel.org Cc: Bagas Sanjaya , Jonathan Corbet , Eric Biggers , Herbert Xu , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] Documentation: siphash: convert danger note to warning for HalfSipHash Date: Tue, 29 Mar 2022 11:29:51 +0700 Message-Id: <20220329042952.10100-2-bagasdotme@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220329042952.10100-1-bagasdotme@gmail.com> References: <20220329042952.10100-1-bagasdotme@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Render danger paragraph into warning block for emphasization. Cc: Jonathan Corbet Cc: Eric Biggers Cc: Herbert Xu Cc: Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya --- Documentation/security/siphash.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/security/siphash.rst b/Documentation/security/si= phash.rst index bd9363025fcbc1..42794a7e052f1e 100644 --- a/Documentation/security/siphash.rst +++ b/Documentation/security/siphash.rst @@ -121,12 +121,12 @@ even scarier, uses an easily brute-forcable 64-bit ke= y (with a 32-bit output) instead of SipHash's 128-bit key. However, this may appeal to some high-performance `jhash` users. =20 -Danger! - -Do not ever use HalfSipHash except for as a hashtable key function, and on= ly -then when you can be absolutely certain that the outputs will never be -transmitted out of the kernel. This is only remotely useful over `jhash` a= s a -means of mitigating hashtable flooding denial of service attacks. +.. warning:: + Do not ever use HalfSipHash except for as a hashtable key function, and + only then when you can be absolutely certain that the outputs will never + be transmitted out of the kernel. This is only remotely useful over + `jhash` as a means of mitigating hashtable flooding denial of service + attacks. =20 Generating a HalfSipHash key =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D --=20 An old man doll... just what I always wanted! - Clara From nobody Fri Jun 19 20:12:24 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BACAC433F5 for ; Tue, 29 Mar 2022 04:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232072AbiC2Eb4 (ORCPT ); Tue, 29 Mar 2022 00:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232029AbiC2Ebt (ORCPT ); Tue, 29 Mar 2022 00:31:49 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D878831DF9; Mon, 28 Mar 2022 21:30:07 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id m22so16273673pja.0; Mon, 28 Mar 2022 21:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MoKiGu5hYYcfsxqQHX2Q84Bhs0fRLBU9UCfGUfeAlqU=; b=Au2SrM8R77nRJEsjHHjDlmyULoPonsfJ0BHPyx/Is3t/4LJJtGByzA5KdUbwSKuPOj j4y2syTcOwAUCs8C/znaY02NnsYisYySvX5hc0ibHmRB7sv7fypxk734RgZGLU3EWoPv xUw0GMExIbn7X/6asOAI85Urn8aNkC2Y7alS9gCsiUutHXqXPPk8ghBfG2lKKR0NlHKk iEKdEbhiiZ3Lfz96fAFLIXD3yZhHiAeuOqoJiRmx3cjrRWhmnbEA3fbu+I6itlVl7C/R 2nzle3WGfbB9UHkkrliasqMdrAhcIXNK+J2mvTj4R3fXf3yKUJs3UnRGY6068y53PFC4 37ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MoKiGu5hYYcfsxqQHX2Q84Bhs0fRLBU9UCfGUfeAlqU=; b=nC2IfjRdakfzjIEhzlA2L8a4icx2nV4NS3QNtXLQ0xBbd8PzSNyqBkc7wT/GDGWoOE 0YjvFdIMMdAzGJrFWhbFG/90ld7/mEbXEqWS/2iG/v+riZryfoRnMNgAF9EonBZCyBHU GtoysGQGNBpZgEzysSe+8MV93DW3BiBCzwpchZOes8wSf739nUvaZwa2yYUM4Aa9JVyC kLjtR9YSx/nxJBMKZ96jKJnRRY5EREWowuRkpkPk5RXlRmai3aIoD3AFDu9wtePLKsuh 57IbMaZ9LwCdIXSRQaGRJ2qgBJg43A9/D7wBwimv+2t7TVhHfk8POoj1/kL1cmpCDA5B DFqA== X-Gm-Message-State: AOAM531Q5pDuoScb+Dg5uiCzTGUhsVRVgQDLb7DbPkV702iNhdvVAVCR 8GS8u0TbT7kdeVif8HlNUM/3QKgztvULFPLV X-Google-Smtp-Source: ABdhPJzopJffa3nKRux0NAzenVywEvJVTG3QPXObTupAnI8b/jhHatCtubi4mhXVMBty9iZZ+MqGFA== X-Received: by 2002:a17:90b:164f:b0:1c7:8d27:91fc with SMTP id il15-20020a17090b164f00b001c78d2791fcmr2583548pjb.228.1648528207087; Mon, 28 Mar 2022 21:30:07 -0700 (PDT) Received: from ubuntu.mate (subs32-116-206-28-55.three.co.id. [116.206.28.55]) by smtp.gmail.com with ESMTPSA id z13-20020a17090a468d00b001c7db8e6ac7sm1055075pjf.40.2022.03.28.21.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 21:30:06 -0700 (PDT) From: Bagas Sanjaya To: linux-doc@vger.kernel.org Cc: Bagas Sanjaya , Jonathan Corbet , Eric Biggers , Herbert Xu , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] Documentation: siphash: enclose HalfSipHash usage example in the literal block Date: Tue, 29 Mar 2022 11:29:52 +0700 Message-Id: <20220329042952.10100-3-bagasdotme@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220329042952.10100-1-bagasdotme@gmail.com> References: <20220329042952.10100-1-bagasdotme@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Render usage example of HalfSipHash function as code block by using literal block syntax. Cc: Jonathan Corbet Cc: Eric Biggers Cc: Herbert Xu Cc: Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya --- Documentation/security/siphash.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/security/siphash.rst b/Documentation/security/si= phash.rst index 42794a7e052f1e..06d793e680869c 100644 --- a/Documentation/security/siphash.rst +++ b/Documentation/security/siphash.rst @@ -132,10 +132,10 @@ Generating a HalfSipHash key =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =20 Keys should always be generated from a cryptographically secure source of -random numbers, either using get_random_bytes or get_random_once: +random numbers, either using get_random_bytes or get_random_once:: =20 -hsiphash_key_t key; -get_random_bytes(&key, sizeof(key)); + hsiphash_key_t key; + get_random_bytes(&key, sizeof(key)); =20 If you're not deriving your key from here, you're doing it wrong. =20 --=20 An old man doll... just what I always wanted! - Clara