__atomic_load_n(&test_var, __ATOMIC_RELAXED);
 }
 
+static noinline void test_kernel_xor_1bit(void)
+{
+       /* Do not report data races between the read-writes. */
+       kcsan_nestable_atomic_begin();
+       test_var ^= 0x10000;
+       kcsan_nestable_atomic_end();
+}
+
 /* ===== Test cases ===== */
 
 /* Simple test with normal data race. */
        KUNIT_EXPECT_FALSE(test, match_never);
 }
 
+__no_kcsan
+static void test_1bit_value_change(struct kunit *test)
+{
+       const struct expect_report expect = {
+               .access = {
+                       { test_kernel_read, &test_var, sizeof(test_var), 0 },
+                       { test_kernel_xor_1bit, &test_var, sizeof(test_var), __KCSAN_ACCESS_RW(KCSAN_ACCESS_WRITE) },
+               },
+       };
+       bool match = false;
+
+       begin_test_checks(test_kernel_read, test_kernel_xor_1bit);
+       do {
+               match = IS_ENABLED(CONFIG_KCSAN_PERMISSIVE)
+                               ? report_available()
+                               : report_matches(&expect);
+       } while (!end_test_checks(match));
+       if (IS_ENABLED(CONFIG_KCSAN_PERMISSIVE))
+               KUNIT_EXPECT_FALSE(test, match);
+       else
+               KUNIT_EXPECT_TRUE(test, match);
+}
+
 /*
  * Generate thread counts for all test cases. Values generated are in interval
  * [2, 5] followed by exponentially increasing thread counts from 8 to 32.
        KCSAN_KUNIT_CASE(test_jiffies_noreport),
        KCSAN_KUNIT_CASE(test_seqlock_noreport),
        KCSAN_KUNIT_CASE(test_atomic_builtins),
+       KCSAN_KUNIT_CASE(test_1bit_value_change),
        {},
 };
 
 
 #ifndef _KERNEL_KCSAN_PERMISSIVE_H
 #define _KERNEL_KCSAN_PERMISSIVE_H
 
+#include <linux/bitops.h>
+#include <linux/sched.h>
 #include <linux/types.h>
 
 /*
        if (!IS_ENABLED(CONFIG_KCSAN_PERMISSIVE))
                return false;
 
-       return false;
+       /*
+        * Data-racy bitops on current->flags are too common, ignore completely
+        * for now.
+        */
+       return ptr == ¤t->flags;
 }
 
 /*
        if (type || size > sizeof(long))
                return false;
 
+       /*
+        * A common pattern is checking/setting just 1 bit in a variable; for
+        * example:
+        *
+        *      if (flags & SOME_FLAG) { ... }
+        *
+        * and elsewhere flags is updated concurrently:
+        *
+        *      flags |= SOME_OTHER_FLAG; // just 1 bit
+        *
+        * While it is still recommended that such accesses be marked
+        * appropriately, in many cases these types of data races are so common
+        * that marking them all is often unrealistic and left to maintainer
+        * preference.
+        *
+        * The assumption in all cases is that with all known compiler
+        * optimizations (including those that tear accesses), because no more
+        * than 1 bit changed, the plain accesses are safe despite the presence
+        * of data races.
+        *
+        * The rules here will ignore the data races if we observe no more than
+        * 1 bit changed.
+        *
+        * Of course many operations can effecively change just 1 bit, but the
+        * general assuption that data races involving 1-bit changes can be
+        * tolerated still applies.
+        *
+        * And in case a true bug is missed, the bug likely manifests as a
+        * reportable data race elsewhere.
+        */
+       if (hweight64(diff) == 1) {
+               /*
+                * Exception: Report data races where the values look like
+                * ordinary booleans (one of them was 0 and the 0th bit was
+                * changed) More often than not, they come with interesting
+                * memory ordering requirements, so let's report them.
+                */
+               if (!((!old || !new) && diff == 1))
+                       return true;
+       }
+
        return false;
 }