lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <be871547-5fbc-e273-a8ae-97defe75b85c@huawei.com>
Date:   Thu, 3 Jun 2021 18:31:57 +0800
From:   "tiantao (H)" <tiantao6@...wei.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Tian Tao <tiantao6@...ilicon.com>
CC:     <gregkh@...uxfoundation.org>, <rafael@...nel.org>,
        <akpm@...ux-foundation.org>, <linux-kernel@...r.kernel.org>,
        <jonathan.cameron@...wei.com>, <song.bao.hua@...ilicon.com>
Subject: Re: [PATCH v3 3/3] drivers/base/node.c: use bin_attribute to avoid
 buff overflow


在 2021/6/3 17:53, Andy Shevchenko 写道:
> On Thu, Jun 03, 2021 at 05:22:42PM +0800, Tian Tao wrote:
>> Reading sys/devices/system/cpu/cpuX/nodeX/ returns cpumap and cpulist.
>> However, the size of this file is limited to PAGE_SIZE because of the
>> limitation for sysfs attribute. so we use bin_attribute instead of
>> attribute to avoid NR_CPUS too big to cause buff overflow.
> ...
>
>>   }
>>   
>> -static DEVICE_ATTR_RO(cpumap);
>>   
>> -static inline ssize_t cpulist_show(struct device *dev,
>> -				   struct device_attribute *attr,
>> -				   char *buf)
>> +static BIN_ATTR_RO(cpumap, 0);
> So, you will have 2 blank lines in a row after this. Why one is not enough?
> Same question for other similar cases, if any.

  I can delete the line 55. this is the only problem, are there any 
other problems?

47 static inline ssize_t cpumap_read(struct file *file, struct kobject 
*kobj,

   48                                   struct bin_attribute *attr, char 
*buf,
   49                                   loff_t off, size_t count)
   50 {
   51         struct device *dev = kobj_to_dev(kobj);
   52
   53         return node_read_cpumap(dev, false, buf, off, count);
   54 }
   55
   56
   57 static BIN_ATTR_RO(cpumap, 0);
   58
   59 static inline ssize_t cpulist_read(struct file *file, struct 
kobject *kobj,
   60                                    struct bin_attribute *attr, 
char *buf,
   61                                    loff_t off, size_t count)
   62 {
   63         struct device *dev = kobj_to_dev(kobj);
   64
   65         return node_read_cpumap(dev, true, buf, off, count);
   66 }
   67
   68 static BIN_ATTR_RO(cpulist, 0);

>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ