Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp111080rdf; Thu, 2 Nov 2023 15:32:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELuZguFkUAfjtgJY/ubH11vkpHUG9vk8tCcf4VcP6gjRMfh7+RPAP+7R17Y44KlrYdhusn X-Received: by 2002:a05:6e02:12cf:b0:357:4ebc:aa69 with SMTP id i15-20020a056e0212cf00b003574ebcaa69mr24434730ilm.23.1698964321130; Thu, 02 Nov 2023 15:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698964321; cv=none; d=google.com; s=arc-20160816; b=kvoXxDmgzC60Dh1IGKSUBpEEqX456o9JyNARSXMyQdB9vGzm+/isahUU05Igx6Np8v 5zHaOMIL3UhUe6Ar0svWI4JCFmp07auawG/25ir76yr1dPnheA4RwWK+ibL11EDdFTlM ZCpREsebRfEHzFyuLzxEP3hf5ma/LKgpq0DaaHn6eh/qd50zgGZe2poj75rw0SEqDo6e Oxjl8F0qzOLfdMxVPiCKgZcfChPT7E15CpkFpxPYb46X7hAkBATrHjt0Oi6WJ0DUgNfo DzGnjImQ1VHq6ssjn2gWMlBLJ3kf8eRs6bjxeD2dq8wZAbwDW1IpJm4ynP+rJI5AlfIY CZQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=G6ROTX3/i26xHE7RlpY5IFNyJGFvI/2topyQtl8SOM8=; fh=3DkfWbZF7O9mTujX+uddNVVmJhjTAGXjKU1HsngAIr4=; b=ZAzh5MXVFOxeUxjQR71litAW4UR3KgtgyArm4G5aVRj1X3/0IGAi4K9kKV05R+MwiE eUWWREWOWvp+qZrj6Gjy+YKfLiDz3mtbFT0cVWdzphS1mFYs7szJpFDUzuB3izExAr/l oLk/qxCVMJ/XY8kV0qrovDsukNa5gS2/94FWvihycENF2hRCsWytcP/YRKajRvam3Du0 pMRx43xMgPbWa7Ro56ck2CK/8iAJwHSysMnnPYWGUIXpeQpZJGTgcsq3E1WOOQhRGH3s bO6BqDaMDeimJm3hBNrN2pxbTOX8BP0zpQEVaiYb72phFtpzEM7W/CoFrXY/g5EQuhTD GoqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=jqfpFZJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d5-20020a656b85000000b005b205bdd324si371014pgw.697.2023.11.02.15.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:32:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=jqfpFZJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2760380755E1; Thu, 2 Nov 2023 15:30:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377494AbjKBWae (ORCPT + 99 others); Thu, 2 Nov 2023 18:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233730AbjKBWac (ORCPT ); Thu, 2 Nov 2023 18:30:32 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC94EDC; Thu, 2 Nov 2023 15:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=G6ROTX3/i26xHE7RlpY5IFNyJGFvI/2topyQtl8SOM8=; b=jqfpFZJpXbVr10t1Ve5lrWXj9H UESXuwg/8yGcOfYM4sDPvoF0l1MBrirBPG4LxJ7k5QpC7+88G4i+lc+9ydy2+wzgv1W3VhogZgI63 kBJpllcfkvVCKCMDjpxhyJCA+Cu6EyzaRUQ/HZIJ9AoX2lSn3qDghHHkddk4OA4HoD77NtAKRZP8J nwSu3rXaYSy5af/hG1gG9GkFdZhJ6L6lFwxofaNigqYs1f4MEqifC6Bj0jyz9U0eWu9Vw8QXmzssT 4rBuU5hHW2+IEf8CGqhFnta+Q2nT1gVA0Wc+eTpvSaa/I00fULMSran9vUTxwaBathezmxDBR1Zel hvFYb96A==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1qygCf-009zAh-2z; Thu, 02 Nov 2023 22:30:18 +0000 Date: Thu, 2 Nov 2023 22:30:17 +0000 From: Al Viro To: Philipp Stanner Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Stanislav Fomichev , Greg Kroah-Hartman , Benjamin Tissoires , linux-ppp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Airlie Subject: Re: [PATCH] drivers/net/ppp: copy userspace array safely Message-ID: <20231102223017.GO1957730@ZenIV> References: <20231102191914.52957-2-pstanner@redhat.com> <20231102200943.GK1957730@ZenIV> <7a26cd1bafb22b16eab3868255706d44fa4f255d.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a26cd1bafb22b16eab3868255706d44fa4f255d.camel@redhat.com> Sender: Al Viro X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 15:30:46 -0700 (PDT) On Thu, Nov 02, 2023 at 11:02:35PM +0100, Philipp Stanner wrote: > We introduced those wrappers to string.h hoping they will be useful. > Now that they're merged, I quickly wanted to establish them as the > standard for copying user-arrays, ideally in the current merge window. > Because its convenient, easy to read and, at times, safer. They also save future readers a git grep to find the sizes, etc. Again, the only suggestion is that regarding the commit message; _some_ of those might end up fixing real overflows and you obviously want to see how far do those need to be backported, etc. And "in this case the overflow doesn't actually happen because , but not having to do such analysis is a good thing" is not a bad explanation why the primitive in question is useful, IMO. Granted, in cases like 256 * sizeof(u32) that would be pointless, but for the ones that are less obvious... > I just didn't see it in ppp. Maybe I should have looked more > intensively for all 13 patches. But we'll get there, that's what v2 and > v3 are for :) In any case you want to check if there are real bugs caught in that.