From patchwork Fri Jun 3 17:18:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 9153771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A4CE96082E for ; Fri, 3 Jun 2016 17:18:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9051A2804C for ; Fri, 3 Jun 2016 17:18:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84E2328327; Fri, 3 Jun 2016 17:18:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15FC42804C for ; Fri, 3 Jun 2016 17:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752714AbcFCRSX (ORCPT ); Fri, 3 Jun 2016 13:18:23 -0400 Received: from mout.gmx.net ([212.227.15.15]:49679 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751579AbcFCRSW (ORCPT ); Fri, 3 Jun 2016 13:18:22 -0400 Received: from ls3530.box ([92.203.38.178]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MfF6I-1apfp42bzG-00OnE0; Fri, 03 Jun 2016 19:18:08 +0200 Date: Fri, 3 Jun 2016 19:18:05 +0200 From: Helge Deller To: Craig Gallek , Alexei Starovoitov , "David S. Miller" , netdev@vger.kernel.org Cc: linux-parisc@vger.kernel.org Subject: [PATCH] soreuseport: add compat case for setsockopt SO_ATTACH_REUSEPORT_CBPF Message-ID: <20160603171805.GA3664@ls3530.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:AJiOXifdu1ewN7NmHbHkLzxsTjYNU6/VX8VW/w5N0rfaa6KeYy4 D+Dcd+aYq5MZdmGwvURhmU6TuWoXOcpJvBTh0UgHvdnprLnuf9EfJJGhC2Xi9kIdIBYpIIF 1xQMW4nYSeWMuv2RcFFsbPhtQaZR/ogvG7OUlRSDWhrk89txZEwMw9EA8mqCRXDWhzJjNRj iz8Afxf40jqSMhSdXhVVA== X-UI-Out-Filterresults: notjunk:1; V01:K0:taAovmdbLj0=:h4HLDgpiKi/i3ChCPjnMtA wzPDFZ2yy0ZoPzfuGSTRRzWsvDx+PHRus0lkLL57hYWV4e/cN8r1W9waET0YWmvujsQGm0ffK 0sB3XUaYwQHQMXVH3WVbVFQBo3WzIZUQn82MhljDvceWUi62WTetl/hdAOB//yBAmdTAV+RUc LvJJeZW5DOWKTf+NV2BoaYLxnS9AeP5ugcpM3wZecSVNWyZWZly3wF9q6cqB5hW/mvnBlRbzE +oVfi0KRjRF+H7mQapUkH8ugmCxhB+Sik+cDMADbzEKNmSdNaYZFUsdXSUcJDBcmvc+wn0coT uwthrcXllMW8WCg79TgDlI55hUL44pcsjK/TpNTu1o3jdpPskusrgp7UQw/AaXW68H5K4lgfQ i56Dii5RsYgUcBNya8J5tua1j/841tuU9NZI5UTQokPTh3/JpHeySpA8Zv7wsdbmHRKfDl8XB AVp+8XjWMWKgidHrSTFNk5uPSatSS3cwRu9pNrCpEv5T0sa1ROfEuyI5kWZml/toYmFDDKAJt 3g6n/Z5gZNM0Www0IcNMeZ7V7S0EPuqjY8z0wh3Na0SxdWaqCV4kByo8JMHL9SqlV2AMsso/n 7sm+8H4EGjuBFgf7YHUWBf5S32vTi0/FlroiEQF4H9Tht1S/a3DwELhA4C9B/YlKGCb6URFnW /ir2DeKhrzrOENg9JytT9f7RLXo5lClWoxAibl6LHq1FYJPE53VCZfd8+Mll2+/wehTDDOi/F SfX05470Lluy6UBIa7R7Xqi4bBxKaTs6J1mD04p22UEKDNJMfMTBZfubCuY= Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 538950a ("soreuseport: setsockopt SO_ATTACH_REUSEPORT_[CE]BPF") missed to add the compat case for the SO_ATTACH_REUSEPORT_CBPF setsockoption() option. Since both SO_ATTACH_FILTER and SO_ATTACH_REUSEPORT_CBPF use a struct sock_fprog let's combine the handling of both. Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/compat.c b/net/compat.c index 5cfd26a..7e2aac9 100644 --- a/net/compat.c +++ b/net/compat.c @@ -309,7 +309,7 @@ void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm) __scm_destroy(scm); } -static int do_set_attach_filter(struct socket *sock, int level, int optname, +static int do_sockopt_fix_sock_fprog(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { struct compat_sock_fprog __user *fprog32 = (struct compat_sock_fprog __user *)optval; @@ -354,8 +354,9 @@ static int do_set_sock_timeout(struct socket *sock, int level, static int compat_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { - if (optname == SO_ATTACH_FILTER) - return do_set_attach_filter(sock, level, optname, + if (optname == SO_ATTACH_FILTER || + optname == SO_ATTACH_REUSEPORT_CBPF) + return do_sockopt_fix_sock_fprog(sock, level, optname, optval, optlen); if (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO) return do_set_sock_timeout(sock, level, optname, optval, optlen);