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 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 621B5FC6195 for ; Thu, 7 Nov 2019 13:35:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F8072187F for ; Thu, 7 Nov 2019 13:35:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dRTjHpka" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728568AbfKGNfm (ORCPT ); Thu, 7 Nov 2019 08:35:42 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:40378 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731080AbfKGNfk (ORCPT ); Thu, 7 Nov 2019 08:35:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573133739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5OMjhGzW+oqRfUvod1CP0LB9hBdvEfkSHhab7TjBDcY=; b=dRTjHpkaUM2uMdhsenOT43WeR5LEofJdChHIYiI8AGRZ8WJoTPWIiwxcR7JatngqvqwfOr Gpu7VbHVr8VP5JC/fKdxcyI7mzR6jxng6AvTBKhtq1N4BVqV2grQtX7rXhOChCG8lMhLmh 17Kz2h//XXCCRa1qtc4wSHmdwY0qYp4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-8gztBEgTOqirunCmlnhH9A-1; Thu, 07 Nov 2019 08:35:35 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 50CEE8017DD; Thu, 7 Nov 2019 13:35:33 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-254.rdu2.redhat.com [10.10.120.254]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AAAC608B2; Thu, 7 Nov 2019 13:35:27 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [RFC PATCH 01/14] uapi: General notification queue definitions [ver #2] From: David Howells To: torvalds@linux-foundation.org Cc: dhowells@redhat.com, Greg Kroah-Hartman , Casey Schaufler , Stephen Smalley , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner , dhowells@redhat.com, keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 07 Nov 2019 13:35:26 +0000 Message-ID: <157313372658.29677.3710868015853027530.stgit@warthog.procyon.org.uk> In-Reply-To: <157313371694.29677.15388731274912671071.stgit@warthog.procyon.org.uk> References: <157313371694.29677.15388731274912671071.stgit@warthog.procyon.org.uk> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 8gztBEgTOqirunCmlnhH9A-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Add UAPI definitions for the general notification queue, including the following pieces: (*) struct watch_notification. This is the metadata header for notification messages. It includes a type and subtype that indicate the source of the message (eg. WATCH_TYPE_MOUNT_NOTIFY) and the kind of the message (eg. NOTIFY_MOUNT_NEW_MOUNT). The header also contains an information field that conveys the following information: =09- WATCH_INFO_LENGTH. The size of the entry (entries are variable length). =09- WATCH_INFO_ID. The watch ID specified when the watchpoint was set. =09- WATCH_INFO_TYPE_INFO. (Sub)type-specific information. =09- WATCH_INFO_FLAG_*. Flag bits overlain on the type-specific information. For use by the type. All the information in the header can be used in filtering messages at the point of writing into the buffer. (*) struct watch_notification_removal This is an extended watch-removal notification record that includes an 'id' field that can indicate the identifier of the object being removed if available (for instance, a keyring serial number). Signed-off-by: David Howells --- include/uapi/linux/watch_queue.h | 55 ++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 55 insertions(+) create mode 100644 include/uapi/linux/watch_queue.h diff --git a/include/uapi/linux/watch_queue.h b/include/uapi/linux/watch_qu= eue.h new file mode 100644 index 000000000000..5f3d21e8a34b --- /dev/null +++ b/include/uapi/linux/watch_queue.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI_LINUX_WATCH_QUEUE_H +#define _UAPI_LINUX_WATCH_QUEUE_H + +#include + +enum watch_notification_type { +=09WATCH_TYPE_META=09=09=3D 0,=09/* Special record */ +=09WATCH_TYPE__NR=09=09=3D 1 +}; + +enum watch_meta_notification_subtype { +=09WATCH_META_REMOVAL_NOTIFICATION=09=3D 0,=09/* Watched object was remove= d */ +=09WATCH_META_LOSS_NOTIFICATION=09=3D 1,=09/* Data loss occurred */ +}; + +/* + * Notification record header. This is aligned to 64-bits so that subclas= ses + * can contain __u64 fields. + */ +struct watch_notification { +=09__u32=09=09=09type:24;=09/* enum watch_notification_type */ +=09__u32=09=09=09subtype:8;=09/* Type-specific subtype (filterable) */ +=09__u32=09=09=09info; +#define WATCH_INFO_LENGTH=090x0000007f=09/* Length of record */ +#define WATCH_INFO_LENGTH__SHIFT 0 +#define WATCH_INFO_ID=09=090x0000ff00=09/* ID of watchpoint */ +#define WATCH_INFO_ID__SHIFT=098 +#define WATCH_INFO_TYPE_INFO=090xffff0000=09/* Type-specific info */ +#define WATCH_INFO_TYPE_INFO__SHIFT 16 +#define WATCH_INFO_FLAG_0=090x00010000=09/* Type-specific info, flag bit 0= */ +#define WATCH_INFO_FLAG_1=090x00020000=09/* ... */ +#define WATCH_INFO_FLAG_2=090x00040000 +#define WATCH_INFO_FLAG_3=090x00080000 +#define WATCH_INFO_FLAG_4=090x00100000 +#define WATCH_INFO_FLAG_5=090x00200000 +#define WATCH_INFO_FLAG_6=090x00400000 +#define WATCH_INFO_FLAG_7=090x00800000 +}; + + +/* + * Extended watch removal notification. This is used optionally if the ty= pe + * wants to indicate an identifier for the object being watched, if there = is + * such. This can be distinguished by the length. + * + * type -> WATCH_TYPE_META + * subtype -> WATCH_META_REMOVAL_NOTIFICATION + */ +struct watch_notification_removal { +=09struct watch_notification watch; +=09__u64=09id;=09=09/* Type-dependent identifier */ +}; + +#endif /* _UAPI_LINUX_WATCH_QUEUE_H */ From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Date: Thu, 07 Nov 2019 13:35:26 +0000 Subject: [RFC PATCH 01/14] uapi: General notification queue definitions [ver #2] Message-Id: <157313372658.29677.3710868015853027530.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <157313371694.29677.15388731274912671071.stgit@warthog.procyon.org.uk> In-Reply-To: <157313371694.29677.15388731274912671071.stgit@warthog.procyon.org.uk> To: torvalds@linux-foundation.org Cc: dhowells@redhat.com, Greg Kroah-Hartman , Casey Schaufler , Stephen Smalley , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner dhowells@redhat.com, keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org@vger.kernel.org, linux-kernel@vger.kernel.org Add UAPI definitions for the general notification queue, including the following pieces: (*) struct watch_notification. This is the metadata header for notification messages. It includes a type and subtype that indicate the source of the message (eg. WATCH_TYPE_MOUNT_NOTIFY) and the kind of the message (eg. NOTIFY_MOUNT_NEW_MOUNT). The header also contains an information field that conveys the following information: - WATCH_INFO_LENGTH. The size of the entry (entries are variable length). - WATCH_INFO_ID. The watch ID specified when the watchpoint was set. - WATCH_INFO_TYPE_INFO. (Sub)type-specific information. - WATCH_INFO_FLAG_*. Flag bits overlain on the type-specific information. For use by the type. All the information in the header can be used in filtering messages at the point of writing into the buffer. (*) struct watch_notification_removal This is an extended watch-removal notification record that includes an 'id' field that can indicate the identifier of the object being removed if available (for instance, a keyring serial number). Signed-off-by: David Howells --- include/uapi/linux/watch_queue.h | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 include/uapi/linux/watch_queue.h diff --git a/include/uapi/linux/watch_queue.h b/include/uapi/linux/watch_queue.h new file mode 100644 index 000000000000..5f3d21e8a34b --- /dev/null +++ b/include/uapi/linux/watch_queue.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI_LINUX_WATCH_QUEUE_H +#define _UAPI_LINUX_WATCH_QUEUE_H + +#include + +enum watch_notification_type { + WATCH_TYPE_META = 0, /* Special record */ + WATCH_TYPE__NR = 1 +}; + +enum watch_meta_notification_subtype { + WATCH_META_REMOVAL_NOTIFICATION = 0, /* Watched object was removed */ + WATCH_META_LOSS_NOTIFICATION = 1, /* Data loss occurred */ +}; + +/* + * Notification record header. This is aligned to 64-bits so that subclasses + * can contain __u64 fields. + */ +struct watch_notification { + __u32 type:24; /* enum watch_notification_type */ + __u32 subtype:8; /* Type-specific subtype (filterable) */ + __u32 info; +#define WATCH_INFO_LENGTH 0x0000007f /* Length of record */ +#define WATCH_INFO_LENGTH__SHIFT 0 +#define WATCH_INFO_ID 0x0000ff00 /* ID of watchpoint */ +#define WATCH_INFO_ID__SHIFT 8 +#define WATCH_INFO_TYPE_INFO 0xffff0000 /* Type-specific info */ +#define WATCH_INFO_TYPE_INFO__SHIFT 16 +#define WATCH_INFO_FLAG_0 0x00010000 /* Type-specific info, flag bit 0 */ +#define WATCH_INFO_FLAG_1 0x00020000 /* ... */ +#define WATCH_INFO_FLAG_2 0x00040000 +#define WATCH_INFO_FLAG_3 0x00080000 +#define WATCH_INFO_FLAG_4 0x00100000 +#define WATCH_INFO_FLAG_5 0x00200000 +#define WATCH_INFO_FLAG_6 0x00400000 +#define WATCH_INFO_FLAG_7 0x00800000 +}; + + +/* + * Extended watch removal notification. This is used optionally if the type + * wants to indicate an identifier for the object being watched, if there is + * such. This can be distinguished by the length. + * + * type -> WATCH_TYPE_META + * subtype -> WATCH_META_REMOVAL_NOTIFICATION + */ +struct watch_notification_removal { + struct watch_notification watch; + __u64 id; /* Type-dependent identifier */ +}; + +#endif /* _UAPI_LINUX_WATCH_QUEUE_H */ From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: [RFC PATCH 01/14] uapi: General notification queue definitions [ver #2] Date: Thu, 07 Nov 2019 13:35:26 +0000 Message-ID: <157313372658.29677.3710868015853027530.stgit@warthog.procyon.org.uk> References: <157313371694.29677.15388731274912671071.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <157313371694.29677.15388731274912671071.stgit@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org To: torvalds@linux-foundation.org Cc: dhowells@redhat.com, Greg Kroah-Hartman , Casey Schaufler , Stephen Smalley , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner dhowells@redhat.com, keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.orglinux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-api@vger.kernel.org Add UAPI definitions for the general notification queue, including the following pieces: (*) struct watch_notification. This is the metadata header for notification messages. It includes a type and subtype that indicate the source of the message (eg. WATCH_TYPE_MOUNT_NOTIFY) and the kind of the message (eg. NOTIFY_MOUNT_NEW_MOUNT). The header also contains an information field that conveys the following information: =09- WATCH_INFO_LENGTH. The size of the entry (entries are variable length). =09- WATCH_INFO_ID. The watch ID specified when the watchpoint was set. =09- WATCH_INFO_TYPE_INFO. (Sub)type-specific information. =09- WATCH_INFO_FLAG_*. Flag bits overlain on the type-specific information. For use by the type. All the information in the header can be used in filtering messages at the point of writing into the buffer. (*) struct watch_notification_removal This is an extended watch-removal notification record that includes an 'id' field that can indicate the identifier of the object being removed if available (for instance, a keyring serial number). Signed-off-by: David Howells --- include/uapi/linux/watch_queue.h | 55 ++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 55 insertions(+) create mode 100644 include/uapi/linux/watch_queue.h diff --git a/include/uapi/linux/watch_queue.h b/include/uapi/linux/watch_qu= eue.h new file mode 100644 index 000000000000..5f3d21e8a34b --- /dev/null +++ b/include/uapi/linux/watch_queue.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI_LINUX_WATCH_QUEUE_H +#define _UAPI_LINUX_WATCH_QUEUE_H + +#include + +enum watch_notification_type { +=09WATCH_TYPE_META=09=09=3D 0,=09/* Special record */ +=09WATCH_TYPE__NR=09=09=3D 1 +}; + +enum watch_meta_notification_subtype { +=09WATCH_META_REMOVAL_NOTIFICATION=09=3D 0,=09/* Watched object was remove= d */ +=09WATCH_META_LOSS_NOTIFICATION=09=3D 1,=09/* Data loss occurred */ +}; + +/* + * Notification record header. This is aligned to 64-bits so that subclas= ses + * can contain __u64 fields. + */ +struct watch_notification { +=09__u32=09=09=09type:24;=09/* enum watch_notification_type */ +=09__u32=09=09=09subtype:8;=09/* Type-specific subtype (filterable) */ +=09__u32=09=09=09info; +#define WATCH_INFO_LENGTH=090x0000007f=09/* Length of record */ +#define WATCH_INFO_LENGTH__SHIFT 0 +#define WATCH_INFO_ID=09=090x0000ff00=09/* ID of watchpoint */ +#define WATCH_INFO_ID__SHIFT=098 +#define WATCH_INFO_TYPE_INFO=090xffff0000=09/* Type-specific info */ +#define WATCH_INFO_TYPE_INFO__SHIFT 16 +#define WATCH_INFO_FLAG_0=090x00010000=09/* Type-specific info, flag bit 0= */ +#define WATCH_INFO_FLAG_1=090x00020000=09/* ... */ +#define WATCH_INFO_FLAG_2=090x00040000 +#define WATCH_INFO_FLAG_3=090x00080000 +#define WATCH_INFO_FLAG_4=090x00100000 +#define WATCH_INFO_FLAG_5=090x00200000 +#define WATCH_INFO_FLAG_6=090x00400000 +#define WATCH_INFO_FLAG_7=090x00800000 +}; + + +/* + * Extended watch removal notification. This is used optionally if the ty= pe + * wants to indicate an identifier for the object being watched, if there = is + * such. This can be distinguished by the length. + * + * type -> WATCH_TYPE_META + * subtype -> WATCH_META_REMOVAL_NOTIFICATION + */ +struct watch_notification_removal { +=09struct watch_notification watch; +=09__u64=09id;=09=09/* Type-dependent identifier */ +}; + +#endif /* _UAPI_LINUX_WATCH_QUEUE_H */