From 64d64ab33a7cb073492013258ed3e465d3358cbd Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 27 Jun 2023 19:23:51 +0200 Subject: cooker/match: Fix mask calculation for GNU_DEV_MINOR Starting from Linux 2.6 series, we have 20 bits of minor (not 32) and the gap between low and high bits is 12 bits, meaning the high ones are shifted by 20 (not 12). Signed-off-by: Stefano Brivio --- cooker/match.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cooker/match.c') diff --git a/cooker/match.c b/cooker/match.c index 776823d..c1f5fa8 100644 --- a/cooker/match.c +++ b/cooker/match.c @@ -106,9 +106,9 @@ ______________________ _____________ case GNU_DEV_MINOR: /* xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx - ____________________________ ________ + _____________ ________ */ - v.v_num = 0xff | ((long long)0xffffff << 12); + v.v_num = 0xff | ((long long)0xfff << 20); mask_offset = emit_data(g, U64, 0, &v); offset = emit_bitwise(g, U64, BITWISE_AND, NULL_OFFSET, offset, mask_offset); -- cgit v1.2.3