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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZs1p+lkKO+194zN@kroah.com>
Date:   Mon, 22 Nov 2021 07:16:07 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Jeremy Kerr <jk@...econstruct.com.au>
Cc:     netdev@...r.kernel.org, Matt Johnston <matt@...econstruct.com.au>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jiri Slaby <jirislaby@...nel.org>
Subject: Re: [PATCH net-next] mctp: Add MCTP-over-serial transport binding

On Mon, Nov 22, 2021 at 12:28:17PM +0800, Jeremy Kerr wrote:
> This change adds a MCTP Serial transport binding, as per DMTF DSP0253.

What is "DMTF DSP0253"?  Can you provide a link to this or more
information that explains why this has to be a serial thing?

> This is implemented as a new serial line discipline, and can be attached
> to arbitrary serial devices.

Why?  Who is going to use this?

> The 'mctp' utility provides the ldisc magic to set up the serial link:
> 
>   # mctp link serial /dev/ttyS0 &
>   # mctp link
>   dev lo index 1 address 0x00:00:00:00:00:00 net 1 mtu 65536 up
>   dev mctpserial0 index 5 address 0x(no-addr) net 1 mtu 68 down

Where is this magic mctp application?  I can't find it in my distro
packages anywhere.


> 
> Signed-off-by: Jeremy Kerr <jk@...econstruct.com.au>
> ---
>  drivers/net/mctp/Kconfig       |  11 +
>  drivers/net/mctp/Makefile      |   1 +
>  drivers/net/mctp/mctp-serial.c | 494 +++++++++++++++++++++++++++++++++
>  include/uapi/linux/tty.h       |   1 +
>  4 files changed, 507 insertions(+)
>  create mode 100644 drivers/net/mctp/mctp-serial.c
> 
> diff --git a/drivers/net/mctp/Kconfig b/drivers/net/mctp/Kconfig
> index d8f966cedc89..02f3c2d600fd 100644
> --- a/drivers/net/mctp/Kconfig
> +++ b/drivers/net/mctp/Kconfig
> @@ -3,6 +3,17 @@ if MCTP
>  
>  menu "MCTP Device Drivers"
>  
> +config MCTP_SERIAL
> +	tristate "MCTP serial transport"
> +	depends on TTY
> +	select CRC_CCITT
> +	help
> +	  This driver provides an MCTP-over-serial interface, through a
> +	  serial line-discipline. By attaching the ldisc to a serial device,
> +	  we get a new net device to transport MCTP packets.
> +
> +	  Say y here if you need to connect to MCTP devices over serial.

Module name?

> +
>  endmenu
>  
>  endif
> diff --git a/drivers/net/mctp/Makefile b/drivers/net/mctp/Makefile
> index e69de29bb2d1..d32622613ce4 100644
> --- a/drivers/net/mctp/Makefile
> +++ b/drivers/net/mctp/Makefile
> @@ -0,0 +1 @@
> +obj-$(CONFIG_MCTP_SERIAL) += mctp-serial.o
> diff --git a/drivers/net/mctp/mctp-serial.c b/drivers/net/mctp/mctp-serial.c
> new file mode 100644
> index 000000000000..30950f1ea6f4
> --- /dev/null
> +++ b/drivers/net/mctp/mctp-serial.c
> @@ -0,0 +1,494 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Management Component Transport Protocol (MCTP) - serial transport
> + * binding.
> + *
> + * Copyright (c) 2021 Code Construct
> + */
> +
> +#include <linux/idr.h>
> +#include <linux/if_arp.h>
> +#include <linux/module.h>
> +#include <linux/skbuff.h>
> +#include <linux/tty.h>
> +#include <linux/workqueue.h>
> +#include <linux/crc-ccitt.h>
> +
> +#include <linux/mctp.h>
> +#include <net/mctp.h>
> +#include <net/pkt_sched.h>
> +
> +#define MCTP_SERIAL_MTU		68 /* base mtu (64) + mctp header */
> +#define MCTP_SERIAL_FRAME_MTU	(MCTP_SERIAL_MTU + 6) /* + serial framing */
> +
> +#define MCTP_SERIAL_VERSION	0x1

Where does this number come from?

> +
> +#define BUFSIZE			MCTP_SERIAL_FRAME_MTU
> +
> +#define BYTE_FRAME		0x7e
> +#define BYTE_ESC		0x7d
> +
> +static DEFINE_IDA(mctp_serial_ida);

I think you forgot to clean this up when the module is removed.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ