Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3988764pxy; Tue, 4 May 2021 14:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHE8D6Uy3F024zGcfU/giSHDrR3OJw0/d6xsVEQ9CMJCtLWPsxdhsFEJ81AQ0QgsIXFRq3 X-Received: by 2002:a05:6a00:781:b029:27c:d3f6:d019 with SMTP id g1-20020a056a000781b029027cd3f6d019mr25524165pfu.42.1620165495615; Tue, 04 May 2021 14:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620165495; cv=none; d=google.com; s=arc-20160816; b=eCt6+4++phz9IwjZpeIrRja1j/liAhIqzX+a822//3JNjb6VqLCgfKRpf7PA5vQHhT /IbNSYbzUCBQBS8kOEyKR/MsRM88aQIg+8VCB+FKaQSceNvo9Y8pd0hnEQbK7pBC/5MB YIBLjR9IhsSMSYjsA9mshraRFrgn6mU3iUt+9WomfAaomxOc8/Q2KR3SGgV5Svx90Aaj oM30jQU5+r0QToW26OaqJ7CULaN7zCo3aSgazuOGDFAJ/xcFxKTkK/Pm/9o+l3mDsh/G 5nvnOT7G7reZqfDPXYrv6Fc6INK6T5LxPpqKQ6CoaL68adUfPyj1DbQZ7FVilA8A0T89 IFOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iGXP3EbGVsgBPRHWGw2VfIcF7R50zDLEimoFYAGOcao=; b=0LilJcUu0zQbJWhWHAkOkW4ap7tkvhamcrSlUsaZ9/DOx5xzQrkuTxfwMx4gvcYCYB XTvrG2bc3as5PLGMvBxIfCeWLIrSizEwvh5XkiN/9lPCcI/eAMIV7tgmY9ayxaDNdBj5 3rabCj+HEK2H9Pak8Ra9pwbTGWWBUR63xRAwdslRAg52iO/j5gS2bJfCtp4QKdhDnRsA LxZE7yPdl0QWHOeXJMqsPnchEptofpq/umHfY/l6B/I/dhlqR8/qraiLntJpd4ktI+rO AC+8XKMRNkgLnHfOrZ1UU1ujgLP2jlLmVOpIcizTBX4mEulOu/cyrFic7HDAb6KHtEUG E//A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@o2.pl header.s=1024a header.b=Q3s1wwCz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=o2.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si4355027plp.119.2021.05.04.14.58.02; Tue, 04 May 2021 14:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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 (test mode) header.i=@o2.pl header.s=1024a header.b=Q3s1wwCz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=o2.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231612AbhEDUWP (ORCPT + 99 others); Tue, 4 May 2021 16:22:15 -0400 Received: from mx-out.tlen.pl ([193.222.135.145]:21828 "EHLO mx-out.tlen.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230425AbhEDUWN (ORCPT ); Tue, 4 May 2021 16:22:13 -0400 Received: (wp-smtpd smtp.tlen.pl 27422 invoked from network); 4 May 2021 22:21:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1620159674; bh=iGXP3EbGVsgBPRHWGw2VfIcF7R50zDLEimoFYAGOcao=; h=From:To:Cc:Subject; b=Q3s1wwCzi6/6a2mE9Zsr9Omz53sZqfUEmEsXqC1iZMUVOK/KDjUy+3GIy81WjX0Ak 3UMR0y6cvSwJpGb0xsd76YSdhWtjKVb5YUPaY9sNL/+y7wTMkCliTiAS3NCNhh2dG+ VFQajAkQ7z6ZyXBvLpKumk11yygT09UPJ4ysdXsw= Received: from 89-64-47-21.dynamic.chello.pl (HELO swift.dev.arusekk.pl) (arek_koz@o2.pl@[89.64.47.21]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 4 May 2021 22:21:14 +0200 From: Arusekk To: Linus Torvalds Cc: Greg Kroah-Hartman , Christoph Hellwig , Linux Kernel Mailing List , linux-fsdevel , Alexey Dobriyan , Al Viro Subject: Re: [PATCH v3] proc: Use seq_read_iter for /proc/*/maps Date: Tue, 04 May 2021 22:23:20 +0200 Message-ID: <1777114.atdPhlSkOF@swift.dev.arusekk.pl> In-Reply-To: References: <20210504115358.20741-1-arek_koz@o2.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-WP-MailID: 9eed0ce6127d49d4a8d64fa6b82a7ea7 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000005 [IaaQ] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We wtorek, 4 maja 2021 18:01:33 CEST Linus Torvalds pisze: > it's one of the reasons I didn't feel like doing splice() on > everything should be encouraged. This is why I agreed to change only /proc/*/maps. > The only reason to do this is basically for nefarious purposes, No real exploit I can think of needs to send this specific file, there are better candidates in procfs already. It only helps inspecting memory mappings off-line more reliably than LD_TRACE_LOADED_OBJECTS=1 in as little bytes as possible. Or maybe should it be discouraged on regular ext4 files as well? > Yes, yes, I'm sure pwntools can be used by white hats, but honestly, > that seems to be an almost secondary purpose. You got me. But honestly, I disagree, I have already seen pwntools used by malware analysts and python fans. > Why should the kernel _encourage_ and make it easy to do things like > this? What are the actual advantages for us to do this? Keeping it the way it is for the sake of security of userspace applications looks more like security through obscurity to me. I still agree that it may increase attack surface of the kernel. I did not try racing misaligned splices, nor mmapping files with strange names. Pwntools need to be adapted anyway in order to support 5.10-5.13 kernels; I just thought that this is a kind of a regression in the kernel, so I felt obliged to contribute a fix here, especially after I realized how simple the fix was. I heard that patches and their descriptions must really be top quality, but I was not prepared for justifying the change with anything more than 'it used to work, but is broken now, this patch brings it back'. -- Arusekk