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] [day] [month] [year] [list]
Message-ID: <b00d9bc1cbe24fe4b0f83706427b84db@AcuMS.aculab.com>
Date:   Thu, 7 Apr 2022 08:36:46 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Michael Straube' <straube.linux@...il.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC:     "Larry.Finger@...inger.net" <Larry.Finger@...inger.net>,
        "phil@...lpotter.co.uk" <phil@...lpotter.co.uk>,
        "linux-staging@...ts.linux.dev" <linux-staging@...ts.linux.dev>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2 3/5] staging: r8188eu: use round_up() instead of
 _RND8()

From: Michael Straube
> Sent: 06 April 2022 18:22
> 
> Use in-kernel round_up() instead of custom _RND8().
...
> diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
> b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
...
> @@ -488,7 +488,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmit
> 
>  		len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE + (pxmitframe->pkt_offset *
> PACKET_OFFSET_SZ);
> 
> -		if (_RND8(pbuf + len) > MAX_XMITBUF_SZ) {
> +		if (round_up(pbuf + len, 8) > MAX_XMITBUF_SZ) {

It can't be necessary to round_up there.
It is equivalent to:
		if (pbuf + len > (MAX_XMITBUF_SZ & ~7))
and the limit is/should be a multiple of 8.

	David

>  			pxmitframe->agg_num = 1;
>  			pxmitframe->pkt_offset = 1;
>  			break;

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ