|
@@ -2810,6 +2810,9 @@ static int prepend(char **buffer, int *buflen, const char *str, int namelen)
|
|
* the beginning of the name. The sequence number check at the caller will
|
|
* the beginning of the name. The sequence number check at the caller will
|
|
* retry it again when a d_move() does happen. So any garbage in the buffer
|
|
* retry it again when a d_move() does happen. So any garbage in the buffer
|
|
* due to mismatched pointer and length will be discarded.
|
|
* due to mismatched pointer and length will be discarded.
|
|
|
|
+ *
|
|
|
|
+ * Data dependency barrier is needed to make sure that we see that terminating
|
|
|
|
+ * NUL. Alpha strikes again, film at 11...
|
|
*/
|
|
*/
|
|
static int prepend_name(char **buffer, int *buflen, struct qstr *name)
|
|
static int prepend_name(char **buffer, int *buflen, struct qstr *name)
|
|
{
|
|
{
|
|
@@ -2817,6 +2820,8 @@ static int prepend_name(char **buffer, int *buflen, struct qstr *name)
|
|
u32 dlen = ACCESS_ONCE(name->len);
|
|
u32 dlen = ACCESS_ONCE(name->len);
|
|
char *p;
|
|
char *p;
|
|
|
|
|
|
|
|
+ smp_read_barrier_depends();
|
|
|
|
+
|
|
*buflen -= dlen + 1;
|
|
*buflen -= dlen + 1;
|
|
if (*buflen < 0)
|
|
if (*buflen < 0)
|
|
return -ENAMETOOLONG;
|
|
return -ENAMETOOLONG;
|