From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 65F3E4280D; Thu, 23 Mar 2023 17:45:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4673640689; Thu, 23 Mar 2023 17:45:59 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mails.dpdk.org (Postfix) with ESMTP id E8FE34021E; Thu, 23 Mar 2023 17:45:57 +0100 (CET) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32NFAABK005807; Thu, 23 Mar 2023 16:45:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=tbVj7V9Xctm/xkc/4jm213cdeDI7bMq2S7MyOrIFIkQ=; b=XVLjJln6994YQkVe6zk2QE0XqfkQaaghD+1ZgYB1Py/EZUAVG0k9wkh3WmwZFiPvt7mk aWCEQlcxU+KiRvkXPfN/6TlopXrymvBiNs10eR9WdULjkSVqnXcVip25cKdTlRJwfjoC DVLyUiMZzHVK/puBohM+2Nk+DfTJIkOmukxyCVu/ux/OeJ+R+PKLaKrn41L2Wpzqf48Z a/qB86Y7esltGctP+zeOY4XxL/ZtpX9jTSCXdfOknnKU8U+241UrBI0Vc9JyyJbAA3Mb D/XHQF7xJMBKSVbkJ4lP5BxFz7yLQshHRAkBjRxUd4RwLpwEtEEJL1Y5FCslo8zC9oT0 yg== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgkxv3e53-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 16:45:57 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32NG1Arp000374; Thu, 23 Mar 2023 16:45:56 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([9.208.130.99]) by ppma01dal.us.ibm.com (PPS) with ESMTPS id 3pd4x7xm09-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 16:45:56 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NGjtgP38797614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 16:45:55 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0CAF45805E; Thu, 23 Mar 2023 16:45:55 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C47A658062; Thu, 23 Mar 2023 16:45:54 +0000 (GMT) Received: from [9.211.74.38] (unknown [9.211.74.38]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTPS; Thu, 23 Mar 2023 16:45:54 +0000 (GMT) Message-ID: Date: Thu, 23 Mar 2023 09:45:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] net/tap: resolve stringop-overflow with gcc 12 on ppc64le Content-Language: en-US To: Stephen Hemminger Cc: dev@dpdk.org, stable@dpdk.org References: <20230322212439.524725-1-drc@linux.vnet.ibm.com> <20230322164300.2402d9f1@hermes.local> From: David Christensen In-Reply-To: <20230322164300.2402d9f1@hermes.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: y069tw16kQQM9WyiuUGDT56MeHUxmZ6F X-Proofpoint-ORIG-GUID: y069tw16kQQM9WyiuUGDT56MeHUxmZ6F X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-23_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 phishscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230120 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 3/22/23 4:43 PM, Stephen Hemminger wrote: >> static int >> set_mac_type(const char *key __rte_unused, >> const char *value, >> @@ -2311,7 +2288,7 @@ set_mac_type(const char *key __rte_unused, >> goto success; >> } >> >> - if (parse_user_mac(user_mac, value) != 6) >> + if (rte_ether_unformat_addr(value, user_mac) < 0) >> goto error; >> success: >> TAP_LOG(DEBUG, "TAP user MAC param (%s)", value); > > There might still be case where user_mac == NULL since it comes > from extra_args. Ok, I'll fix in v2. > Also, this code has this suspicious code: > > if (!strncasecmp(ETH_TAP_MAC_FIXED, value, strlen(ETH_TAP_MAC_FIXED))) { > static int iface_idx; > > /* fixed mac = 00:64:74:61:70: */ > memcpy((char *)user_mac->addr_bytes, "\0dtap", > RTE_ETHER_ADDR_LEN); > user_mac->addr_bytes[RTE_ETHER_ADDR_LEN - 1] = > iface_idx++ + '0'; > goto success; > } > > The OUI for that MAC address is not registered but it might be someday. > Choosing magic constants in IANA assigned space is not best practice. > Unless some vendor wants to spend lots of time registering these. > > Better to use locally assigned value. See RFC7042 for more details. I think that's out of scope for this issue. Opened a DPDK Bugzilla to document the concern which changes "\0dtap" to "\002dtap" to set the local bit as required by the RFC. I'll send out the patch for code and documentation after 23.03 is released. Dave