Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1444101pxa; Thu, 20 Aug 2020 11:25:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKnycBDoAE25+qpR0bpleKasFUatQrNCKzdpfxOeNHQEOAmFM/8n0b5zswoOmMC+KVbk92 X-Received: by 2002:a50:f411:: with SMTP id r17mr4088793edm.190.1597947920568; Thu, 20 Aug 2020 11:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597947920; cv=none; d=google.com; s=arc-20160816; b=xWhlzpX9GgnQsSH9PMZni/S75ZI6jSCZ5ZSnWcYfI2MklHzCnPDuVwNhhRCwECr731 Bp0giwN88goPGjesQwfrJEQEoJYNwj/lc/KQK+Tq0KEnLZNamUEUvo/AuV5KSlsAITVX jHl/3UmnliPOFAy4/fz8paU3DZaxtUTkVkZ9BJsLR6uqNewDWoFBHLJ7lBdU7UHEdqpR M5K6fA2NPQUvEY4wYsd18eLODxlpcg3PDARdtNmC+fOKSqW8imR47dLhwITyH04LCzNG ORiGDtvdNp92HuWGgIB9J/S8daoQgZ4ND7aJTA53E8Nl2KtHvYk1H/kndMiCm+lYSxWd Qbsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=fvTqtYfqSBP44NndKxZyWLKql26hZyGNRfwuM0R6VFc=; b=SO56jTr+z4SuyNEHkPpYN8Q3td8QRk69HMg+uJP0ZZgUJ1QmR16nJvFO5CjBlE6gJ7 WzQVDgJO4oSOQdIgt8ppPHxUD1uXTpRsiYeoNj6NsUfbXvIRD1HkdfReBum8cd16u6Rh Q4a2P/oAVXrdSbSmAxjAmV04aNjGEHcWNG8OesA+81SWYMOzKYXtTgPHZQiADTRN52Uy xCY5ZvsT/5J4sM96rZKVjyfWQzE7I5tgzx+lnIWEYctNJt2g7LGWPJZ1kYzYXDtV3R02 t6UjRC95ku98qtQ1NXZN/yFXjSGSMQKnWmSPN2bafOHWvEDp2eX1hzEEHMuNIKK2Fbtu qq3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uLbZnRzD; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si1762253ejc.182.2020.08.20.11.24.55; Thu, 20 Aug 2020 11:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uLbZnRzD; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727063AbgHTSVX (ORCPT + 99 others); Thu, 20 Aug 2020 14:21:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:54294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbgHTSVS (ORCPT ); Thu, 20 Aug 2020 14:21:18 -0400 Received: from sol.hsd1.ca.comcast.net (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 90F7E208E4; Thu, 20 Aug 2020 18:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597947677; bh=3aYHNG2HuqdhvavloLqNptJ3Ruqd8JnmWbP5SYLc6Wc=; h=From:To:Cc:Subject:Date:From; b=uLbZnRzDri2ck4cV0adxN47EiNtKH10LxcAg+L4o3DpW8Kj/NijZd/jZBa4UlZ3Pi zIZOJpTBqilKf/I5oe3iMvRIjevANsfw8V7byWoGUax55oZnyunjrzxGfhfaazdRYr PHUdbhdPuhePfCOfOvHnT06KrjkBV3QCFAhSZV+o= From: Eric Biggers To: ltp@lists.linux.it Cc: linux-crypto@vger.kernel.org, Naresh Kamboju Subject: [LTP PATCH 0/2] ltp: fix af_alg02 to specify control data Date: Thu, 20 Aug 2020 11:19:16 -0700 Message-Id: <20200820181918.404758-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org It isn't clearly defined what happens if you read from an AF_ALG request socket without previously sending the control data to begin an encryption or decryption operation. On some kernels the read will return 0, while on others it will block. Testing this corner case isn't the purpose of af_alg02; it just wants to try to encrypt a zero-length message. So, change it to explicitly send a zero-length message with control data. This fixes the test failure reported at https://lkml.kernel.org/r/CA+G9fYtebf78TH-XpqArunHc1L6s9mHdLEbpY1EY9tSyDjp=sg@mail.gmail.com Fixing the test in this way was also previously suggested at https://lkml.kernel.org/r/20200702033221.GA19367@gondor.apana.org.au Note, this patch doesn't change the fact that the read() still blocks on pre-4.14 kernels (which is a kernel bug), and thus the timeout logic in the test is still needed. Eric Biggers (2): lib/tst_af_alg: add tst_alg_sendmsg() crypto/af_alg02: send message with control data before reading include/tst_af_alg.h | 32 +++++++++++++++ lib/tst_af_alg.c | 64 ++++++++++++++++++++++++++++++ testcases/kernel/crypto/af_alg02.c | 21 ++++++++-- 3 files changed, 114 insertions(+), 3 deletions(-) -- 2.28.0