linux-audit.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Steve Grubb <sgrubb@redhat.com>
Cc: Jan Kara <jack@suse.cz>, Amir Goldstein <amir73il@gmail.com>,
	linux-audit@redhat.com, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/3] fanotify: Ensure consistent variable type for response
Date: Thu, 1 Oct 2020 11:49:39 +0200	[thread overview]
Message-ID: <20201001094939.GD17860@quack2.suse.cz> (raw)
In-Reply-To: <12617626.uLZWGnKmhe@x2>

On Wed 30-09-20 12:12:24, Steve Grubb 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.
> 
> Signed-off-by: Steve Grubb <sgrubb@redhat.com>
> ---
>  fs/notify/fanotify/fanotify.h      | 2 +-
>  fs/notify/fanotify/fanotify_user.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

Looks good, just one nit below:

> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index 63b5dffdca9e..c8da9ea1e76e 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -157,7 +157,7 @@ static int create_fd(struct fsnotify_group *group, struct path *path,
>   */
>  static void finish_permission_event(struct fsnotify_group *group,
>  				    struct fanotify_perm_event *event,
> -				    unsigned int response)
> +				    __u32 response)
>  				    __releases(&group->notification_lock)
>  {
>  	bool destroy = false;
> @@ -178,7 +178,7 @@ static int process_access_response(struct fsnotify_group *group,
>  {
>  	struct fanotify_perm_event *event;
>  	int fd = response_struct->fd;
> -	int response = response_struct->response;
> +	__u32 response = response_struct->response;
>  
>  	pr_debug("%s: group=%p fd=%d response=%d\n", __func__, group,
>  		 fd, response);

You want to print the response with "%u" here I guess...

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit


      reply	other threads:[~2020-10-01 12:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 16:12 [PATCH 1/3] fanotify: Ensure consistent variable type for response Steve Grubb
2020-10-01  9:49 ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201001094939.GD17860@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sgrubb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).