Message ID | 1603974140-531494-2-git-send-email-andrey.zhadchenko@virtuozzo.com |
---|---|
State | New |
Series | "Series without cover letter" |
Headers | show
Delivered-To: criupatchwork@gmail.com Received: from imap.gmail.com [108.177.119.109] by patchwork.criu.org with IMAP (fetchmail-6.4.8) for <root@localhost> (single-drop); Thu, 12 Nov 2020 11:40:26 +0100 (CET) Received: by 2002:a9a:2f:0:b029:91:d28a:c332 with SMTP id 44csp320842lka; Thu, 29 Oct 2020 05:23:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvD6pCwacJCgiFxIr6TY6vwVjYZ011xO2f2En9QZDjN9HdoHjywpSE4coV8ESrNm0Ctne6 X-Received: by 2002:a19:441:: with SMTP id 62mr1404117lfe.304.1603974224788; Thu, 29 Oct 2020 05:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603974224; cv=none; d=google.com; s=arc-20160816; b=LdO1qIzwj4ciE+Js9sRhFQbvJCYbflEn3T544cwtja/SEBU91KqoAiQ1bNFobziuZN MHRVo4YFzzEdg+HdYaxWQCXqqg8wbMJMq3fL9alyln30rjV4erzGd0z7hsfv/A7rw/G5 ZeMfNG5Xt3wk73j/lnrPfhYHEhE6Km+QSMSc9LwrujNDzhQqMR5Tm5RysH1OwRWLVncx 1viStnUr8NsawMKmGijuGFJtvK7b83BmPDXLhmvUU7XW+TAIgWSAkrfcXCNTJLDHfEKf sg358t+zMbw61qrikxTj8YsOGBowh7wxpxQ1jTlOuduLvcO+ZPfXmUozB3v7R/ps/KxY Dm+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from; bh=FiLcJLdkjaVGFtcUsT5JW1ClzRse/RRjQW7a2k+DXa8=; b=aM9oOLvloFI1z3YTtHb64DyaJApnYipuXqkcJY8ND1xj+Q19kHmom9Aocsl2BgLh+i 9WqwBYmkUVvRJS5OANXH83phONF9vnoYM/6atN7IU+Y/xXDSlrqWWOXendKUfN6RwFTc S95BUClir6PkUpo4z7tOQgEbZjlrJdxPbMP0b2lytM5rqhOTSqeJgmAL9+wUCXRB1gK2 NgZDWstN0D+kMh43MqJF/889tDSGGhfhH1B78dVSdtLo7PuJUHlqJ3jOyyrqchvckrq3 jgLJ7Co0Bjl+bwXdQodwtIGRJc6/VVCnt5IrSsYvvueKBgfw2m7v/r/NfQlMCbqJ6OGM hHvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) smtp.mailfrom=devel-bounces@openvz.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Return-Path: <devel-bounces@openvz.org> Received: from mail.openvz.org (mail.openvz.org. [185.231.241.50]) by mx.google.com with ESMTPS id f3si1374120ljj.90.2020.10.29.05.23.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2020 05:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) client-ip=185.231.241.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) smtp.mailfrom=devel-bounces@openvz.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from localhost.localdomain (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 09TCNSaX016095; Thu, 29 Oct 2020 15:23:29 +0300 Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-mr2fra01lp0102.outbound.protection.outlook.com [104.47.25.102]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 09TCNRCY016092 for <devel@openvz.org>; Thu, 29 Oct 2020 15:23:27 +0300 Received: from AM6PR10CA0094.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::35) by PR2PR08MB4665.eurprd08.prod.outlook.com (2603:10a6:101:25::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.24; Thu, 29 Oct 2020 12:23:30 +0000 Received: from HE1EUR01FT055.eop-EUR01.prod.protection.outlook.com (2603:10a6:209:8c:cafe::27) by AM6PR10CA0094.outlook.office365.com (2603:10a6:209:8c::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Thu, 29 Oct 2020 12:23:30 +0000 Authentication-Results: spf=pass (sender IP is 185.231.240.75) smtp.mailfrom=virtuozzo.com; openvz.org; dkim=none (message not signed) header.d=none; openvz.org; dmarc=pass action=none header.from=virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of virtuozzo.com designates 185.231.240.75 as permitted sender) receiver=protection.outlook.com; client-ip=185.231.240.75; helo=relay3.sw.ru; Received: from relay3.sw.ru (185.231.240.75) by HE1EUR01FT055.mail.protection.outlook.com (10.152.1.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Thu, 29 Oct 2020 12:23:29 +0000 Received: from [10.94.4.71] (helo=dptest2.qa.sw.ru) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from <andrey.zhadchenko@virtuozzo.com>) id 1kY6xX-006gmb-A4; Thu, 29 Oct 2020 15:23:15 +0300 From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com> To: andrey.zhadchenko@virtuozzo.com, vvs@virtuozzo.com, ptikhomirov@virtuozzo.com, devel@openvz.org Date: Thu, 29 Oct 2020 15:22:20 +0300 Message-Id: <1603974140-531494-2-git-send-email-andrey.zhadchenko@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603974140-531494-1-git-send-email-andrey.zhadchenko@virtuozzo.com> References: <1603964161-492231-2-git-send-email-andrey.zhadchenko@virtuozzo.com> <1603974140-531494-1-git-send-email-andrey.zhadchenko@virtuozzo.com> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: eb6927f3-bdae-4b6c-6812-08d87c0571d6 X-MS-TrafficTypeDiagnostic: PR2PR08MB4665: X-Forefront-Antispam-Report: CIP:185.231.240.75; CTRY:RU; LANG:en; SCL:-1; SRV:; IPV:CAL; SFV:SKN; H:relay3.sw.ru; PTR:relay.sw.ru; CAT:NONE; SFS:; DIR:INB; X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?5AZsZ8EdD6ipovuLUqfWNA+ne5QIpQYxqB/MY49+s+cuKBvLUavJlp4+qEzR?= =?us-ascii?Q?LDXyWijrn0x6gsLWhSTG0ELeOLsbWnbs93SLUJugttUk5dI1tkUUpG2eVF7y?= =?us-ascii?Q?dPulzIGb6qPXYR7ySndcakA9KaChFwgNglXIVsXGCdZ8XM6ev+tLdYPRs8PG?= =?us-ascii?Q?IcaLDtXZVltovGt2Nlud6YA/+U46lUTttKveFqiFMh+GM2H7ggfDqQ76PFpr?= =?us-ascii?Q?q8qXHWDYw7lyzKVz0LD1VMWr+sCNHyEsVPzT5CxG70eW/P6wJVqjG2P0ww2G?= =?us-ascii?Q?rFfudULH/DIQyI9HHa+8g1d4n/4A5K7SF8jvDoIF7deCmAJKWb7NPRBZoCUv?= =?us-ascii?Q?qKWVaDLGquZwsfzHy8T/m8fRGgkXCLHsKigeyLewmUOcX2qmJvT5/DgCulFa?= =?us-ascii?Q?vE8SauZt7285zsOnhbrr8JMNCdfU8x1wjChYKShV2qKot5fko5mUiGNyO92Y?= =?us-ascii?Q?J21l+PpyE2PCXWltGr1sud8ngdLeYwIGvwZljIy6jHju21wM5ZFfysOeXxNv?= =?us-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5T6XZjxvSt11vTxgck5Ye08K/RlepUrthytv+?= =?us-ascii?Q?bp7gDdmAjGqMdKVv0eCa8zVCZBkQ0hp4?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2020 12:23:29.9397 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb6927f3-bdae-4b6c-6812-08d87c0571d6 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0bc7f26d-0264-416e-a6fc-8352af79c58f; Ip=[185.231.240.75]; Helo=[relay3.sw.ru] X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT055.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4665 X-MS-Exchange-CrossPremises-OriginalClientIPAddress: 185.231.240.75 X-MS-Exchange-CrossPremises-TransportTrafficType: Email X-MS-Exchange-CrossPremises-AuthSource: HE1EUR01FT055.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossPremises-AuthAs: Anonymous X-MS-Exchange-CrossPremises-SCL: -1 X-MS-Exchange-CrossPremises-Processed-By-Journaling: Journal Agent X-OrganizationHeadersPreserved: PR2PR08MB4665.eurprd08.prod.outlook.com Subject: [Devel] [PATCH 2/2 RH7 v2] netlink: add an option to set sk->err from userspace X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development <devel.openvz.org> List-Unsubscribe: <https://lists.openvz.org/mailman/options/devel>, <mailto:devel-request@openvz.org?subject=unsubscribe> List-Archive: <http://lists.openvz.org/pipermail/devel/> List-Post: <mailto:devel@openvz.org> List-Help: <mailto:devel-request@openvz.org?subject=help> List-Subscribe: <https://lists.openvz.org/mailman/listinfo/devel>, <mailto:devel-request@openvz.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org |
diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h index 3756be5..62f8b4b 100644 --- a/include/uapi/linux/netlink.h +++ b/include/uapi/linux/netlink.h @@ -115,6 +115,7 @@ struct nlmsgerr { #define NETLINK_CAP_ACK 10 #define NETLINK_REPAIR2 127 +#define NETLINK_SETERR 128 struct nl_pktinfo { __u32 group; diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 6c99bca..6e0af810 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1542,6 +1542,16 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname, nlk->flags &= ~NETLINK_F_REPAIR; err = 0; break; + case NETLINK_SETERR: + err = -ENOPROTOOPT; + if (nlk->flags & NETLINK_F_REPAIR) { + if (!val || val > MAX_ERRNO) + return -EINVAL; + sk->sk_err = val; + sk->sk_error_report(sk); + err = 0; + } + break; case NETLINK_PKTINFO: if (val) nlk->flags |= NETLINK_F_RECV_PKTINFO;
Sometimes during dump criu can encounter sockets with overflown kernel buffer, which results in ENOBUFS error during next read. We need an reliable way to restore sk->sk_err. https://jira.sw.ru/browse/PSBM-120976 Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com> --- v2: add an option to return EINVAL include/uapi/linux/netlink.h | 1 + net/netlink/af_netlink.c | 10 ++++++++++ 2 files changed, 11 insertions(+)