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]
Date:   Wed, 26 Jan 2022 01:00:15 +0000
From:   Phillip Potter <phil@...lpotter.co.uk>
To:     Pavel Skripkin <paskripkin@...il.com>
Cc:     dan.carpenter@...cle.com, Larry.Finger@...inger.net,
        straube.linux@...il.com, martin@...ser.cx,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/10] staging: r8188eu: remove smaller sets of DBG_88E
 calls from core dir

On Tue, Jan 25, 2022 at 09:17:46PM +0300, Pavel Skripkin wrote:
> Hi Phillip,
> 
> On 1/25/22 01:44, Phillip Potter wrote:
> > Remove all DBG_88E calls from the core directory, other than those in
> > core/rtw_mlme_ext.c, as this contains over 100 on its own so will be
> > done in a separate patch for ease of review. These calls do not conform
> > to kernel coding standards and are superfluous. Also restructure where
> > appropriate to remove no longer needed code left behind by removal of
> > these calls. This will allow the eventual removal of the DBG_88E macro
> > itself.
> > 
> > Signed-off-by: Phillip Potter <phil@...lpotter.co.uk>
> > ---
> 
> [code snip]
> 
> > diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c
> > index ad87954bdeb4..62354c3194bd 100644
> > --- a/drivers/staging/r8188eu/core/rtw_ieee80211.c
> > +++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c
> > @@ -653,13 +653,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
> >   	/* first 3 bytes in vendor specific information element are the IEEE
> >   	 * OUI of the vendor. The following byte is used a vendor specific
> >   	 * sub-type. */
> > -	if (elen < 4) {
> > -		if (show_errors) {
> > -			DBG_88E("short vendor specific information element ignored (len=%lu)\n",
> > -				(unsigned long)elen);
> > -		}
> > +	if (elen < 4)
> >   		return -1;
> > -	}
> 
> show_errors seems unused after this change
> 
> >   	oui = RTW_GET_BE24(pos);
> >   	switch (oui) {
> > @@ -674,11 +669,8 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
> >   			elems->wpa_ie_len = elen;
> >   			break;
> >   		case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */
> > -			if (elen < 5) {
> > -				DBG_88E("short WME information element ignored (len=%lu)\n",
> > -					(unsigned long)elen);
> > +			if (elen < 5)
> >   				return -1;
> > -			}
> >   			switch (pos[4]) {
> >   			case WME_OUI_SUBTYPE_INFORMATION_ELEMENT:
> >   			case WME_OUI_SUBTYPE_PARAMETER_ELEMENT:
> > @@ -690,8 +682,6 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
> >   				elems->wme_tspec_len = elen;
> >   				break;
> >   			default:
> > -				DBG_88E("unknown WME information element ignored (subtype=%d len=%lu)\n",
> > -					pos[4], (unsigned long)elen);
> >   				return -1;
> >   			}
> >   			break;
> > @@ -701,8 +691,6 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
> >   			elems->wps_ie_len = elen;
> >   			break;
> >   		default:
> > -			DBG_88E("Unknown Microsoft information element ignored (type=%d len=%lu)\n",
> > -				pos[3], (unsigned long)elen);
> >   			return -1;
> >   		}
> >   		break;
> > @@ -714,14 +702,10 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
> >   			elems->vendor_ht_cap_len = elen;
> >   			break;
> >   		default:
> > -			DBG_88E("Unknown Broadcom information element ignored (type=%d len=%lu)\n",
> > -				pos[3], (unsigned long)elen);
> >   			return -1;
> >   		}
> >   		break;
> >   	default:
> > -		DBG_88E("unknown vendor specific information element ignored (vendor OUI %02x:%02x:%02x len=%lu)\n",
> > -			pos[0], pos[1], pos[2], (unsigned long)elen);
> >   		return -1;
> >   	}
> >   	return 0;
> > @@ -752,13 +736,8 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len,
> >   		elen = *pos++;
> >   		left -= 2;
> > -		if (elen > left) {
> > -			if (show_errors) {
> > -				DBG_88E("IEEE 802.11 element parse failed (id=%d elen=%d left=%lu)\n",
> > -					id, elen, (unsigned long)left);
> > -			}
> 
> same here
> 
> > +		if (elen > left)
> >   			return ParseFailed;
> > -		}
> >   		switch (id) {
> >   		case WLAN_EID_SSID:
> > @@ -839,10 +818,6 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len,
> >   			break;
> >   		default:
> >   			unknown++;
> > -			if (!show_errors)
> > -				break;
> > -			DBG_88E("IEEE 802.11 element parse ignored unknown element (id=%d elen=%d)\n",
> > -				id, elen);
> >   			break;
> 
> and here
> 
> 
> 
> With regards,
> Pavel Skripkin

Thanks, will take a further look when I fix up for v2.

Regards,
Phil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ