@@ -117,7 +117,7 @@ struct kmem_cache *fanotify_perm_event_cachep __ro_after_init;
117
117
#define FANOTIFY_EVENT_ALIGN 4
118
118
#define FANOTIFY_FID_INFO_HDR_LEN \
119
119
(sizeof(struct fanotify_event_info_fid) + sizeof(struct file_handle))
120
- #define FANOTIFY_PIDFD_INFO_HDR_LEN \
120
+ #define FANOTIFY_PIDFD_INFO_LEN \
121
121
sizeof(struct fanotify_event_info_pidfd)
122
122
#define FANOTIFY_ERROR_INFO_LEN \
123
123
(sizeof(struct fanotify_event_info_error))
@@ -172,14 +172,14 @@ static size_t fanotify_event_len(unsigned int info_mode,
172
172
dot_len = 1 ;
173
173
}
174
174
175
- if (info_mode & FAN_REPORT_PIDFD )
176
- event_len += FANOTIFY_PIDFD_INFO_HDR_LEN ;
177
-
178
175
if (fanotify_event_has_object_fh (event )) {
179
176
fh_len = fanotify_event_object_fh_len (event );
180
177
event_len += fanotify_fid_info_len (fh_len , dot_len );
181
178
}
182
179
180
+ if (info_mode & FAN_REPORT_PIDFD )
181
+ event_len += FANOTIFY_PIDFD_INFO_LEN ;
182
+
183
183
return event_len ;
184
184
}
185
185
@@ -501,7 +501,7 @@ static int copy_pidfd_info_to_user(int pidfd,
501
501
size_t count )
502
502
{
503
503
struct fanotify_event_info_pidfd info = { };
504
- size_t info_len = FANOTIFY_PIDFD_INFO_HDR_LEN ;
504
+ size_t info_len = FANOTIFY_PIDFD_INFO_LEN ;
505
505
506
506
if (WARN_ON_ONCE (info_len > count ))
507
507
return - EFAULT ;
0 commit comments