Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3406164imu; Mon, 17 Dec 2018 20:07:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/VZzYPr4fU/KRX/uYuiUclTuG/oCvi6UFkQwzx3s3jB4n1Eq51WtY1ESG7jzChAfh3E4GK4 X-Received: by 2002:a63:f444:: with SMTP id p4mr14287269pgk.124.1545106064365; Mon, 17 Dec 2018 20:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545106064; cv=none; d=google.com; s=arc-20160816; b=dNXtkpD5Lz1RbAlMJRYqHMvGwypZ15T2z50JXb7UBlG6TLaGA9fqUM4zzLrMAxGXs3 qdQAhlJZ1+Jy71anb09nsJ4pjOdpTUniT2gpbW8ZN2a11EmYTHU3TXty3u8ikAXGpjJ+ APDpY5sF2e/XlZY2NIYatEQFqtG9Q79m3++0PVIq85+SvCwocgduR3+nzxNTPySBA89c +3FeDOfnG9jh8o6Bodj3qgVoZZ+NzEU9dExJNu+0G+qt1KEXKttlQKqSvB0ga/npxzm8 12FV10xj0imuRt5ne60RWGmkuYaUYpUE2ceHRmndoWtK9T6LFHiS4xAA5x6DyT0VFp1V eMnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=0EEf56/6lukeoqrOXpuGbhZAQuBIHSerGzGW/LZEDrw=; b=A90DrH29Vo1Nd+pwkXL3V5y0vLFKG8HTjalIo0QCI77XnUXFfz/Pmoco1bw2X+lsD9 8QN6NM4sZxXf7CicgaGKemDLl9i6BdzsdfHafKxFNp34EsNwaPRnxfMExf7sDc5AUtd/ 0cBG+IJ9Y8c/lGl73SqdPCt1Wi7y8rqiEpgE3kuszf5yVg3miK/eHSObLw8ahdHq+HkV uhwDV04/5N14rNCo9d4w89ARC4m4hAuIWsPFaauo0vL6BoOFai2P1RI7vmgIlr26hL6v ljv1xA8WHYfI3IbErMsJz2Q2HE8RUQ+HZqAkvkFrli1Gl8zl9/Jf7H0KCLR5LTjUzmFb FkVQ== 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 x16si11249252pga.407.2018.12.17.20.07.26; Mon, 17 Dec 2018 20:07:44 -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 S1726371AbeLREGe (ORCPT + 99 others); Mon, 17 Dec 2018 23:06:34 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:37964 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726296AbeLREGd (ORCPT ); Mon, 17 Dec 2018 23:06:33 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.91 #2 (Red Hat Linux)) id 1gZ6eL-00072K-MV; Tue, 18 Dec 2018 04:06:29 +0000 Date: Tue, 18 Dec 2018 04:06:29 +0000 From: Al Viro To: Mimi Zohar Cc: Linus Torvalds , linux-integrity@vger.kernel.org, James Morris James Morris , Linux List Kernel Mailing Subject: Re: [PATCH] ima: cleanup the match_token policy code Message-ID: <20181218040629.GT2217@ZenIV.linux.org.uk> References: <1545092089.4206.5.camel@linux.ibm.com> <20181218013348.GR2217@ZenIV.linux.org.uk> <1545102007.4206.15.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1545102007.4206.15.camel@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 17, 2018 at 10:00:07PM -0500, Mimi Zohar wrote: > Could you expand on commit 5b2ea6199614 ("selinux: switch away from > match_token()") patch description. ?All that it says is "It's not a > good fit, unfortunately, and the next step will make it even less so. > Open-code what we need here." ?And there's even less for the > equivalent Smack patch, which just says "same issue as with > selinux...". match_token() would require messing around with strsep() or something equivalent. It's not a regex; foo=%s has no idea that comma is in any way special, etc. As for the next commit... Killing the Cthulhu-awful mess in selinux_sb_eat_lsm_opts() (allocating two temproraries, concatenating (comma-separated) non-LSM options into one, concatenating (pipe-separated) dequoted LSM options into another, then splitting that another by '|' instances and figuring out which option each piece is, etc.) is a Good Thing(tm). And having to dance around the needs of match_token() adds extra headache, for no good reason.