From owner-freebsd-hackers@freebsd.org Wed Aug 7 03:05:14 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA6EABC089 for ; Wed, 7 Aug 2019 03:05:14 +0000 (UTC) (envelope-from brightiup.zhuo@gmail.com) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463GZx66jDz47Yx for ; Wed, 7 Aug 2019 03:05:13 +0000 (UTC) (envelope-from brightiup.zhuo@gmail.com) Received: by mail-ot1-x32e.google.com with SMTP id x21so5236427otq.12 for ; Tue, 06 Aug 2019 20:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=4tm6+20Mp08NpLzY/3Z/ibrY24mKTJVlQU1hePLNdLA=; b=tG7xP1N3HOotvmWpQKrfDXm8xPEA/hOnzB1nCCAVpElnjeEbKwxpoXHvkraZ6MwSZK BY0mSxnDCXtmIBgsbzihYAEFRAr1gAzEAvVF5NZrTuGYBpyuOYwFWRCkE3Ic6JSEpS5v URc5mGW/ByLF30GP3j6ArPJD+lXCBEXke8fuh6Kv8+4z+jkGVqaPiuNnUhe2svjia4hE V/ax+bOA6T45kTE+bL9fXu0+iH6Hb3vV73+8Kd/GrZF/mUT6U/wkIagjlwqSKBi4gA4f AKb0kzOmxe8d0tAe4VAl00oMkCHy349TVu4CZhYHWxiUmOU82IC0qVUpegvFtjM1htaT 6MXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4tm6+20Mp08NpLzY/3Z/ibrY24mKTJVlQU1hePLNdLA=; b=LGH8m31Hxvcal5whle0ynF8+Dl1AHcvqpy1GJKU5jvdQjT0cRJ6s5m4nnX5dV2ekRv zctnOCwzkUAntxuYYByF71rGhWMoEHElFoqWIgiKMijz+FM6SsbXGxg1LsZxuACYeYou LcMo0OJlF7Ure/JvHGqHJoH7NR4K/cZjNLDM+5gYsZ3jebWlGuRLZ8Y8e/InPujMXXOW 49i7tLvPbKVBtJ3rwf1ZV6NyJtiuBNXBhK698KapH0xtciaYvxiLVcI+9wSzz3itpdup L7kutgGDOMlrtCCcqVtf/A24iPHophHMIMyPUqV6UhCC0RxWhon76+5cRe/oBQQNx7m4 Gh9Q== X-Gm-Message-State: APjAAAWTQNkY6bUxmP1QcZQxW3v9pudqEehzuGLWK4fkeXWq0G2i5iCT 8Xx99Ag8m20s1AK4L6HfNHOl72YyKBiTvPYyDvxSuLZAOIc= X-Google-Smtp-Source: APXvYqyyJsygO1gXs2AslWUHgYR9J/5la5qTE+8BEpUh5d/+56J+Dz590T3GB4+pHVXHauGsYD8iGi5I9K13lKEetTo= X-Received: by 2002:a5e:8f08:: with SMTP id c8mr6121473iok.52.1565147112529; Tue, 06 Aug 2019 20:05:12 -0700 (PDT) MIME-Version: 1.0 From: Liang Zhuo Message-ID: Subject: Force kernel epoch calls To: freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 463GZx66jDz47Yx X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=tG7xP1N3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of brightiupzhuo@gmail.com designates 2607:f8b0:4864:20::32e as permitted sender) smtp.mailfrom=brightiupzhuo@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-9.14), ipnet: 2607:f8b0::/32(-3.05), asn: 15169(-2.45), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[e.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Mailman-Approved-At: Sat, 12 Oct 2019 23:39:36 +0000 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 07 Aug 2019 03:05:15 -0000 X-Original-Date: Wed, 7 Aug 2019 11:05:01 +0800 X-List-Received-Date: Wed, 07 Aug 2019 03:05:15 -0000 Hi list, I have a problem with *epoch* while I am trying to write an exploit of a FreeBSD kernel bug. Specifically, many schedules are managed by epoch system, like *if_destroy()* which destroys a *struct ifnet* object, and *in_pcbfree_\* *defered()* which destroys a *struct inpcb* object. My question is that these schedules will only be called just before the process exits by *epoch_call_task() *as follow: fork_exit() -> gtaskqueue_thread_loop() -> gtaskqueue_run_locked() -> epoch_call_task() -> if_destroy()/in_pcbfree_defered() But I need to control the time of freeing of those objects as better as synchronization. Do do I have any methods to force these calls in epoch system to be called? Thanks, Brightiup