From patchwork Thu Jan 3 22:43:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Ignatov X-Patchwork-Id: 1020537 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=fb.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.b="MWJ/bpkZ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43W2yd0xrDz9s3l for ; Fri, 4 Jan 2019 09:43:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbfACWnt (ORCPT ); Thu, 3 Jan 2019 17:43:49 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:47204 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728601AbfACWns (ORCPT ); Thu, 3 Jan 2019 17:43:48 -0500 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x03McG9U016479 for ; Thu, 3 Jan 2019 14:43:47 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=sO892LWpuzbeJk25cOkuH1hEVUPnUtDELD25qL9Jff8=; b=MWJ/bpkZEEJkWyBhfsOA5CZNMpUgW1CGL8LNeEPQlV9Y7XWlaYECvC9cD9jiRT5sxAGh REzxZ1WuWFRriDWfULxQNznSsRM88VwKcokCIhSpQuIHRdmDz1DIxq3XKWLo9vk67D0z NSTn1++UDl2CDBPOzkh/cC9PfJ7zftikW8E= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2psrk8gj58-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 03 Jan 2019 14:43:47 -0800 Received: from mx-out.facebook.com (2620:10d:c081:10::13) by mail.thefacebook.com (2620:10d:c081:35::126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1531.3; Thu, 3 Jan 2019 14:43:44 -0800 Received: by dev082.prn2.facebook.com (Postfix, from userid 572249) id 7E8433702B1F; Thu, 3 Jan 2019 14:43:38 -0800 (PST) Smtp-Origin-Hostprefix: dev From: Andrey Ignatov Smtp-Origin-Hostname: dev082.prn2.facebook.com To: CC: Andrey Ignatov , , , , Smtp-Origin-Cluster: prn2c23 Subject: [PATCH bpf 0/2] bpf: Fix [::] -> [::1] rewrite in sys_sendmsg Date: Thu, 3 Jan 2019 14:43:18 -0800 Message-ID: X-Mailer: git-send-email 2.17.1 X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-01-03_10:, , signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The patch set fixes BSD'ism in sys_sendmsg to rewrite unspecified destination IPv6 for unconnected UDP sockets in sys_sendmsg with [::1] in case when either CONFIG_CGROUP_BPF is enabled or when sys_sendmsg BPF hook sets destination IPv6 to [::]. Patch 1 is the fix and provides more details. Patch 2 adds two test cases to verify the fix. Andrey Ignatov (2): bpf: Fix [::] -> [::1] rewrite in sys_sendmsg selftests/bpf: Test [::] -> [::1] rewrite in sys_sendmsg in test_sock_addr net/ipv6/udp.c | 8 +-- tools/testing/selftests/bpf/test_sock_addr.c | 53 ++++++++++++++++++-- 2 files changed, 54 insertions(+), 7 deletions(-)