Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8477700rwp; Wed, 19 Jul 2023 10:18:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7EE62lnMwgg21bWfes+MLRBHstuwi09aktIiueXlEpDXVb2pbMtc888lRB/zT/sEu8U17 X-Received: by 2002:a17:906:15d:b0:993:ea6b:edf6 with SMTP id 29-20020a170906015d00b00993ea6bedf6mr2845893ejh.0.1689787090726; Wed, 19 Jul 2023 10:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689787090; cv=none; d=google.com; s=arc-20160816; b=xsM3CNhtA1muGkP1bcV7uJt6pcFwNzyvM/f7n4nMEj3YOujI4qzpo0v0/ugCtNBnCM JK7reJuXfppiaUawA6QaOaVgE48eHGxHZ/rK62m1zR64IcQTdd63bbN7BDYt4CafZcRX d4SMfvBeMBMDfDANbEXIKxy0Be1JYoej/bgWQJl+nfMvuMbe1tNKaG+btqEwBgsw6m6p OJ3f62MVnoqqflObmHBob4kW7TCvXiRQh2haVMUeC0pnTHzCiIm4H5Gnzh/hGHrE7s/M pPXmnr8BQiSsUvR6JR47O8QfzFDJV6zh0vdLIu/xzaOtl00V9IxTt6cmst6Q3D4xOSHY Z1pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n3xuV25OzbskrlT52LWtJFNWdqbbfavJdeAVLDvE9YI=; fh=ZtFECbHo7s4BonE6ONdBXyHdo6kuM6Z6Gbs6g/zBjho=; b=Z1NYztf8ytjQfcYRprzJG9N+LmkHgzc9S9/mav/C1gsQILzlRQCnPmHzVOn7Pw7upt iyNNI7IzoQ5tEcF22mlbc8IXXkyKoVnXjkoCErTItxdHG7sy7H+NEK1PFJRcRlzZ97Qv ccKcO8VD5KjMbrtxpa4EJzfbqE0hyUHjv6VxP0GMepabMOl/xW5ZGn0SYBVhPMGoXu9l GtzNne9co+9IFIjnBwQ+lqn9miPspQLC4pjmw1m/OrdgOTOjC7dMbRusBH+4VO9HQK+R T8+9dNgIh+GGGNaUKQAD6ADptLEQPxCWPWjDNSh8fkXNekXjeFa7AXnbGK7KmjMMlUu+ fWBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ABkJ3+Eh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g7-20020a17090669c700b00992bbb918dfsi2830217ejs.173.2023.07.19.10.17.46; Wed, 19 Jul 2023 10:18:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ABkJ3+Eh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbjGSRFG (ORCPT + 99 others); Wed, 19 Jul 2023 13:05:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjGSRFE (ORCPT ); Wed, 19 Jul 2023 13:05:04 -0400 Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69D1510CB; Wed, 19 Jul 2023 10:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1689786303; x=1721322303; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n3xuV25OzbskrlT52LWtJFNWdqbbfavJdeAVLDvE9YI=; b=ABkJ3+EhI+BnK7bDkvCYxCH+vy/K4j/utwNEGM5r2staL0z2TC16M/Di mS7VTynCOIV9AFMVNgZaHwef3ZdE/vgvJc3j7YRbZAclaK+OrylZ1TIWr 4wtPjiqoiiFaUqqlKeHpJhFIhfbuIL2Jh+cdEgTQom8e1d0EzbKs0ZCt9 M=; X-IronPort-AV: E=Sophos;i="6.01,216,1684800000"; d="scan'208";a="227505479" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2c-m6i4x-d2040ec1.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2023 17:05:00 +0000 Received: from EX19MTAUWC002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2c-m6i4x-d2040ec1.us-west-2.amazon.com (Postfix) with ESMTPS id DF90E40DA2; Wed, 19 Jul 2023 17:04:58 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWC002.ant.amazon.com (10.250.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 19 Jul 2023 17:04:57 +0000 Received: from 88665a182662.ant.amazon.com (10.187.170.21) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 19 Jul 2023 17:04:53 +0000 From: Kuniyuki Iwashima To: CC: , , , , , , , , , , , , , Subject: Re: [PATCH net-next] net: Use _K_SS_MAXSIZE instead of absolute value Date: Wed, 19 Jul 2023 10:04:45 -0700 Message-ID: <20230719170445.30993-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230719084415.1378696-1-leitao@debian.org> References: <20230719084415.1378696-1-leitao@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.187.170.21] X-ClientProxiedBy: EX19D043UWC003.ant.amazon.com (10.13.139.240) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Breno Leitao Date: Wed, 19 Jul 2023 01:44:12 -0700 > Looking at sk_getsockopt function, it is unclear why 128 is a magical > number. > > Use the proper macro, so it becomes clear to understand what the value > mean, and get a reference where it is coming from (user-exported API). > > Signed-off-by: Breno Leitao > --- > net/core/sock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/core/sock.c b/net/core/sock.c > index 9370fd50aa2c..58b6f00197d6 100644 > --- a/net/core/sock.c > +++ b/net/core/sock.c > @@ -1815,7 +1815,7 @@ int sk_getsockopt(struct sock *sk, int level, int optname, > > case SO_PEERNAME: > { > - char address[128]; > + char address[_K_SS_MAXSIZE]; I guess you saw a bug caught by the fortified memcpy(), but this doesn't fix it properly. I'll post a series soon that fix the issue and another realted one. Thanks! > > lv = sock->ops->getname(sock, (struct sockaddr *)address, 2); > if (lv < 0) > -- > 2.34.1