Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2538485ybt; Tue, 16 Jun 2020 08:33:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy11yywB49SbxYgevb5Pv4YPg04TjNZMJYjzwVeUaruj9QRdQarcnWetF9nfnLHv44+NaF1 X-Received: by 2002:aa7:c682:: with SMTP id n2mr3026304edq.18.1592321618144; Tue, 16 Jun 2020 08:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592321618; cv=none; d=google.com; s=arc-20160816; b=qskEiS8D4B9bR8XQGRczwt47Zn333h9C2I6+Hx1HhG4sc2x2mAUTdNhGhAeZRmDSa3 sslw2w//1LMUyjcrCMkIdxrdlMt5OvgmFntWX/Iitgt5+tVsvgaWxf4KSBNdmGhgXIf1 FC9LncA8BLBUCL22a1yI/0zt0e6qJ9R9huC6c5QvpQ+6OnxH72awpHTSRef5YfG0XVsc hJtNA/vz8P2IOyu677cKSaPyW8wFbUs+/CNmklkB3AdMJZcCQcjVAJLYgds9OK6J5icJ UL+lxU5TY7TBbdyfhrjMZY1rxTpYJJIX+/v04LUkcsODkfdmrBMAzth57rvVD+PG6p1L 6ItQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=prvuib5zQmcv0KtPefPihKfecw6gAeEldQvoe7ZUcw8=; b=tnJ3Sa93r5TBS1DnXzAyxs5eIa1ovPmWxzGWvrI/+y0E5vUQqHYp4xE3qmLXJIlLF7 hIH1YRcJKeMBJO5lEhyG+owcc24Wvu1yEjNMc5WsYG03jMKhLuM+uxRsjdoL9JYCz/UN ciVOeoWHi4gRVDqNJOCi4oCAbbYzfhW4ds8KCOttlG50OeLWLd9UUJH0qJLZanoGWaDX 4wBqhaPkXDOrK/VzYrIC82H1/12w6hqNagDAnvJ/Li7bmHqIyWTc6JbA0lIORu9Wft+/ GvveM6hWl5VA3zY9Y60I+0hDZuU3j628FipGV4nqIAhLNB/OrkWCDUxhDZcC29lSs1Ng So+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J+t3P92G; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw28si10355108edb.23.2020.06.16.08.33.15; Tue, 16 Jun 2020 08:33:38 -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 header.i=@redhat.com header.s=mimecast20190719 header.b=J+t3P92G; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729227AbgFPP33 (ORCPT + 99 others); Tue, 16 Jun 2020 11:29:29 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:35261 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728919AbgFPP33 (ORCPT ); Tue, 16 Jun 2020 11:29:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592321368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=prvuib5zQmcv0KtPefPihKfecw6gAeEldQvoe7ZUcw8=; b=J+t3P92GsJPs/zExJ6s+CfijxJR0RLrt6yaR56z8cu9vT96ucZPnNQ3oWLliluuLhCT2zG tJzEEn4Yu8+gKVAGpwWN21y68xIyHTH9dwlyqCe1CLqJ/qEeRVKwffZCMMquObkUt/awcP oy+94OlFb20Q5hDA8pAIZxLLR/2jYS8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-277-mImIVvnyOWiBzs4mNEtzcw-1; Tue, 16 Jun 2020 11:29:26 -0400 X-MC-Unique: mImIVvnyOWiBzs4mNEtzcw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C6FA150562; Tue, 16 Jun 2020 15:29:25 +0000 (UTC) Received: from x2.localnet (ovpn-113-82.phx2.redhat.com [10.3.113.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5559110013D6; Tue, 16 Jun 2020 15:29:24 +0000 (UTC) From: Steve Grubb To: Paul Moore Cc: Lakshmi Ramasubramanian , Mimi Zohar , rgb@redhat.com, linux-integrity@vger.kernel.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] integrity: Add errno field in audit message Date: Tue, 16 Jun 2020 11:29:22 -0400 Message-ID: <6643272.rC52FQZPYE@x2> Organization: Red Hat In-Reply-To: References: <20200611000400.3771-1-nramas@linux.microsoft.com> <8800031.dr63W5FlUW@x2> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, June 15, 2020 6:58:13 PM EDT Paul Moore wrote: > On Mon, Jun 15, 2020 at 6:23 PM Steve Grubb wrote: > > On Friday, June 12, 2020 3:50:14 PM EDT Lakshmi Ramasubramanian wrote: > > > On 6/12/20 12:25 PM, Mimi Zohar wrote: > > > > The idea is a good idea, but you're assuming that "result" is always > > > > errno. That was probably true originally, but isn't now. For > > > > example, ima_appraise_measurement() calls xattr_verify(), which > > > > compares the security.ima hash with the calculated file hash. On > > > > failure, it returns the result of memcmp(). Each and every code path > > > > will need to be checked. > > > > > > Good catch Mimi. > > > > > > Instead of "errno" should we just use "result" and log the value given > > > in the result parameter? > > > > That would likely collide with another field of the same name which is > > the > > operation's results. If it really is errno, the name is fine. It's > > generic > > enough that it can be reused on other events if that mattered. > > Steve, what is the historical reason why we have both "res" and > "result" for indicating a boolean success/fail? I'm just curious how > we ended up this way, and who may still be using "result". I think its pam and some other user space things did this. But because of mixed machines in datacenters supporting multiple versions of OS, we have to leave result alone. It has to be 0,1 or success/fail. We cannot use it for errno. -Steve