linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 216775] New: fanotify reports parent PPID insted of PID for FAN_MODIFY events
@ 2022-12-05  4:38 bugzilla-daemon
  2022-12-05  8:44 ` Amir Goldstein
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bugzilla-daemon @ 2022-12-05  4:38 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=216775

            Bug ID: 216775
           Summary: fanotify reports parent PPID insted of PID for
                    FAN_MODIFY events
           Product: File System
           Version: 2.5
    Kernel Version: 5.15.0
          Hardware: Intel
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: ext4
          Assignee: fs_ext4@kernel-bugs.osdl.org
          Reporter: saikiran.gummaraj@icloud.com
        Regression: No

Hello,

While I've been developing a library around fanotify in Go, I noticed that
fanotify subsystem reports the parent process ID in fanotify_event_metadata.pid
instead of the Process ID when mask is set to FAN_MODIFY. I was able to confirm
the error through a test and also manually verifying the PIDs in the audit log.
I did not observe this behaviour for FAN_ACCESS bit.

I've been able to reproduce this on -

Ubuntu 20.04.5 - 5.15.0-53-generic
Ubuntu 22.10 - 5.19.0-23-generic

It can be reproduced by -

git clone git@github.com:opcoder0/fanotify.git
cd fanotify
sudo go test -v

The test "TestWithCapSysAdmFanotifyFileModified" fails reporting pid mismatch.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bug 216775] New: fanotify reports parent PPID insted of PID for FAN_MODIFY events
  2022-12-05  4:38 [Bug 216775] New: fanotify reports parent PPID insted of PID for FAN_MODIFY events bugzilla-daemon
@ 2022-12-05  8:44 ` Amir Goldstein
  2022-12-05  8:45 ` [Bug 216775] " bugzilla-daemon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Amir Goldstein @ 2022-12-05  8:44 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-ext4, Jan Kara

On Mon, Dec 5, 2022 at 7:02 AM <bugzilla-daemon@kernel.org> wrote:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=216775
>
>             Bug ID: 216775
>            Summary: fanotify reports parent PPID insted of PID for
>                     FAN_MODIFY events
>            Product: File System
>            Version: 2.5
>     Kernel Version: 5.15.0
>           Hardware: Intel
>                 OS: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: ext4
>           Assignee: fs_ext4@kernel-bugs.osdl.org
>           Reporter: saikiran.gummaraj@icloud.com
>         Regression: No
>
> Hello,
>
> While I've been developing a library around fanotify in Go, I noticed that
> fanotify subsystem reports the parent process ID in fanotify_event_metadata.pid
> instead of the Process ID when mask is set to FAN_MODIFY. I was able to confirm
> the error through a test and also manually verifying the PIDs in the audit log.
> I did not observe this behaviour for FAN_ACCESS bit.
>
> I've been able to reproduce this on -
>
> Ubuntu 20.04.5 - 5.15.0-53-generic
> Ubuntu 22.10 - 5.19.0-23-generic
>
> It can be reproduced by -
>
> git clone git@github.com:opcoder0/fanotify.git
> cd fanotify
> sudo go test -v
>
> The test "TestWithCapSysAdmFanotifyFileModified" fails reporting pid mismatch.
>

It's a test bug.
The modify event with self pid is generated by os.WriteFile()
Either change test to expect modify event with self pid or move
test file creation before starting the listener.

Thanks,
Amir.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 216775] fanotify reports parent PPID insted of PID for FAN_MODIFY events
  2022-12-05  4:38 [Bug 216775] New: fanotify reports parent PPID insted of PID for FAN_MODIFY events bugzilla-daemon
  2022-12-05  8:44 ` Amir Goldstein
@ 2022-12-05  8:45 ` bugzilla-daemon
  2022-12-05  9:18 ` bugzilla-daemon
  2022-12-05  9:19 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2022-12-05  8:45 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=216775

--- Comment #1 from Amir Goldstein (amir73il@gmail.com) ---
On Mon, Dec 5, 2022 at 7:02 AM <bugzilla-daemon@kernel.org> wrote:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=216775
>
>             Bug ID: 216775
>            Summary: fanotify reports parent PPID insted of PID for
>                     FAN_MODIFY events
>            Product: File System
>            Version: 2.5
>     Kernel Version: 5.15.0
>           Hardware: Intel
>                 OS: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: ext4
>           Assignee: fs_ext4@kernel-bugs.osdl.org
>           Reporter: saikiran.gummaraj@icloud.com
>         Regression: No
>
> Hello,
>
> While I've been developing a library around fanotify in Go, I noticed that
> fanotify subsystem reports the parent process ID in
> fanotify_event_metadata.pid
> instead of the Process ID when mask is set to FAN_MODIFY. I was able to
> confirm
> the error through a test and also manually verifying the PIDs in the audit
> log.
> I did not observe this behaviour for FAN_ACCESS bit.
>
> I've been able to reproduce this on -
>
> Ubuntu 20.04.5 - 5.15.0-53-generic
> Ubuntu 22.10 - 5.19.0-23-generic
>
> It can be reproduced by -
>
> git clone git@github.com:opcoder0/fanotify.git
> cd fanotify
> sudo go test -v
>
> The test "TestWithCapSysAdmFanotifyFileModified" fails reporting pid
> mismatch.
>

It's a test bug.
The modify event with self pid is generated by os.WriteFile()
Either change test to expect modify event with self pid or move
test file creation before starting the listener.

Thanks,
Amir.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 216775] fanotify reports parent PPID insted of PID for FAN_MODIFY events
  2022-12-05  4:38 [Bug 216775] New: fanotify reports parent PPID insted of PID for FAN_MODIFY events bugzilla-daemon
  2022-12-05  8:44 ` Amir Goldstein
  2022-12-05  8:45 ` [Bug 216775] " bugzilla-daemon
@ 2022-12-05  9:18 ` bugzilla-daemon
  2022-12-05  9:19 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2022-12-05  9:18 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=216775

--- Comment #2 from opcoder0 (saikiran.gummaraj@icloud.com) ---
Sorry missed that. Thanks a lot!

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 216775] fanotify reports parent PPID insted of PID for FAN_MODIFY events
  2022-12-05  4:38 [Bug 216775] New: fanotify reports parent PPID insted of PID for FAN_MODIFY events bugzilla-daemon
                   ` (2 preceding siblings ...)
  2022-12-05  9:18 ` bugzilla-daemon
@ 2022-12-05  9:19 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2022-12-05  9:19 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=216775

opcoder0 (saikiran.gummaraj@icloud.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from opcoder0 (saikiran.gummaraj@icloud.com) ---
Test issue.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-05  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-05  4:38 [Bug 216775] New: fanotify reports parent PPID insted of PID for FAN_MODIFY events bugzilla-daemon
2022-12-05  8:44 ` Amir Goldstein
2022-12-05  8:45 ` [Bug 216775] " bugzilla-daemon
2022-12-05  9:18 ` bugzilla-daemon
2022-12-05  9:19 ` bugzilla-daemon

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).