linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.14 01/19] bpf: do not blindly change rlimit in reuseport net selftest
@ 2018-10-30 13:28 Sasha Levin
  2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 02/19] Revert "perf tools: Fix PMU term format max value calculation" Sasha Levin
                   ` (17 more replies)
  0 siblings, 18 replies; 22+ messages in thread
From: Sasha Levin @ 2018-10-30 13:28 UTC (permalink / raw)
  To: stable, linux-kernel
  Cc: Eric Dumazet, John Sperbeck, Daniel Borkmann, Sasha Levin

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 262f9d811c7608f1e74258ceecfe1fa213bdf912 ]

If the current process has unlimited RLIMIT_MEMLOCK,
we should should leave it as is.

Fixes: 941ff6f11c02 ("bpf: fix rlimit in reuseport net selftest")
Signed-off-by: John Sperbeck <jsperbeck@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/net/reuseport_bpf.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/net/reuseport_bpf.c b/tools/testing/selftests/net/reuseport_bpf.c
index cad14cd0ea92..b5277106df1f 100644
--- a/tools/testing/selftests/net/reuseport_bpf.c
+++ b/tools/testing/selftests/net/reuseport_bpf.c
@@ -437,14 +437,19 @@ void enable_fastopen(void)
 	}
 }
 
-static struct rlimit rlim_old, rlim_new;
+static struct rlimit rlim_old;
 
 static  __attribute__((constructor)) void main_ctor(void)
 {
 	getrlimit(RLIMIT_MEMLOCK, &rlim_old);
-	rlim_new.rlim_cur = rlim_old.rlim_cur + (1UL << 20);
-	rlim_new.rlim_max = rlim_old.rlim_max + (1UL << 20);
-	setrlimit(RLIMIT_MEMLOCK, &rlim_new);
+
+	if (rlim_old.rlim_cur != RLIM_INFINITY) {
+		struct rlimit rlim_new;
+
+		rlim_new.rlim_cur = rlim_old.rlim_cur + (1UL << 20);
+		rlim_new.rlim_max = rlim_old.rlim_max + (1UL << 20);
+		setrlimit(RLIMIT_MEMLOCK, &rlim_new);
+	}
 }
 
 static __attribute__((destructor)) void main_dtor(void)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2018-11-01 17:34 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 13:28 [PATCH AUTOSEL 4.14 01/19] bpf: do not blindly change rlimit in reuseport net selftest Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 02/19] Revert "perf tools: Fix PMU term format max value calculation" Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 03/19] net/mlx5: Take only bit 24-26 of wqe.pftype_wq for page fault type Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 04/19] xfrm: policy: use hlist rcu variants on insert Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 05/19] perf vendor events intel: Fix wrong filter_band* values for uncore events Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 06/19] sparc: Fix single-pcr perf event counter management Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 07/19] sparc: Throttle perf events properly Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 08/19] sparc64: Make proc_id signed Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 09/19] net: fec: don't dump RX FIFO register when not available Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 10/19] sched/fair: Fix the min_vruntime update logic in dequeue_entity() Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 11/19] perf tools: Fix use of alternatives to find JDIR Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 12/19] perf cpu_map: Align cpu map synthesized events properly Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 13/19] x86/fpu: Remove second definition of fpu in __fpu__restore_sig() Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 14/19] net: qla3xxx: Remove overflowing shift statement Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 15/19] virtio_net: avoid using netif_tx_disable() for serializing tx routine Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 16/19] r8169: fix NAPI handling under high load Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 17/19] selftests: ftrace: Add synthetic event syntax testcase Sasha Levin
2018-10-30 14:58   ` Steven Rostedt
2018-10-30 18:21     ` Sasha Levin
2018-11-01 17:34       ` Masami Hiramatsu
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 18/19] net: fix pskb_trim_rcsum_slow() with odd trim offset Sasha Levin
2018-10-30 13:28 ` [PATCH AUTOSEL 4.14 19/19] i2c: rcar: cleanup DMA for all kinds of failure Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).