Received: by 10.223.164.202 with SMTP id h10csp1738474wrb; Wed, 8 Nov 2017 08:54:35 -0800 (PST) X-Google-Smtp-Source: ABhQp+Rxu8yy10+BWolbKieJHJHHsbxF8zYq/uWRpGBOmlwnTgtY6zwl6O0Wp/Ll9ryhYHS3za++ X-Received: by 10.99.121.140 with SMTP id u134mr1034473pgc.16.1510160075586; Wed, 08 Nov 2017 08:54:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510160075; cv=none; d=google.com; s=arc-20160816; b=dnY8xzFvW29V3JmJwocjH1Ma7NfH2JsVxbPU0EjiVOTtWPMA2VfceM2jRZ38pUYaHl Pn4c5Z8jJVo/aVg9JiTrzSICjl0n1K8yeY/P6m/FksFuO0fHM2E09KL37idGVMk4x8AC q0qJUBf9aFYQO+kAceBuCn1fZTQBThcqL2auE/IF+kr9jmDMXXpEZfTzxZDISlUjltMK SsjwsuG7X7lhR7inF4HTc3mv8GRknm5qq502iOVNtQG0+HUpThF+HrG7XIYFOFcTOIPG UFfgPl6+389ntM6sn8NJOk4Ho9FHVH7UJOIGd3p0CUt8qvfFUxMyn/UA0TGEW5FvzXLn Gl2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=0PRZZzU9vwOlT3uxQuRDj0+qa+ymv5+6T7RBHv7/vN4=; b=nt/KdAi83t6FZqCqZMX0Vv3+oX3tazua1IxmqSOwCbfPcTKASVw1vmIgo+roa25/fZ 2CWfDJpu2llm8/f+tmeE/vo6eOaTdyKUPkYmqwJoEJ5i70k5ZtxVpJo8+8FOpqxeKJuW 8Etv1Q6P7JT4yPfXuLuCchKRgnk73vhmJxTlm/nmWeyENDnFAljV2SSkI2S58WRN7faL NJamTAGkSu1XXGQW0Cwaya16ySAc6a3r/ZKviBa5Tb/rB4HT3bQ0VeOrQSbAIC7Qpbq2 G3tvqrTjmJxc0bYT0zRzN1TSr9w9VXXCwT0MrKGFc0EpR1SmNNT5kIllDdeX1MWZNO0m ZdoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si3463410pls.445.2017.11.08.08.54.23; Wed, 08 Nov 2017 08:54:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752805AbdKHQwN (ORCPT + 84 others); Wed, 8 Nov 2017 11:52:13 -0500 Received: from mga14.intel.com ([192.55.52.115]:59026 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752256AbdKHQwM (ORCPT ); Wed, 8 Nov 2017 11:52:12 -0500 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Nov 2017 08:51:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,365,1505804400"; d="scan'208";a="147522933" Received: from gklab-125-020.igk.intel.com ([10.91.125.20]) by orsmga004.jf.intel.com with ESMTP; 08 Nov 2017 08:51:49 -0800 From: Lukasz Odzioba To: herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org Cc: lukasz.odzioba@intel.com Subject: RE: [2/4] crypto: af_alg - Allow arbitrarily long algorithm names" email-alg_bind.txt Date: Wed, 8 Nov 2017 17:51:36 +0100 Message-Id: <1510159896-26362-1-git-send-email-lukasz.odzioba@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I found this patch by accident and it got my attention. I think we can't make this name arbitrarily long because bind syscall checks addrlen before feeding protocol with it. Current limit on my machine is 128 bytes and I can't even reach alg_bind() function if I specify more than that. We may want to revert that. net/socket.c: SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) { struct socket *sock; struct sockaddr_storage address; int err, fput_needed; sock = sockfd_lookup_light(fd, &err, &fput_needed); if (sock) { err = move_addr_to_kernel(umyaddr, addrlen, (struct sockaddr *)&address); (...snip...) int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr) { if (ulen < 0 || ulen > sizeof(struct sockaddr_storage)) return -EINVAL; Thanks, Lukas From 1587900718862404546@xxx Wed Dec 27 02:02:12 +0000 2017 X-GM-THRID: 1585184082520044658 X-Gmail-Labels: Inbox,Category Forums