From owner-freebsd-hackers@freebsd.org Wed Jul 8 18:14:48 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DFD8368EFA for ; Wed, 8 Jul 2020 18:14:48 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B26sM3qNqz4NrX for ; Wed, 8 Jul 2020 18:14:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f169.google.com with SMTP id k22so27250418oib.0 for ; Wed, 08 Jul 2020 11:14:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xmvR/ZPjsdBZVyu0sQrt43kcZELsn5B0BEIYLVdkEkE=; b=cif45mj8DQwC8BpPFuErUkMO5HvbGi69M50jgQ/Say+YHke6/T9TVAl+VrGNyorMvZ TUIypBXxovtp+Dw8QYPz5QdVR2PJwDHhEIz8wmXSpnja27lWrsLSmSEK7jSbhX7cxKGk O8+YVCJhp8EU2pSv+r5cNYu3VECo9a48JTpLfhazUzsFv3x/MH2zfzW3TGr7WFNEEHyA kihLC+thW90ixhMJoK9QUesgNYgvq7zocicRUiehzD+PZejXehv9zJMDdHCge55oc7/V 6PPvxi9FyrugBP5In/nlc8JCy670JAGmSt0L3IVpWU7iaR2vzHMtYcdZXv2kQeWIaZq1 o1EQ== X-Gm-Message-State: AOAM531k+inVnZlCSeRHB8xYpKPWtipOUSq2kJL54x9DxLBOpItQyG4z TF+VRl2bOzcfPqQ1ls1W2WwfDx8AiiaEk4zy6caA7HRW7/M= X-Google-Smtp-Source: ABdhPJxMwix+i2RCfpstOyqI8F/X9Ak0A7eE4Fzd63r+pXoC2cFqzrObxqfMwKAO0o+v1pM8QoTMhLsYMJ1Ts0nYURA= X-Received: by 2002:a54:4f9e:: with SMTP id g30mr8202114oiy.73.1594232086084; Wed, 08 Jul 2020 11:14:46 -0700 (PDT) MIME-Version: 1.0 From: Alan Somers Date: Wed, 8 Jul 2020 12:14:35 -0600 Message-ID: Subject: Are crypto(9) sessions thread safe? To: FreeBSD Hackers X-Rspamd-Queue-Id: 4B26sM3qNqz4NrX X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.169 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [0.96 / 15.00]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; ARC_NA(0.00)[]; NEURAL_SPAM_MEDIUM(0.13)[0.125]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.14)[-0.136]; DMARC_NA(0.00)[freebsd.org]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.03)[-0.025]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.169:from]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.169:from]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 18:14:48 -0000 Are the sessions returned by crypto_newsession safe to use concurrently from multiple threads? I ask because geli currently creates a separate thread pool for each provider, and I'm trying to change that to use a single global thread pool. So I need to know if different threads can share a crypto session, or if each geli provider will still need a pool of sessions. -Alan