lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191024023636.21124-1-marcos.souza.org@gmail.com>
Date:   Wed, 23 Oct 2019 23:36:31 -0300
From:   Marcos Paulo de Souza <marcos.souza.org@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     clm@...com, josef@...icpanda.com, dsterba@...e.com,
        linux-btrfs@...r.kernel.org, mpdesouza@...e.com
Subject: [PATCH 0/5] btrfs: send uevent on subvolume add/remove

From: Marcos Paulo de Souza <mpdesouza@...e.com>

Hey guys,

these patches make btrfs to send an uevent to userspace whenever a subvolume is
added/removed. The changes are pretty straightforward. This patchset was based
in btrfs-misc-next.

The first patch adds an additional argument to btrfs_kobject_uevent to receive a
envp, and just forward this argument to kobject_uevent_envp.

Patch number 2 creates a new function that will be called by patches 4 and 5 to
setup the environment variable to be set to userspace using uevent. These two
environment variables are BTRFS_VOL_{NEW,DEL} and BTRFS_VOL_NAME. The first
variable will have the value 1 for subvolume add/remove (only one will be
exported, so udev can distinguish the event), and the second one hold the name
of the subvolume being added/removed.

Feel free to suggest any other useful information to be exported to userspace
when adding/removing a subvolume.

Patches 3 and 5 call btrfs_vol_uevent to send the event on subvolume add/remove.

Patch 4 creates a helper function to distinguish a subvolume from a snapshot,
since the same function is used to delete both. This function is used in patch
5.

Thanks for you reviews!

Marcos Paulo de Souza (5):
  btrfs: sysfs: Add envp argument to btrfs_kobject_uevent
  btrfs: ioctl: Introduce btrfs_vol_uevent
  btrfs: ioctl: Call btrfs_vol_uevent on subvol creation
  btrfs: ctree.h: Add btrfs_is_snapshot function
  btrfs: ioctl: Call btrfs_vol_uevent on subvolume deletion

 fs/btrfs/ctree.h   | 14 ++++++++++++++
 fs/btrfs/ioctl.c   | 39 ++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/sysfs.c   |  7 +++++--
 fs/btrfs/sysfs.h   |  3 ++-
 fs/btrfs/volumes.c |  2 +-
 5 files changed, 60 insertions(+), 5 deletions(-)

-- 
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ