From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 971EEC433EF for ; Tue, 3 May 2022 21:10:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242673AbiECVOI (ORCPT ); Tue, 3 May 2022 17:14:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235960AbiECVOD (ORCPT ); Tue, 3 May 2022 17:14:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 174B111165 for ; Tue, 3 May 2022 14:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651612229; 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: in-reply-to:in-reply-to:references:references; bh=rOtTfklybxzZCSEMsPzUimB8kRcfo61buiS4NtgbKGM=; b=SYG/P+vCtjrZ/P1ww1wKfNISZBAtW1TNJdPHvJpN9RARjCZg3EIiaBYuArDY5L5ifttRuM rzGqKMLmxM1Kx3B/eHUmPY7FrSrtKLuBpRY8f3Lj8mP/vDppmYOpaw+NR6kw3FSk6/VrQd 2E7qvL4rXBCZDFjutD8D5EC5bC/Sqeg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-ZIA2uvX2Nb-hQEsTeqkgaA-1; Tue, 03 May 2022 17:10:18 -0400 X-MC-Unique: ZIA2uvX2Nb-hQEsTeqkgaA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 613271C05EAB; Tue, 3 May 2022 21:07:42 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.22.48.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 462655523FB; Tue, 3 May 2022 21:07:41 +0000 (UTC) Date: Tue, 3 May 2022 17:07:39 -0400 From: Richard Guy Briggs To: Paul Moore Cc: Linux-Audit Mailing List , LKML , linux-fsdevel@vger.kernel.org, Eric Paris , Steve Grubb , Jan Kara Subject: Re: [PATCH v2 1/3] fanotify: Ensure consistent variable type for response Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-05-02 20:16, Paul Moore wrote: > On Thu, Apr 28, 2022 at 8:45 PM Richard Guy Briggs wrote: > > > > The user space API for the response variable is __u32. This patch makes > > sure that the whole path through the kernel uses __u32 so that there is > > no sign extension or truncation of the user space response. > > > > Suggested-by: Steve Grubb > > Link: https://lore.kernel.org/r/12617626.uLZWGnKmhe@x2 > > Signed-off-by: Richard Guy Briggs > > Link: https://lore.kernel.org/r/aa98a3ad00666a6fc0ce411755de4a1a60f5c0cd.1651174324.git.rgb@redhat.com > > --- > > fs/notify/fanotify/fanotify.h | 2 +- > > fs/notify/fanotify/fanotify_user.c | 6 +++--- > > 2 files changed, 4 insertions(+), 4 deletions(-) > > It seems like audit_fanotify()/__audit_fanotify() should also be > changed, yes? Granted, in this case it's an unsigned int to u32 > conversion so not really all that critical, but if you are going to > update the fanotify code you might as well update the audit code as > well for the sake of completeness. Yes, that was somewhere in the back of my mind but forgot to come back to it. Thanks for catching that. > paul-moore.com - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAEB1C433FE for ; Tue, 3 May 2022 21:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651612226; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WCFS+24SEOD73Bw8E4cDu4kD+RczoyHLOh35EkEEC58=; b=cOomFCYM05OfT0/3lLac2SD8fRa8KlDyIUsL+wtUjXD8S9cxxeDfAlKlBjTxHYfyMb+pim PeJNCnWuHgSk59Bz03ms90UOD7A+tGWbNjtiA4kkl8pLWKyZeO6T4dwdafc9mP3CehBa1e wrO9l/mayrDXCLsuxO8olSAO+Zf38GA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-39-gD659sDrP4iaB9AzB5KpyA-1; Tue, 03 May 2022 17:10:19 -0400 X-MC-Unique: gD659sDrP4iaB9AzB5KpyA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51A411C05EBA; Tue, 3 May 2022 21:07:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E6942166B41; Tue, 3 May 2022 21:07:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C09D11947040; Tue, 3 May 2022 21:07:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C758F19466DF for ; Tue, 3 May 2022 21:07:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 609DF5523F1; Tue, 3 May 2022 21:07:42 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.22.48.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 462655523FB; Tue, 3 May 2022 21:07:41 +0000 (UTC) Date: Tue, 3 May 2022 17:07:39 -0400 From: Richard Guy Briggs To: Paul Moore Subject: Re: [PATCH v2 1/3] fanotify: Ensure consistent variable type for response Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , LKML , Linux-Audit Mailing List , linux-fsdevel@vger.kernel.org, Eric Paris Errors-To: linux-audit-bounces@redhat.com Sender: "Linux-audit" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 2022-05-02 20:16, Paul Moore wrote: > On Thu, Apr 28, 2022 at 8:45 PM Richard Guy Briggs wrote: > > > > The user space API for the response variable is __u32. This patch makes > > sure that the whole path through the kernel uses __u32 so that there is > > no sign extension or truncation of the user space response. > > > > Suggested-by: Steve Grubb > > Link: https://lore.kernel.org/r/12617626.uLZWGnKmhe@x2 > > Signed-off-by: Richard Guy Briggs > > Link: https://lore.kernel.org/r/aa98a3ad00666a6fc0ce411755de4a1a60f5c0cd.1651174324.git.rgb@redhat.com > > --- > > fs/notify/fanotify/fanotify.h | 2 +- > > fs/notify/fanotify/fanotify_user.c | 6 +++--- > > 2 files changed, 4 insertions(+), 4 deletions(-) > > It seems like audit_fanotify()/__audit_fanotify() should also be > changed, yes? Granted, in this case it's an unsigned int to u32 > conversion so not really all that critical, but if you are going to > update the fanotify code you might as well update the audit code as > well for the sake of completeness. Yes, that was somewhere in the back of my mind but forgot to come back to it. Thanks for catching that. > paul-moore.com - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635 -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit