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: <DB9PR10MB58815DECFF54F6D69E738ED8E0AC9@DB9PR10MB5881.EURPRD10.PROD.OUTLOOK.COM>
Date:   Tue, 28 Feb 2023 07:08:42 +0000
From:   "Starke, Daniel" <daniel.starke@...mens.com>
To:     Jiri Slaby <jirislaby@...nel.org>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "ilpo.jarvinen@...ux.intel.com" <ilpo.jarvinen@...ux.intel.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/3] tty: n_gsm: add ioctl for DLC specific parameter
 configuration

> > +static void gsm_dlci_copy_config_values(struct gsm_dlci *dlci, struct gsm_dlci_config *dc)
> > +{
> > +	memset(dc, 0, sizeof(*dc));
> > +	dc->channel = (u32)dlci->addr;
> > +	dc->adaption = (u32)dlci->adaption;
> > +	dc->mtu = (u32)dlci->mtu;
> > +	dc->priority = (u32)dlci->prio;
> > +	if (dlci->ftype == UIH)
> > +		dc->i = 1;
> > +	else
> > +		dc->i = 2;
> > +	dc->k = (u32)dlci->k;
> 
> Why all those casts?

These fields in 'dlci' differ either in size and/or signedness from the
values of the ioctl structure for historic reasons. That is why I perform
explicit casts here.

> > +	if ((int)dc->adaption != dlci->adaption)
> > +		need_restart = true;
> > +	if ((unsigned int)dc->mtu != dlci->mtu)
> > +		need_restart = true;
> > +	if ((u8)dc->i != dlci->ftype)
> > +		need_restart = true;
> > +	/* Requires care */
> > +	if ((u8)dc->priority != (u32)dlci->prio)
> > +		need_restart = true;
> 
> And here.

I will remove these.

> > +	if (dlci->mtu)
> 
> dc->mtu?

Right, my mistake. Will be corrected in the next version of this patch.


Best regards,
Daniel Starke

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ