Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/include/asm/uaccess.h

    r679 r772  
    4444int is_access_ok(int type, void *addr, unsigned long size);
    4545
    46 #define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))
    47 
    4846/*
    4947 * The architecture should really override this if possible, at least
    5048 * doing a check on the get_fs()
    5149 */
    52 static inline int __access_ok(unsigned long addr, unsigned long size)
     50static inline int __access_ok(const void __user *ptr, unsigned long size)
     51
    5352{
    5453        return 1;
    5554}
     55
     56#define access_ok(addr, size) __access_ok(addr, size)
    5657
    5758#define verify_area(type, addr, size) (access_ok(type, (void *)addr,size) ? 0 : -EFAULT)
     
    235236#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
    236237long strnlen_user(const char *str, long n);
    237 unsigned long clear_user(void *mem, unsigned long len);
    238 unsigned long __clear_user(void *mem, unsigned long len);
     238/*
     239 * Zero Userspace
     240 */
     241#ifndef __clear_user
     242static inline __must_check unsigned long
     243__clear_user(void __user *to, unsigned long n)
     244{
     245        memset((void __force *)to, 0, n);
     246        return 0;
     247}
     248#endif
     249
     250static inline __must_check unsigned long
     251clear_user(void __user *to, unsigned long n)
     252{
     253        if (!access_ok(to, n))
     254                return n;
     255
     256        return __clear_user(to, n);
     257}
    239258
    240259#endif /* __i386_UACCESS_H */
Note: See TracChangeset for help on using the changeset viewer.