~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to src/patches/ffmpeg-6.0-mathpops-clip-constants-used-with-shift.patch

  • Committer: Peter Müller
  • Date: 2022-04-23 14:27:56 UTC
  • mto: This revision was merged to the branch mainline in revision 9750.
  • Revision ID: git-v1:7a981d94cb2c3e48ecaf07c506c8353a2c839d79
SSH: do not send spoofable TCP keep alive messages

By default, both SSH server and client rely on TCP-based keep alive
messages to detect broken sessions, which can be spoofed rather easily
in order to keep a broken session opened (and vice versa).

Since we rely on SSH-based keep alive messages, which are not vulnerable
to this kind of tampering, there is no need to double-check connections
via TCP keep alive as well.

This patch thereof disables using TCP keep alive for both SSH client and
server scenario. For usability reasons, a timeout of 5 minutes (10
seconds * 30 keep alive messages = 300 seconds) will be used for both
client and server configuration, as 60 seconds were found to be too
short for unstable connectivity scenarios.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001
2
 
From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
3
 
Date: Sun, 16 Jul 2023 18:18:02 +0300
4
 
Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift
5
 
 instructions within inline assembly
6
 
 
7
 
Fixes assembling with binutil as >= 2.41
8
 
 
9
 
Signed-off-by: James Almer <jamrial@gmail.com>
10
 
---
11
 
 libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++---
12
 
 1 file changed, 23 insertions(+), 3 deletions(-)
13
 
 
14
 
diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
15
 
index 6298f5ed19..ca7e2dffc1 100644
16
 
--- a/libavcodec/x86/mathops.h
17
 
+++ b/libavcodec/x86/mathops.h
18
 
@@ -35,12 +35,20 @@
19
 
 static av_always_inline av_const int MULL(int a, int b, unsigned shift)
20
 
 {
21
 
     int rt, dummy;
22
 
+    if (__builtin_constant_p(shift))
23
 
     __asm__ (
24
 
         "imull %3               \n\t"
25
 
         "shrdl %4, %%edx, %%eax \n\t"
26
 
         :"=a"(rt), "=d"(dummy)
27
 
-        :"a"(a), "rm"(b), "ci"((uint8_t)shift)
28
 
+        :"a"(a), "rm"(b), "i"(shift & 0x1F)
29
 
     );
30
 
+    else
31
 
+        __asm__ (
32
 
+            "imull %3               \n\t"
33
 
+            "shrdl %4, %%edx, %%eax \n\t"
34
 
+            :"=a"(rt), "=d"(dummy)
35
 
+            :"a"(a), "rm"(b), "c"((uint8_t)shift)
36
 
+        );
37
 
     return rt;
38
 
 }
39
 
 
40
 
@@ -113,19 +121,31 @@ __asm__ volatile(\
41
 
 // avoid +32 for shift optimization (gcc should do that ...)
42
 
 #define NEG_SSR32 NEG_SSR32
43
 
 static inline  int32_t NEG_SSR32( int32_t a, int8_t s){
44
 
+    if (__builtin_constant_p(s))
45
 
     __asm__ ("sarl %1, %0\n\t"
46
 
          : "+r" (a)
47
 
-         : "ic" ((uint8_t)(-s))
48
 
+         : "i" (-s & 0x1F)
49
 
     );
50
 
+    else
51
 
+        __asm__ ("sarl %1, %0\n\t"
52
 
+               : "+r" (a)
53
 
+               : "c" ((uint8_t)(-s))
54
 
+        );
55
 
     return a;
56
 
 }
57
 
 
58
 
 #define NEG_USR32 NEG_USR32
59
 
 static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
60
 
+    if (__builtin_constant_p(s))
61
 
     __asm__ ("shrl %1, %0\n\t"
62
 
          : "+r" (a)
63
 
-         : "ic" ((uint8_t)(-s))
64
 
+         : "i" (-s & 0x1F)
65
 
     );
66
 
+    else
67
 
+        __asm__ ("shrl %1, %0\n\t"
68
 
+               : "+r" (a)
69
 
+               : "c" ((uint8_t)(-s))
70
 
+        );
71
 
     return a;
72
 
 }
73
 
 
74
 
2.25.1
75