From patchwork Fri Jan 11 08:12:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li RongQing X-Patchwork-Id: 211236 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AB4C22C00DA for ; Fri, 11 Jan 2013 19:12:56 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754799Ab3AKIMx (ORCPT ); Fri, 11 Jan 2013 03:12:53 -0500 Received: from mail-da0-f41.google.com ([209.85.210.41]:44525 "EHLO mail-da0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753427Ab3AKIMw (ORCPT ); Fri, 11 Jan 2013 03:12:52 -0500 Received: by mail-da0-f41.google.com with SMTP id e20so667448dak.28 for ; Fri, 11 Jan 2013 00:12:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=Q/YOxWSK5tkHT/+1zzZlqOKrSHjaQIdbtTy6qLUtFsI=; b=KVPML2Oqs4GuAyYjyzmL3RgixAwdZAzSBSCTRtOX6Tcx1G/NHp+Wx5iI9hZgTJcSJO ZLYY8vVua2KqDmLwpmX+2RMb260NKJaivLYfzCn8ZAXSQaCxOTWB03oASfIpBscX7uzC zD4znOdQSLcD50afwiu8acoSsXro1eiGO4OS9uXUV0Vc+bdfaql8RjEDNhxt7A4RCBFd EyXOPYSw7UNhcOTIgf0zPmloNIOglqd8Qx5Ysi8eBYtxSre0Jnj+3ngeWkCrniTW+frS M0nT5o2ezcrI9KVz/u2oI+95LsDLRcyMRWKeS9/0U64CwNi4Pt6W9oeuzPNsyRJ/4WvP POzQ== X-Received: by 10.68.252.4 with SMTP id zo4mr229342077pbc.126.1357891971113; Fri, 11 Jan 2013 00:12:51 -0800 (PST) Received: from localhost ([61.148.56.138]) by mx.google.com with ESMTPS id is3sm2379565pbc.6.2013.01.11.00.12.46 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Jan 2013 00:12:50 -0800 (PST) From: roy.qing.li@gmail.com To: netdev@vger.kernel.org Cc: steffen.klassert@secunet.com Subject: [PATCH] xfrm: check if packet is overdue on asynchronous code path Date: Fri, 11 Jan 2013 16:12:45 +0800 Message-Id: <1357891965-8047-1-git-send-email-roy.qing.li@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Li RongQing Currently checking is only done on synchronous code path, we should do the same checking on asynchronous code path. Signed-off-by: Li RongQing --- net/xfrm/xfrm_input.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index ab2bb42..d034324 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c @@ -199,6 +199,12 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) resume: spin_lock(&x->lock); + + if (async && xfrm_state_check_expire(x)) { + XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEEXPIRED); + goto drop_unlock; + } + if (nexthdr <= 0) { if (nexthdr == -EBADMSG) { xfrm_audit_state_icvfail(x, skb,