From patchwork Wed Feb 11 03:58:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Torvalds X-Patchwork-Id: 438669 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EC43C1401D0 for ; Wed, 11 Feb 2015 14:58:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751118AbbBKD6Z (ORCPT ); Tue, 10 Feb 2015 22:58:25 -0500 Received: from mail-ig0-f175.google.com ([209.85.213.175]:45566 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbbBKD6Y (ORCPT ); Tue, 10 Feb 2015 22:58:24 -0500 Received: by mail-ig0-f175.google.com with SMTP id hn18so28312473igb.2; Tue, 10 Feb 2015 19:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=obpdhXAoxAtGxJz3mbQronHRwlYyWdUQV/QI96x4Hqw=; b=GklTBNvU5KZy5NEMEUX/UWOR1gbSgNk1j+FdqGAEzZUYl/taOEeYEn+30kfF+EW69b LWD4wRjh16PxI41cpNeohhyDhWGt7IBIBchQo7ILjFDt0ZP68Vfn/PpH2B8ADLWXI0jW SfssyQSPGzh9TdZOsNR4gTj9zaFWsTRdV6P5TSoC9ETPTH11qLfpfSvavtcmUHVhYh35 f1wPihJ3O3RV8c5vqImF2n0wbPEYqTjQJQg7he3BIzcg11GZAzgLbDaG1PgNpBxZK1Pe 7aC+Hbp6hG/th0SBs0QbiGQFWAAqczv6iCc4wPL4dGD3v7jV4gNFo4kt8HMJ+CUTh7at J9tQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=obpdhXAoxAtGxJz3mbQronHRwlYyWdUQV/QI96x4Hqw=; b=JARcG+xAvfuF2LRhXR5IxI3ygaTY+2p7R4r8K8fF1gQu+dnKkeprBBFo2tKzWu0w8p b0lNs5vkkAokSFUj4fvaFD7qreSru3D8Exs3LUV1joh80vHEYclxghFDWU0iZAIdahGT CCyV6Kk+EhO0/DVhnzilQ4dZS/NFKXIow7KFg= MIME-Version: 1.0 X-Received: by 10.50.49.43 with SMTP id r11mr27951246ign.18.1423627103001; Tue, 10 Feb 2015 19:58:23 -0800 (PST) Received: by 10.36.58.135 with HTTP; Tue, 10 Feb 2015 19:58:22 -0800 (PST) In-Reply-To: References: <20150209.191601.1373941323785500419.davem@davemloft.net> <20150209.205209.1524645061817000265.davem@davemloft.net> <20150211014502.GB29656@ZenIV.linux.org.uk> Date: Tue, 10 Feb 2015 19:58:22 -0800 X-Google-Sender-Auth: FUKop4btO0Ik6U9gHx5LC8h44Lc Message-ID: Subject: Re: [GIT] Networking From: Linus Torvalds To: Al Viro Cc: David Miller , Andrew Morton , Network Development , Linux Kernel Mailing List Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Feb 10, 2015 at 6:01 PM, Linus Torvalds wrote: > > Are there no tests for that crypto interface? Oh well. With the attached, it at least does boot and work for me. Linus crypto/af_alg.c | 2 +- crypto/algif_skcipher.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crypto/af_alg.c b/crypto/af_alg.c index eb78fe8a60c8..3e80d8b8be45 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -348,7 +348,7 @@ int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len) if (n < 0) return n; - npages = PAGE_ALIGN(off + n); + npages = (off + n + PAGE_SIZE - 1) >> PAGE_SHIFT; if (WARN_ON(npages == 0)) return -EINVAL; diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 37110fd68adf..6fc12c3fc4b9 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c @@ -439,14 +439,13 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock, while (!sg->length) sg++; - used = ctx->used; - if (!used) { + if (!ctx->used) { err = skcipher_wait_for_data(sk, flags); if (err) goto unlock; } - used = min_t(unsigned long, used, iov_iter_count(&msg->msg_iter)); + used = min_t(unsigned long, ctx->used, iov_iter_count(&msg->msg_iter)); used = af_alg_make_sg(&ctx->rsgl, &msg->msg_iter, used); err = used;