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 6C496C433EF for ; Tue, 3 May 2022 00:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbiECAUF (ORCPT ); Mon, 2 May 2022 20:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbiECATw (ORCPT ); Mon, 2 May 2022 20:19:52 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9438D38DA0 for ; Mon, 2 May 2022 17:16:20 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id r1-20020a1c2b01000000b00394398c5d51so432435wmr.2 for ; Mon, 02 May 2022 17:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WEBPkXZGZET4EOg9cNqgzGfoaXYf5cttjHHg7Lavyrc=; b=u0NnuCLWvA+j4fCTpPXTlOameD/fsMdeVXQnlE6sn/YvxBdcoQOutZx7GGA9/BVUP9 qa1zezBlh9PyWkhRje1o2dkuSrJesxNSGB3pI7HZ7xyu3jBpwv89b7rIAgaqBG9uXy2B eUiD+hMF6vGP1FACV2CyxjMQsdAGuwzIZQW8PuMMu6MgRFhaZz1GPb97QijP2WQdBydU eZPQ7k66fs99I4BGeJdcyBcfL/KcZArFCBHbU3pvOAHrTQV/xX+AMLkogLHv5479Lh1L MnPkl7ZQwF42gnaqvM7GbjxVEHKoBWaroH0OF4KvZFFDr74jqiVibcAPParhHHN6rUdu ATXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WEBPkXZGZET4EOg9cNqgzGfoaXYf5cttjHHg7Lavyrc=; b=RNCCh8rI9mNZuFuM5g/TzvSlV3w9aECCJ51JZyRgccVJUBQsUaD2pcnkKEGy5p0Icm GfhfAAVg4IQjDGsF4u26veztFupFt/US1kzmrx789OiwjLovySaoHpOUa9q5saBS6RWD k/i7KnrIdXUIVL3Qntpg2dtG4Nt3ZUypTC5juDPO74iALBTKZSz3aPJmeA3AWNq3wt6w w5szne8A6tlYR8QrY0EupEyUUG8WaS/We23w0i2szilE1EVM414FBjFRgNbfGWeB+KVT bjvKwNmxiO4A6CXMCmSMootofZb3R0bbrLg2BpLyzHUMdf/yCRpib6bhPfGs4BbmO3Yv 0U8Q== X-Gm-Message-State: AOAM531YKKCMA/rhEar9klm+YPxMvbzuPbc9j6RAgwPfjhKFlzpjiIWu sVF2XUx9LqQskMi/zSYN69kU8/cQUvBn7p82kD57 X-Google-Smtp-Source: ABdhPJyZ4midsbD61Si1Qw0RhxNxL5d5wRIVNY/d5Kxnxugjn6yw9JwqCUzXCTQrt39kvTqxQ7ozsBrGJ7xQHItqm6s= X-Received: by 2002:a7b:cf02:0:b0:393:fbb0:7189 with SMTP id l2-20020a7bcf02000000b00393fbb07189mr1065567wmg.197.1651536978767; Mon, 02 May 2022 17:16:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paul Moore Date: Mon, 2 May 2022 20:16:07 -0400 Message-ID: Subject: Re: [PATCH v2 1/3] fanotify: Ensure consistent variable type for response To: Richard Guy Briggs Cc: Linux-Audit Mailing List , LKML , linux-fsdevel@vger.kernel.org, Eric Paris , Steve Grubb , Jan Kara Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- paul-moore.com 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 B4AB7C433EF for ; Tue, 3 May 2022 00:16:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-63-v9toOHU9NbCFkv8jQlYlkw-1; Mon, 02 May 2022 20:16:24 -0400 X-MC-Unique: v9toOHU9NbCFkv8jQlYlkw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 462BE185A7A4; Tue, 3 May 2022 00:16:23 +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 36D16463DE7; Tue, 3 May 2022 00:16:23 +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 022AF1947049; Tue, 3 May 2022 00:16:23 +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 492C71947042 for ; Tue, 3 May 2022 00:16:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F12C65553B3; Tue, 3 May 2022 00:16:21 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED5D35553A6 for ; Tue, 3 May 2022 00:16:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D337B811E75 for ; Tue, 3 May 2022 00:16:21 +0000 (UTC) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-207-NSd967u6PlyrfODpR_8PNg-1; Mon, 02 May 2022 20:16:20 -0400 X-MC-Unique: NSd967u6PlyrfODpR_8PNg-1 Received: by mail-wm1-f41.google.com with SMTP id c190-20020a1c35c7000000b0038e37907b5bso466207wma.0 for ; Mon, 02 May 2022 17:16:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WEBPkXZGZET4EOg9cNqgzGfoaXYf5cttjHHg7Lavyrc=; b=ZpgeempqECna4qyth1KfF0nKLV+WVt0bPL93Js912hxLvCZlQPtxLzXSuqqArqzwG0 Np8rDOvuuuqd2oP/IaTQ31fIKZ9R07agfcrMzuJRShSYrfDuDsLagguuwowFi4XW3oTX ZC+t7U3udOAR4em0KJp7SCbkT+pLzJreNhpb7lnm9/3IB8Oz1QDCi9AN0WzL4yoyYiUB 2wcW/+mX6n2oW+j+qryeiPFiBqdPE4+afAzLJ8WEyq034R78NhpyprSfbf4fYhpP/RRi y0gXdhBhns/bMijE1PQAHo+PCjU3QUad0jJCYFjJR49WULltPm9Gg14M6r8wjtJxUfkr iMuQ== X-Gm-Message-State: AOAM533k3LrX4lvF1qFeWFHcl9sO+iFCf9wAmiJ3IZAfPlg9e65eD3dB Rux6kyBAly1wo0Ps9HiPXKnD/t84WqSFqnpR3G0t X-Google-Smtp-Source: ABdhPJyZ4midsbD61Si1Qw0RhxNxL5d5wRIVNY/d5Kxnxugjn6yw9JwqCUzXCTQrt39kvTqxQ7ozsBrGJ7xQHItqm6s= X-Received: by 2002:a7b:cf02:0:b0:393:fbb0:7189 with SMTP id l2-20020a7bcf02000000b00393fbb07189mr1065567wmg.197.1651536978767; Mon, 02 May 2022 17:16:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paul Moore Date: Mon, 2 May 2022 20:16:07 -0400 Message-ID: Subject: Re: [PATCH v2 1/3] fanotify: Ensure consistent variable type for response To: Richard Guy Briggs X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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.85 on 10.11.54.10 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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. -- paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit